Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update devdependecy conf nextjs #67140

Open
wants to merge 7 commits into
base: canary
Choose a base branch
from

Conversation

torresgol10
Copy link
Contributor

Bump devDependecy Conf to 13.0.1

@ijjk
Copy link
Member

ijjk commented Jun 24, 2024

Allow CI Workflow Run

  • approve CI run for commit: eac96cb

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@ijjk
Copy link
Member

ijjk commented Jun 24, 2024

Allow CI Workflow Run

  • approve CI run for commit: d3ca6a2

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

Copy link

socket-security bot commented Jun 24, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/postcss-scss@4.0.9 Transitive: environment +2 165 kB ai

🚮 Removed packages: npm/conf@5.0.0, npm/postcss-scss@4.0.3

View full report↗︎

@torresgol10
Copy link
Contributor Author

@samcx I have done the PR of conf in next

@torresgol10
Copy link
Contributor Author

@samcx As a step in packages/create-next-app I had to set the moduleResolution to bundler this fixes the import conf error but it was giving an error in import postcss-scss, I had to update this dependency to fix the error, as it was a dependency error in that version. Now everything is correct.

@samcx samcx added the CI approved Approve running CI for fork label Jun 27, 2024
@ijjk
Copy link
Member

ijjk commented Jun 27, 2024

Failing test suites

Commit: d3ca6a2

TURBOPACK=1 pnpm test test/integration/app-aspath/test/index.test.js (turbopack)

  • App asPath > should not have any changes in asPath after a bundle rebuild
Expand output

● App asPath › should not have any changes in asPath after a bundle rebuild

FetchError: request to http://localhost:34679/ failed, reason: connect ECONNREFUSED 127.0.0.1:34679

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1491:11)

Read more about building and testing Next.js in contributing.md.

@ijjk
Copy link
Member

ijjk commented Jun 27, 2024

Failing test suites

Commit: bfe71a3

TURBOPACK=1 pnpm test test/integration/500-page/test/index.test.js (turbopack)

  • 500 Page Support > development mode > should use pages/500
  • 500 Page Support > development mode > should set correct status code with pages/500
  • 500 Page Support > development mode > should not error when visited directly
  • 500 Page Support > development mode 2 > shows error with getInitialProps in pages/500 dev
Expand output

● 500 Page Support › development mode › should use pages/500

FetchError: request to http://localhost:36967/500 failed, reason: connect ECONNREFUSED 127.0.0.1:36967

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1491:11)

● 500 Page Support › development mode › should set correct status code with pages/500

FetchError: request to http://localhost:36967/500 failed, reason: connect ECONNREFUSED 127.0.0.1:36967

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1491:11)

● 500 Page Support › development mode › should not error when visited directly

FetchError: request to http://localhost:36967/500 failed, reason: connect ECONNREFUSED 127.0.0.1:36967

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1491:11)

● 500 Page Support › development mode 2 › shows error with getInitialProps in pages/500 dev

FetchError: request to http://localhost:40195/500 failed, reason: connect ECONNREFUSED 127.0.0.1:40195

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1491:11)

Read more about building and testing Next.js in contributing.md.

__NEXT_EXPERIMENTAL_PPR=true pnpm test test/integration/app-aspath/test/index.test.js (PPR)

  • App asPath > should not have any changes in asPath after a bundle rebuild
Expand output

● App asPath › should not have any changes in asPath after a bundle rebuild

FetchError: request to http://localhost:37577/ failed, reason: connect ECONNREFUSED 127.0.0.1:37577

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1491:11)

Read more about building and testing Next.js in contributing.md.

TURBOPACK=1 pnpm test test/integration/500-page/test/gsp-gssp.test.js (turbopack)

  • gsp-gssp > development mode > does not show error with getStaticProps in pages/500 dev
  • gsp-gssp > development mode > shows error with getServerSideProps in pages/500 dev
Expand output

● gsp-gssp › development mode › does not show error with getStaticProps in pages/500 dev

FetchError: request to http://localhost:42891/abc failed, reason: connect ECONNREFUSED 127.0.0.1:42891

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1491:11)

● gsp-gssp › development mode › shows error with getServerSideProps in pages/500 dev

dest already exists.

  at ../node_modules/.pnpm/fs-extra@9.0.0/node_modules/fs-extra/lib/move/move.js:41:31
  at ../node_modules/.pnpm/universalify@1.0.0/node_modules/universalify/index.js:21:54

Read more about building and testing Next.js in contributing.md.

TURBOPACK=1 pnpm test test/integration/404-page-ssg/test/index.test.js (turbopack)

  • 404 Page Support SSG > development mode > should respond to 404 correctly
  • 404 Page Support SSG > development mode > should render error correctly
  • 404 Page Support SSG > development mode > should not show an error in the logs for 404 SSG
  • 404 Page Support SSG > development mode > should render index page normal
Expand output

● 404 Page Support SSG › development mode › should respond to 404 correctly

FetchError: request to http://localhost:45231/404 failed, reason: connect ECONNREFUSED 127.0.0.1:45231

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1491:11)

● 404 Page Support SSG › development mode › should render error correctly

FetchError: request to http://localhost:45231/err failed, reason: connect ECONNREFUSED 127.0.0.1:45231

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1491:11)

● 404 Page Support SSG › development mode › should not show an error in the logs for 404 SSG

FetchError: request to http://localhost:45231/non-existent failed, reason: connect ECONNREFUSED 127.0.0.1:45231

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1491:11)

● 404 Page Support SSG › development mode › should render index page normal

FetchError: request to http://localhost:45231/ failed, reason: connect ECONNREFUSED 127.0.0.1:45231

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1491:11)

Read more about building and testing Next.js in contributing.md.

TURBOPACK=1 pnpm test test/integration/404-page/test/index.test.js (turbopack)

  • 404 Page Support > development mode > should use pages/404
  • 404 Page Support > development mode > should set correct status code with pages/404
  • 404 Page Support > development mode > should use pages/404 for .d.ts file
  • 404 Page Support > development mode > should not error when visited directly
  • 404 Page Support > development mode > should render _error for a 500 error still
  • 404 Page Support > development mode 2 > falls back to _error correctly without pages/404
  • 404 Page Support > development mode 2 > shows error with getInitialProps in pages/404 dev
  • 404 Page Support > development mode 2 > does not show error with getStaticProps in pages/404 dev
  • 404 Page Support > development mode 2 > shows error with getServerSideProps in pages/404 dev
Expand output

● 404 Page Support › development mode › should use pages/404

FetchError: request to http://localhost:44177/abc failed, reason: connect ECONNREFUSED 127.0.0.1:44177

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1491:11)

● 404 Page Support › development mode › should set correct status code with pages/404

FetchError: request to http://localhost:44177/abc failed, reason: connect ECONNREFUSED 127.0.0.1:44177

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1491:11)

● 404 Page Support › development mode › should use pages/404 for .d.ts file

FetchError: request to http://localhost:44177/invalidExtension failed, reason: connect ECONNREFUSED 127.0.0.1:44177

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1491:11)

● 404 Page Support › development mode › should not error when visited directly

FetchError: request to http://localhost:44177/404 failed, reason: connect ECONNREFUSED 127.0.0.1:44177

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1491:11)

● 404 Page Support › development mode › should render _error for a 500 error still

FetchError: request to http://localhost:44177/err failed, reason: connect ECONNREFUSED 127.0.0.1:44177

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1491:11)

● 404 Page Support › development mode 2 › falls back to _error correctly without pages/404

FetchError: request to http://localhost:34951/abc failed, reason: connect ECONNREFUSED 127.0.0.1:34951

  at ClientRequest.<anonymous> (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1491:11)

● 404 Page Support › development mode 2 › shows error with getInitialProps in pages/404 dev

ENOENT: no such file or directory, stat '/root/actions-runner/_work/next.js/next.js/test/integration/404-page/pages/404.js'

● 404 Page Support › development mode 2 › does not show error with getStaticProps in pages/404 dev

ENOENT: no such file or directory, stat '/root/actions-runner/_work/next.js/next.js/test/integration/404-page/pages/404.js'

● 404 Page Support › development mode 2 › shows error with getServerSideProps in pages/404 dev

ENOENT: no such file or directory, stat '/root/actions-runner/_work/next.js/next.js/test/integration/404-page/pages/404.js'

Read more about building and testing Next.js in contributing.md.

TURBOPACK=1 pnpm test-start test/e2e/app-dir/app-client-cache/client-cache.parallel-routes.test.ts (turbopack)

  • app-prefetch-static > should correctly navigate between static & dynamic pages
Expand output

● app-prefetch-static › should correctly navigate between static & dynamic pages

next build failed with code/signal 1

   97 |           if (code || signal)
   98 |             reject(
>  99 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  100 |             )
  101 |           else resolve()
  102 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:99:15)

Read more about building and testing Next.js in contributing.md.

TURBOPACK=1 pnpm test test/integration/app-dynamic-error/test/index.test.ts (turbopack)

  • app-dynamic-error > production mode > throws an error when prerendering a page with config dynamic error
Expand output

● app-dynamic-error › production mode › throws an error when prerendering a page with config dynamic error

expect(received).toContain(expected) // indexOf

Expected substring: "Error occurred prerendering page \"/dynamic-error\""
Received string:    "unhandledRejection /root/actions-runner/_work/next.js/next.js/packages/next/dist/compiled/conf/index.js:1
import{createRequire as e}from\"module\";import*as t from\"next/dist/compiled/semver\";var r={8999:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.formatNames=t.fastFormats=t.fullFormats=void 0;function fmtDef(e,t){return{validate:e,compare:t}}t.fullFormats={date:fmtDef(date,compareDate),time:fmtDef(getTime(true),compareTime),\"date-time\":fmtDef(getDateTime(true),compareDateTime),\"iso-time\":fmtDef(getTime(),compareIsoTime),\"iso-date-time\":fmtDef(getDateTime(),compareIsoDateTime),duration:/^P(?!$)((\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?|(\\d+W)?)$/,uri:uri,\"uri-reference\":/^(?:[a-z][a-z0-9+\\-.]*:)?(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\\.[a-z0-9\\-._~!$&'()*+,;=:]+)\\]|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)|(?:[a-z0-9\\-._~!$&'\"()*+,;=]|%[0-9a-f]{2})*)(?::\\d*)?(?:\\/(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})*)*|\\/(?:(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\\?(?:[a-z0-9\\-._~!$&'\"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\\-._~!$&'\"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,\"uri-template\":/^(?:(?:[^\\x00-\\x20\"'<>%\\\\^`{|}]|%[0-9a-f]{2})|\\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?)*\\})*$/i,url:/^(?:https?|ftp):\\/\\/(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)(?:\\.(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))$/i,regex:regex,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,\"json-pointer\":/^(?:\\/(?:[^~/]|~0|~1)*)*$/,\"json-pointer-uri-fragment\":/^#(?:\\/(?:[a-z0-9_\\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,\"relative-json-pointer\":/^(?:0|[1-9][0-9]*)(?:#|(?:\\/(?:[^~/]|~0|~1)*)*)$/,byte:byte,int32:{type:\"number\",validate:validateInt32},int64:{type:\"number\",validate:validateInt64},float:{type:\"number\",validate:validateNumber},double:{type:\"number\",validate:validateNumber},password:true,binary:true};t.fastFormats={...t.fullFormats,date:fmtDef(/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/,compareDate),time:fmtDef(/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i,compareTime),\"date-time\":fmtDef(/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\dt(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i,compareDateTime),\"iso-time\":fmtDef(/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)?$/i,compareIsoTime),\"iso-date-time\":fmtDef(/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s](?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)?$/i,compareIsoDateTime),uri:/^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/)?[^\\s]*$/i,\"uri-reference\":/^(?:(?:[a-z][a-z0-9+\\-.]*:)?\\/?\\/)?(?:[^\\\\\\s#][^\\s#]*)?(?:#[^\\\\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};t.formatNames=Object.keys(t.fullFormats);function isLeapYear(e){return e%4===0&&(e%100!==0||e%400===0)}const r=/^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$/;const n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function date(e){const t=r.exec(e);if(!t)return false;const a=+t[1];const s=+t[2];const o=+t[3];return s>=1&&s<=12&&o>=1&&o<=(s===2&&isLeapYear(a)?29:n[s])}function compareDate(e,t){if(!(e&&t))return undefined;if(e>t)return 1;if(e<t)return-1;return 0}const a=/^(\\d\\d):(\\d\\d):(\\d\\d(?:\\.\\d+)?)(z|([+-])(\\d\\d)(?::?(\\d\\d))?)?$/i;function getTime(e){return function time(t){const r=a.exec(t);if(!r)return false;const n=+r[1];const s=+r[2];const o=+r[3];const i=r[4];const c=r[5]===\"-\"?-1:1;const u=+(r[6]||0);const d=+(r[7]||0);if(u>23||d>59||e&&!i)return false;if(n<=23&&s<=59&&o<60)return true;const l=s-d*c;const f=n-u*c-(l<0?1:0);return(f===23||f===-1)&&(l===59||l===-1)&&o<61}}function compareTime(e,t){if(!(e&&t))return undefined;const r=new Date(\"2020-01-01T\"+e).valueOf();const n=new Date(\"2020-01-01T\"+t).valueOf();if(!(r&&n))return undefined;return r-n}function compareIsoTime(e,t){if(!(e&&t))return undefined;const r=a.exec(e);const n=a.exec(t);if(!(r&&n))return undefined;e=r[1]+r[2]+r[3];t=n[1]+n[2]+n[3];if(e>t)return 1;if(e<t)return-1;return 0}const s=/t|\\s/i;function getDateTime(e){const t=getTime(e);return function date_time(e){const r=e.split(s);return r.length===2&&date(r[0])&&t(r[1])}}function compareDateTime(e,t){if(!(e&&t))return undefined;const r=new Date(e).valueOf();const n=new Date(t).valueOf();if(!(r&&n))return undefined;return r-n}function compareIsoDateTime(e,t){if(!(e&&t))return undefined;const[r,n]=e.split(s);const[a,o]=t.split(s);const i=compareDate(r,a);if(i===undefined)return undefined;return i||compareTime(n,o)}const o=/\\/|:/;const i=/^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\\.[a-z0-9\\-._~!$&'()*+,;=:]+)\\]|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)|(?:[a-z0-9\\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\\d*)?(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\\?(?:[a-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function uri(e){return o.test(e)&&i.test(e)}const c=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function byte(e){c.lastIndex=0;return c.test(e)}const u=-(2**31);const d=2**31-1;function validateInt32(e){return Number.isInteger(e)&&e<=d&&e>=u}function validateInt64(e){return Number.isInteger(e)}function validateNumber(){return true}const l=/[^\\\\]\\\\Z/;function regex(e){if(l.test(e))return false;try{new RegExp(e);return true}catch(e){return false}}},4421:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});const n=r(8999);const a=r(9971);const s=r(3561);const o=new s.Name(\"fullFormats\");const i=new s.Name(\"fastFormats\");const formatsPlugin=(e,t={keywords:true})=>{if(Array.isArray(t)){addFormats(e,t,n.fullFormats,o);return e}const[r,s]=t.mode===\"fast\"?[n.fastFormats,i]:[n.fullFormats,o];const c=t.formats||n.formatNames;addFormats(e,c,r,s);if(t.keywords)(0,a.default)(e);return e};formatsPlugin.get=(e,t=\"full\")=>{const r=t===\"fast\"?n.fastFormats:n.fullFormats;const a=r[e];if(!a)throw new Error(`Unknown format \"${e}\"`);return a};function addFormats(e,t,r,n){var a;var o;(a=(o=e.opts.code).formats)!==null&&a!==void 0?a:o.formats=(0,s._)`require(\"ajv-formats/dist/formats\").${n}`;for(const n of t)e.addFormat(n,r[n])}e.exports=t=formatsPlugin;Object.defineProperty(t,\"__esModule\",{value:true});t[\"default\"]=formatsPlugin},9971:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.formatLimitDefinition=void 0;const n=r(8219);const a=r(3561);const s=a.operators;const o={formatMaximum:{okStr:\"<=\",ok:s.LTE,fail:s.GT},formatMinimum:{okStr:\">=\",ok:s.GTE,fail:s.LT},formatExclusiveMaximum:{okStr:\"<\",ok:s.LT,fail:s.GTE},formatExclusiveMinimum:{okStr:\">\",ok:s.GT,fail:s.LTE}};const i={message:({keyword:e,schemaCode:t})=>(0,a.str)`should be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,a._)`{comparison: ${o[e].okStr}, limit: ${t}}`};t.formatLimitDefinition={keyword:Object.keys(o),type:\"string\",schemaType:\"string\",$data:true,error:i,code(e){const{gen:t,data:r,schemaCode:s,keyword:i,it:c}=e;const{opts:u,self:d}=c;if(!u.validateFormats)return;const l=new n.KeywordCxt(c,d.RULES.all.format.definition,\"format\");if(l.$data)validate$DataFormat();else validateFormat();function validate$DataFormat(){const r=t.scopeValue(\"formats\",{ref:d.formats,code:u.code.formats});const n=t.const(\"fmt\",(0,a._)`${r}[${l.schemaCode}]`);e.fail$data((0,a.or)((0,a._)`typeof ${n} != \"object\"`,(0,a._)`${n} instanceof RegExp`,(0,a._)`typeof ${n}.compare != \"function\"`,compareCode(n)))}function validateFormat(){const r=l.schema;const n=d.formats[r];if(!n||n===true)return;if(typeof n!=\"object\"||n instanceof RegExp||typeof n.compare!=\"function\"){throw new Error(`\"${i}\": format \"${r}\" does not define \"compare\" function`)}const s=t.scopeValue(\"formats\",{key:r,ref:n,code:u.code.formats?(0,a._)`${u.code.formats}${(0,a.getProperty)(r)}`:undefined});e.fail$data(compareCode(s))}function compareCode(e){return(0,a._)`${e}.compare(${r}, ${s}) ${o[i].fail} 0`}},dependencies:[\"format\"]};const formatLimitPlugin=e=>{e.addKeyword(t.formatLimitDefinition);return e};t[\"default\"]=formatLimitPlugin},4521:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const n=r(3872);const a=r(4392);const s=r(4814);const o=r(7397);const i=\"https://json-schema.org/draft/2020-12/schema\";class Ajv2020 extends n.default{constructor(e={}){super({...e,dynamicRef:true,next:true,unevaluated:true})}_addVocabularies(){super._addVocabularies();a.default.forEach((e=>this.addVocabulary(e)));if(this.opts.discriminator)this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:e,meta:t}=this.opts;if(!t)return;o.default.call(this,e);this.refs[\"http://json-schema.org/schema\"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:undefined)}}t.Ajv2020=Ajv2020;e.exports=t=Ajv2020;e.exports.Ajv2020=Ajv2020;Object.defineProperty(t,\"__esModule\",{value:true});t[\"default\"]=Ajv2020;var c=r(6056);Object.defineProperty(t,\"KeywordCxt\",{enumerable:true,get:function(){return c.KeywordCxt}});var u=r(3561);Object.defineProperty(t,\"_\",{enumerable:true,get:function(){return u._}});Object.defineProperty(t,\"str\",{enumerable:true,get:function(){return u.str}});Object.defineProperty(t,\"stringify\",{enumerable:true,get:function(){return u.stringify}});Object.defineProperty(t,\"nil\",{enumerable:true,get:function(){return u.nil}});Object.defineProperty(t,\"Name\",{enumerable:true,get:function(){return u.Name}});Object.defineProperty(t,\"CodeGen\",{enumerable:true,get:function(){return u.CodeGen}});var d=r(818);Object.defineProperty(t,\"ValidationError\",{enumerable:true,get:function(){return d.default}});var l=r(9554);Object.defineProperty(t,\"MissingRefError\",{enumerable:true,get:function(){return l.default}})},8219:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=r(3872);const a=r(6832);const s=r(4814);const o=r(5137);const i=[\"/properties\"];const c=\"http://json-schema.org/draft-07/schema\";class Ajv extends n.default{_addVocabularies(){super._addVocabularies();a.default.forEach((e=>this.addVocabulary(e)));if(this.opts.discriminator)this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();if(!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,i):o;this.addMetaSchema(e,c,false);this.refs[\"http://json-schema.org/schema\"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:undefined)}}t.Ajv=Ajv;e.exports=t=Ajv;e.exports.Ajv=Ajv;Object.defineProperty(t,\"__esModule\",{value:true});t[\"default\"]=Ajv;var u=r(6056);Object.defineProperty(t,\"KeywordCxt\",{enumerable:true,get:function(){return u.KeywordCxt}});var d=r(3561);Object.defineProperty(t,\"_\",{enumerable:true,get:function(){return d._}});Object.defineProperty(t,\"str\",{enumerable:true,get:function(){return d.str}});Object.defineProperty(t,\"stringify\",{enumerable:true,get:function(){return d.stringify}});Object.defineProperty(t,\"nil\",{enumerable:true,get:function(){return d.nil}});Object.defineProperty(t,\"Name\",{enumerable:true,get:function(){return d.Name}});Object.defineProperty(t,\"CodeGen\",{enumerable:true,get:function(){return d.CodeGen}});var l=r(818);Object.defineProperty(t,\"ValidationError\",{enumerable:true,get:function(){return l.default}});var f=r(9554);Object.defineProperty(t,\"MissingRefError\",{enumerable:true,get:function(){return f.default}})},1364:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class _CodeOrName{}t._CodeOrName=_CodeOrName;t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Name extends _CodeOrName{constructor(e){super();if(!t.IDENTIFIER.test(e))throw new Error(\"CodeGen: name must be a valid identifier\");this.str=e}toString(){return this.str}emptyStr(){return false}get names(){return{[this.str]:1}}}t.Name=Name;class _Code extends _CodeOrName{constructor(e){super();this._items=typeof e===\"string\"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return false;const e=this._items[0];return e===\"\"||e==='\"\"'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),\"\")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce(((e,t)=>{if(t instanceof Name)e[t.str]=(e[t.str]||0)+1;return e}),{})}}t._Code=_Code;t.nil=new _Code(\"\");function _(e,...t){const r=[e[0]];let n=0;while(n<t.length){addCodeArg(r,t[n]);r.push(e[++n])}return new _Code(r)}t._=_;const r=new _Code(\"+\");function str(e,...t){const n=[safeStringify(e[0])];let a=0;while(a<t.length){n.push(r);addCodeArg(n,t[a]);n.push(r,safeStringify(e[++a]))}optimize(n);return new _Code(n)}t.str=str;function addCodeArg(e,t){if(t instanceof _Code)e.push(...t._items);else if(t instanceof Name)e.push(t);else e.push(interpolate(t))}t.addCodeArg=addCodeArg;function optimize(e){let t=1;while(t<e.length-1){if(e[t]===r){const r=mergeExprItems(e[t-1],e[t+1]);if(r!==undefined){e.splice(t-1,3,r);continue}e[t++]=\"+\"}t++}}function mergeExprItems(e,t){if(t==='\"\"')return e;if(e==='\"\"')return t;if(typeof e==\"string\"){if(t instanceof Name||e[e.length-1]!=='\"')return;if(typeof t!=\"string\")return`${e.slice(0,-1)}${t}\"`;if(t[0]==='\"')return e.slice(0,-1)+t.slice(1);return}if(typeof t==\"string\"&&t[0]==='\"'&&!(e instanceof Name))return`\"${e}${t.slice(1)}`;return}function strConcat(e,t){return t.emptyStr()?e:e.emptyStr()?t:str`${e}${t}`}t.strConcat=strConcat;function interpolate(e){return typeof e==\"number\"||typeof e==\"boolean\"||e===null?e:safeStringify(Array.isArray(e)?e.join(\",\"):e)}function stringify(e){return new _Code(safeStringify(e))}t.stringify=stringify;function safeStringify(e){return JSON.stringify(e).replace(/\\u2028/g,\"\\\\u2028\").replace(/\\u2029/g,\"\\\\u2029\")}t.safeStringify=safeStringify;function getProperty(e){return typeof e==\"string\"&&t.IDENTIFIER.test(e)?new _Code(`.${e}`):_`[${e}]`}t.getProperty=getProperty;function getEsmExportName(e){if(typeof e==\"string\"&&t.IDENTIFIER.test(e)){return new _Code(`${e}`)}throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}t.getEsmExportName=getEsmExportName;function regexpCode(e){return new _Code(e.toString())}t.regexpCode=regexpCode},3561:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const n=r(1364);const a=r(3087);var s=r(1364);Object.defineProperty(t,\"_\",{enumerable:true,get:function(){return s._}});Object.defineProperty(t,\"str\",{enumerable:true,get:function(){return s.str}});Object.defineProperty(t,\"strConcat\",{enumerable:true,get:function(){return s.strConcat}});Object.defineProperty(t,\"nil\",{enumerable:true,get:function(){return s.nil}});Object.defineProperty(t,\"getProperty\",{enumerable:true,get:function(){return s.getProperty}});Object.defineProperty(t,\"stringify\",{enumerable:true,get:function(){return s.stringify}});Object.defineProperty(t,\"regexpCode\",{enumerable:true,get:function(){return s.regexpCode}});Object.defineProperty(t,\"Name\",{enumerable:true,get:function(){return s.Name}});var o=r(3087);Object.defineProperty(t,\"Scope\",{enumerable:true,get:function(){return o.Scope}});Object.defineProperty(t,\"ValueScope\",{enumerable:true,get:function(){return o.ValueScope}});Object.defineProperty(t,\"ValueScopeName\",{enumerable:true,get:function(){return o.ValueScopeName}});Object.defineProperty(t,\"varKinds\",{enumerable:true,get:function(){return o.varKinds}});t.operators={GT:new n._Code(\">\"),GTE:new n._Code(\">=\"),LT:new n._Code(\"<\"),LTE:new n._Code(\"<=\"),EQ:new n._Code(\"===\"),NEQ:new n._Code(\"!==\"),NOT:new n._Code(\"!\"),OR:new n._Code(\"||\"),AND:new n._Code(\"&&\"),ADD:new n._Code(\"+\")};class Node{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Def extends Node{constructor(e,t,r){super();this.varKind=e;this.name=t;this.rhs=r}render({es5:e,_n:t}){const r=e?a.varKinds.var:this.varKind;const n=this.rhs===undefined?\"\":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=optimizeExpr(this.rhs,e,t);return this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class Assign extends Node{constructor(e,t,r){super();this.lhs=e;this.rhs=t;this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof n.Name&&!e[this.lhs.str]&&!this.sideEffects)return;this.rhs=optimizeExpr(this.rhs,e,t);return this}get names(){const e=this.lhs instanceof n.Name?{}:{...this.lhs.names};return addExprNames(e,this.rhs)}}class AssignOp extends Assign{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Label extends Node{constructor(e){super();this.label=e;this.names={}}render({_n:e}){return`${this.label}:`+e}}class Break extends Node{constructor(e){super();this.label=e;this.names={}}render({_n:e}){const t=this.label?` ${this.label}`:\"\";return`break${t};`+e}}class Throw extends Node{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class AnyCode extends Node{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:undefined}optimizeNames(e,t){this.code=optimizeExpr(this.code,e,t);return this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class ParentNode extends Node{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),\"\")}optimizeNodes(){const{nodes:e}=this;let t=e.length;while(t--){const r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:undefined}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;while(n--){const a=r[n];if(a.optimizeNames(e,t))continue;subtractNames(e,a.names);r.splice(n,1)}return r.length>0?this:undefined}get names(){return this.nodes.reduce(((e,t)=>addNames(e,t.names)),{})}}class BlockNode extends ParentNode{render(e){return\"{\"+e._n+super.render(e)+\"}\"+e._n}}class Root extends ParentNode{}class Else extends BlockNode{}Else.kind=\"else\";class If extends BlockNode{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+=\"else \"+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(e===true)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new Else(e):e}if(t){if(e===false)return t instanceof If?t:t.nodes;if(this.nodes.length)return this;return new If(not(e),t instanceof If?[t]:t.nodes)}if(e===false||!this.nodes.length)return undefined;return this}optimizeNames(e,t){var r;this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t);if(!(super.optimizeNames(e,t)||this.else))return;this.condition=optimizeExpr(this.condition,e,t);return this}get names(){const e=super.names;addExprNames(e,this.condition);if(this.else)addNames(e,this.else.names);return e}}If.kind=\"if\";class For extends BlockNode{}For.kind=\"for\";class ForLoop extends For{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;this.iteration=optimizeExpr(this.iteration,e,t);return this}get names(){return addNames(super.names,this.iteration.names)}}class ForRange extends For{constructor(e,t,r,n){super();this.varKind=e;this.name=t;this.from=r;this.to=n}render(e){const t=e.es5?a.varKinds.var:this.varKind;const{name:r,from:n,to:s}=this;return`for(${t} ${r}=${n}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){const e=addExprNames(super.names,this.from);return addExprNames(e,this.to)}}class ForIter extends For{constructor(e,t,r,n){super();this.loop=e;this.varKind=t;this.name=r;this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;this.iterable=optimizeExpr(this.iterable,e,t);return this}get names(){return addNames(super.names,this.iterable.names)}}class Func extends BlockNode{constructor(e,t,r){super();this.name=e;this.args=t;this.async=r}render(e){const t=this.async?\"async \":\"\";return`${t}function ${this.name}(${this.args})`+super.render(e)}}Func.kind=\"func\";class Return extends ParentNode{render(e){return\"return \"+super.render(e)}}Return.kind=\"return\";class Try extends BlockNode{render(e){let t=\"try\"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;super.optimizeNodes();(e=this.catch)===null||e===void 0?void 0:e.optimizeNodes();(t=this.finally)===null||t===void 0?void 0:t.optimizeNodes();return this}optimizeNames(e,t){var r,n;super.optimizeNames(e,t);(r=this.catch)===null||r===void 0?void 0:r.optimizeNames(e,t);(n=this.finally)===null||n===void 0?void 0:n.optimizeNames(e,t);return this}get names(){const e=super.names;if(this.catch)addNames(e,this.catch.names);if(this.finally)addNames(e,this.finally.names);return e}}class Catch extends BlockNode{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Catch.kind=\"catch\";class Finally extends BlockNode{render(e){return\"finally\"+super.render(e)}}Finally.kind=\"finally\";class CodeGen{constructor(e,t={}){this._values={};this._blockStarts=[];this._constants={};this.opts={...t,_n:t.lines?\"\\n\":\"\"};this._extScope=e;this._scope=new a.Scope({parent:e});this._nodes=[new Root]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);const n=this._values[r.prefix]||(this._values[r.prefix]=new Set);n.add(r);return r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const a=this._scope.toName(t);if(r!==undefined&&n)this._constants[a.str]=r;this._leafNode(new Def(e,a,r));return a}const(e,t,r){return this._def(a.varKinds.const,e,t,r)}let(e,t,r){return this._def(a.varKinds.let,e,t,r)}var(e,t,r){return this._def(a.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Assign(e,t,r))}add(e,r){return this._leafNode(new AssignOp(e,t.operators.ADD,r))}code(e){if(typeof e==\"function\")e();else if(e!==n.nil)this._leafNode(new AnyCode(e));return this}object(...e){const t=[\"{\"];for(const[r,a]of e){if(t.length>1)t.push(\",\");t.push(r);if(r!==a||this.opts.es5){t.push(\":\");(0,n.addCodeArg)(t,a)}}t.push(\"}\");return new n._Code(t)}if(e,t,r){this._blockNode(new If(e));if(t&&r){this.code(t).else().code(r).endIf()}else if(t){this.code(t).endIf()}else if(r){throw new Error('CodeGen: \"else\" body without \"then\" body')}return this}elseIf(e){return this._elseNode(new If(e))}else(){return this._elseNode(new Else)}endIf(){return this._endBlockNode(If,Else)}_for(e,t){this._blockNode(e);if(t)this.code(t).endFor();return this}for(e,t){return this._for(new ForLoop(e),t)}forRange(e,t,r,n,s=(this.opts.es5?a.varKinds.var:a.varKinds.let)){const o=this._scope.toName(e);return this._for(new ForRange(s,o,t,r),(()=>n(o)))}forOf(e,t,r,s=a.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var(\"_arr\",t);return this.forRange(\"_i\",0,(0,n._)`${e}.length`,(t=>{this.var(o,(0,n._)`${e}[${t}]`);r(o)}))}return this._for(new ForIter(\"of\",s,o,t),(()=>r(o)))}forIn(e,t,r,s=(this.opts.es5?a.varKinds.var:a.varKinds.const)){if(this.opts.ownProperties){return this.forOf(e,(0,n._)`Object.keys(${t})`,r)}const o=this._scope.toName(e);return this._for(new ForIter(\"in\",s,o,t),(()=>r(o)))}endFor(){return this._endBlockNode(For)}label(e){return this._leafNode(new Label(e))}break(e){return this._leafNode(new Break(e))}return(e){const t=new Return;this._blockNode(t);this.code(e);if(t.nodes.length!==1)throw new Error('CodeGen: \"return\" should have one node');return this._endBlockNode(Return)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: \"try\" without \"catch\" and \"finally\"');const n=new Try;this._blockNode(n);this.code(e);if(t){const e=this.name(\"e\");this._currNode=n.catch=new Catch(e);t(e)}if(r){this._currNode=n.finally=new Finally;this.code(r)}return this._endBlockNode(Catch,Finally)}throw(e){return this._leafNode(new Throw(e))}block(e,t){this._blockStarts.push(this._nodes.length);if(e)this.code(e).endBlock(t);return this}endBlock(e){const t=this._blockStarts.pop();if(t===undefined)throw new Error(\"CodeGen: not in self-balancing block\");const r=this._nodes.length-t;if(r<0||e!==undefined&&r!==e){throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`)}this._nodes.length=t;return this}func(e,t=n.nil,r,a){this._blockNode(new Func(e,t,r));if(a)this.code(a).endFunc();return this}endFunc(){return this._endBlockNode(Func)}optimize(e=1){while(e-- >0){this._root.optimizeNodes();this._root.optimizeNames(this._root.names,this._constants)}}_leafNode(e){this._currNode.nodes.push(e);return this}_blockNode(e){this._currNode.nodes.push(e);this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t){this._nodes.pop();return this}throw new Error(`CodeGen: not in block \"${t?`${e.kind}/${t.kind}`:e.kind}\"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof If)){throw new Error('CodeGen: \"else\" without \"if\"')}this._currNode=t.else=e;return this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}}t.CodeGen=CodeGen;function addNames(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function addExprNames(e,t){return t instanceof n._CodeOrName?addNames(e,t.names):e}function optimizeExpr(e,t,r){if(e instanceof n.Name)return replaceName(e);if(!canOptimize(e))return e;return new n._Code(e._items.reduce(((e,t)=>{if(t instanceof n.Name)t=replaceName(t);if(t instanceof n._Code)e.push(...t._items);else e.push(t);return e}),[]));function replaceName(e){const n=r[e.str];if(n===undefined||t[e.str]!==1)return e;delete t[e.str];return n}function canOptimize(e){return e instanceof n._Code&&e._items.some((e=>e instanceof n.Name&&t[e.str]===1&&r[e.str]!==undefined))}}function subtractNames(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function not(e){return typeof e==\"boolean\"||typeof e==\"number\"||e===null?!e:(0,n._)`!${par(e)}`}t.not=not;const i=mappend(t.operators.AND);function and(...e){return e.reduce(i)}t.and=and;const c=mappend(t.operators.OR);function or(...e){return e.reduce(c)}t.or=or;function mappend(e){return(t,r)=>t===n.nil?r:r===n.nil?t:(0,n._)`${par(t)} ${e} ${par(r)}`}function par(e){return e instanceof n.Name?e:(0,n._)`(${e})`}},3087:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=r(1364);class ValueError extends Error{constructor(e){super(`CodeGen: \"code\" for ${e} not defined`);this.value=e.value}}var a;(function(e){e[e[\"Started\"]=0]=\"Started\";e[e[\"Completed\"]=1]=\"Completed\"})(a||(t.UsedValueState=a={}));t.varKinds={const:new n.Name(\"const\"),let:new n.Name(\"let\"),var:new n.Name(\"var\")};class Scope{constructor({prefixes:e,parent:t}={}){this._names={};this._prefixes=e;this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){const t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e)){throw new Error(`CodeGen: prefix \"${e}\" is not allowed in this scope`)}return this._names[e]={prefix:e,index:0}}}t.Scope=Scope;class ValueScopeName extends n.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e;this.scopePath=(0,n._)`.${new n.Name(t)}[${r}]`}}t.ValueScopeName=ValueScopeName;const s=(0,n._)`\\n`;class ValueScope extends Scope{constructor(e){super(e);this._values={};this._scope=e.scope;this.opts={...e,_n:e.lines?s:n.nil}}get(){return this._scope}name(e){return new ValueScopeName(e,this._newName(e))}value(e,t){var r;if(t.ref===undefined)throw new Error(\"CodeGen: ref must be passed in value\");const n=this.toName(e);const{prefix:a}=n;const s=(r=t.key)!==null&&r!==void 0?r:t.ref;let o=this._values[a];if(o){const e=o.get(s);if(e)return e}else{o=this._values[a]=new Map}o.set(s,n);const i=this._scope[a]||(this._scope[a]=[]);const c=i.length;i[c]=t.ref;n.setValue(t,{property:a,itemIndex:c});return n}getValue(e,t){const r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(t.scopePath===undefined)throw new Error(`CodeGen: name \"${t}\" has no value`);return(0,n._)`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(e.value===undefined)throw new Error(`CodeGen: name \"${e}\" has no value`);return e.value.code}),t,r)}_reduceValues(e,r,s={},o){let i=n.nil;for(const c in e){const u=e[c];if(!u)continue;const d=s[c]=s[c]||new Map;u.forEach((e=>{if(d.has(e))return;d.set(e,a.Started);let s=r(e);if(s){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;i=(0,n._)`${i}${r} ${e} = ${s};${this.opts._n}`}else if(s=o===null||o===void 0?void 0:o(e)){i=(0,n._)`${i}${s}${this.opts._n}`}else{throw new ValueError(e)}d.set(e,a.Completed)}))}return i}}t.ValueScope=ValueScope},9443:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=r(3561);const a=r(5206);const s=r(6937);t.keywordError={message:({keyword:e})=>(0,n.str)`must pass \"${e}\" keyword validation`};t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,n.str)`\"${e}\" keyword must be ${t} ($data)`:(0,n.str)`\"${e}\" keyword is invalid ($data)`};function reportError(e,r=t.keywordError,a,s){const{it:o}=e;const{gen:i,compositeRule:c,allErrors:u}=o;const d=errorObjectCode(e,r,a);if(s!==null&&s!==void 0?s:c||u){addError(i,d)}else{returnErrors(o,(0,n._)`[${d}]`)}}t.reportError=reportError;function reportExtraError(e,r=t.keywordError,n){const{it:a}=e;const{gen:o,compositeRule:i,allErrors:c}=a;const u=errorObjectCode(e,r,n);addError(o,u);if(!(i||c)){returnErrors(a,s.default.vErrors)}}t.reportExtraError=reportExtraError;function resetErrorsCount(e,t){e.assign(s.default.errors,t);e.if((0,n._)`${s.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign((0,n._)`${s.default.vErrors}.length`,t)),(()=>e.assign(s.default.vErrors,null)))))}t.resetErrorsCount=resetErrorsCount;function extendErrors({gen:e,keyword:t,schemaValue:r,data:a,errsCount:o,it:i}){if(o===undefined)throw new Error(\"ajv implementation error\");const c=e.name(\"err\");e.forRange(\"i\",o,s.default.errors,(o=>{e.const(c,(0,n._)`${s.default.vErrors}[${o}]`);e.if((0,n._)`${c}.instancePath === undefined`,(()=>e.assign((0,n._)`${c}.instancePath`,(0,n.strConcat)(s.default.instancePath,i.errorPath))));e.assign((0,n._)`${c}.schemaPath`,(0,n.str)`${i.errSchemaPath}/${t}`);if(i.opts.verbose){e.assign((0,n._)`${c}.schema`,r);e.assign((0,n._)`${c}.data`,a)}}))}t.extendErrors=extendErrors;function addError(e,t){const r=e.const(\"err\",t);e.if((0,n._)`${s.default.vErrors} === null`,(()=>e.assign(s.default.vErrors,(0,n._)`[${r}]`)),(0,n._)`${s.default.vErrors}.push(${r})`);e.code((0,n._)`${s.default.errors}++`)}function returnErrors(e,t){const{gen:r,validateName:a,schemaEnv:s}=e;if(s.$async){r.throw((0,n._)`new ${e.ValidationError}(${t})`)}else{r.assign((0,n._)`${a}.errors`,t);r.return(false)}}const o={keyword:new n.Name(\"keyword\"),schemaPath:new n.Name(\"schemaPath\"),params:new n.Name(\"params\"),propertyName:new n.Name(\"propertyName\"),message:new n.Name(\"message\"),schema:new n.Name(\"schema\"),parentSchema:new n.Name(\"parentSchema\")};function errorObjectCode(e,t,r){const{createErrors:a}=e.it;if(a===false)return(0,n._)`{}`;return errorObject(e,t,r)}function errorObject(e,t,r={}){const{gen:n,it:a}=e;const s=[errorInstancePath(a,r),errorSchemaPath(e,r)];extraErrorProps(e,t,s);return n.object(...s)}function errorInstancePath({errorPath:e},{instancePath:t}){const r=t?(0,n.str)`${e}${(0,a.getErrorPath)(t,a.Type.Str)}`:e;return[s.default.instancePath,(0,n.strConcat)(s.default.instancePath,r)]}function errorSchemaPath({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:s}){let i=s?t:(0,n.str)`${t}/${e}`;if(r){i=(0,n.str)`${i}${(0,a.getErrorPath)(r,a.Type.Str)}`}return[o.schemaPath,i]}function extraErrorProps(e,{params:t,message:r},a){const{keyword:i,data:c,schemaValue:u,it:d}=e;const{opts:l,propertyName:f,topSchemaRef:p,schemaPath:m}=d;a.push([o.keyword,i],[o.params,typeof t==\"function\"?t(e):t||(0,n._)`{}`]);if(l.messages){a.push([o.message,typeof r==\"function\"?r(e):r])}if(l.verbose){a.push([o.schema,u],[o.parentSchema,(0,n._)`${p}${m}`],[s.default.data,c])}if(f)a.push([o.propertyName,f])}},5178:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=r(3561);const a=r(818);const s=r(6937);const o=r(1489);const i=r(5206);const c=r(6056);class SchemaEnv{constructor(e){var t;this.refs={};this.dynamicAnchors={};let r;if(typeof e.schema==\"object\")r=e.schema;this.schema=e.schema;this.schemaId=e.schemaId;this.root=e.root||this;this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,o.normalizeId)(r===null||r===void 0?void 0:r[e.schemaId||\"$id\"]);this.schemaPath=e.schemaPath;this.localRefs=e.localRefs;this.meta=e.meta;this.$async=r===null||r===void 0?void 0:r.$async;this.refs={}}}t.SchemaEnv=SchemaEnv;function compileSchema(e){const t=getCompilingSchema.call(this,e);if(t)return t;const r=(0,o.getFullPath)(this.opts.uriResolver,e.root.baseId);const{es5:i,lines:u}=this.opts.code;const{ownProperties:d}=this.opts;const l=new n.CodeGen(this.scope,{es5:i,lines:u,ownProperties:d});let f;if(e.$async){f=l.scopeValue(\"Error\",{ref:a.default,code:(0,n._)`require(\"ajv/dist/runtime/validation_error\").default`})}const p=l.scopeName(\"validate\");e.validateName=p;const m={gen:l,allErrors:this.opts.allErrors,data:s.default.data,parentData:s.default.parentData,parentDataProperty:s.default.parentDataProperty,dataNames:[s.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:l.scopeValue(\"schema\",this.opts.code.source===true?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:f,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?\"\":\"#\"),errorPath:(0,n._)`\"\"`,opts:this.opts,self:this};let h;try{this._compilations.add(e);(0,c.validateFunctionCode)(m);l.optimize(this.opts.code.optimize);const t=l.toString();h=`${l.scopeRefs(s.default.scope)}return ${t}`;if(this.opts.code.process)h=this.opts.code.process(h,e);const r=new Function(`${s.default.self}`,`${s.default.scope}`,h);const a=r(this,this.scope.get());this.scope.value(p,{ref:a});a.errors=null;a.schema=e.schema;a.schemaEnv=e;if(e.$async)a.$async=true;if(this.opts.code.source===true){a.source={validateName:p,validateCode:t,scopeValues:l._values}}if(this.opts.unevaluated){const{props:e,items:t}=m;a.evaluated={props:e instanceof n.Name?undefined:e,items:t instanceof n.Name?undefined:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name};if(a.source)a.source.evaluated=(0,n.stringify)(a.evaluated)}e.validate=a;return e}catch(t){delete e.validate;delete e.validateName;if(h)this.logger.error(\"Error compiling schema, function code:\",h);throw t}finally{this._compilations.delete(e)}}t.compileSchema=compileSchema;function resolveRef(e,t,r){var n;r=(0,o.resolveUrl)(this.opts.uriResolver,t,r);const a=e.refs[r];if(a)return a;let s=resolve.call(this,e,r);if(s===undefined){const a=(n=e.localRefs)===null||n===void 0?void 0:n[r];const{schemaId:o}=this.opts;if(a)s=new SchemaEnv({schema:a,schemaId:o,root:e,baseId:t})}if(s===undefined)return;return e.refs[r]=inlineOrCompile.call(this,s)}t.resolveRef=resolveRef;function inlineOrCompile(e){if((0,o.inlineRef)(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:compileSchema.call(this,e)}function getCompilingSchema(e){for(const t of this._compilations){if(sameSchemaEnv(t,e))return t}}t.getCompilingSchema=getCompilingSchema;function sameSchemaEnv(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function resolve(e,t){let r;while(typeof(r=this.refs[t])==\"string\")t=r;return r||this.schemas[t]||resolveSchema.call(this,e,t)}function resolveSchema(e,t){const r=this.opts.uriResolver.parse(t);const n=(0,o._getFullPath)(this.opts.uriResolver,r);let a=(0,o.getFullPath)(this.opts.uriResolver,e.baseId,undefined);if(Object.keys(e.schema).length>0&&n===a){return getJsonPointer.call(this,r,e)}const s=(0,o.normalizeId)(n);const i=this.refs[s]||this.schemas[s];if(typeof i==\"string\"){const t=resolveSchema.call(this,e,i);if(typeof(t===null||t===void 0?void 0:t.schema)!==\"object\")return;return getJsonPointer.call(this,r,t)}if(typeof(i===null||i===void 0?void 0:i.schema)!==\"object\")return;if(!i.validate)compileSchema.call(this,i);if(s===(0,o.normalizeId)(t)){const{schema:t}=i;const{schemaId:r}=this.opts;const n=t[r];if(n)a=(0,o.resolveUrl)(this.opts.uriResolver,a,n);return new SchemaEnv({schema:t,schemaId:r,root:e,baseId:a})}return getJsonPointer.call(this,r,i)}t.resolveSchema=resolveSchema;const u=new Set([\"properties\",\"patternProperties\",\"enum\",\"dependencies\",\"definitions\"]);function getJsonPointer(e,{baseId:t,schema:r,root:n}){var a;if(((a=e.fragment)===null||a===void 0?void 0:a[0])!==\"/\")return;for(const n of e.fragment.slice(1).split(\"/\")){if(typeof r===\"boolean\")return;const e=r[(0,i.unescapeFragment)(n)];if(e===undefined)return;r=e;const a=typeof r===\"object\"&&r[this.opts.schemaId];if(!u.has(n)&&a){t=(0,o.resolveUrl)(this.opts.uriResolver,t,a)}}let s;if(typeof r!=\"boolean\"&&r.$ref&&!(0,i.schemaHasRulesButRef)(r,this.RULES)){const e=(0,o.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=resolveSchema.call(this,n,e)}const{schemaId:c}=this.opts;s=s||new SchemaEnv({schema:r,schemaId:c,root:n,baseId:t});if(s.schema!==s.root.schema)return s;return undefined}},6937:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});const n=r(3561);const a={data:new n.Name(\"data\"),valCxt:new n.Name(\"valCxt\"),instancePath:new n.Name(\"instancePath\"),parentData:new n.Name(\"parentData\"),parentDataProperty:new n.Name(\"parentDataProperty\"),rootData:new n.Name(\"rootData\"),dynamicAnchors:new n.Name(\"dynamicAnchors\"),vErrors:new n.Name(\"vErrors\"),errors:new n.Name(\"errors\"),this:new n.Name(\"this\"),self:new n.Name(\"self\"),scope:new n.Name(\"scope\"),json:new n.Name(\"json\"),jsonPos:new n.Name(\"jsonPos\"),jsonLen:new n.Name(\"jsonLen\"),jsonPart:new n.Name(\"jsonPart\")};t[\"default\"]=a},9554:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});const n=r(1489);class MissingRefError extends Error{constructor(e,t,r,a){super(a||`can't resolve reference ${r} from id ${t}`);this.missingRef=(0,n.resolveUrl)(e,t,r);this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t[\"default\"]=MissingRefError},1489:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const n=r(5206);const a=r(1230);const s=r(9122);const o=new Set([\"type\",\"format\",\"pattern\",\"maxLength\",\"minLength\",\"maxProperties\",\"minProperties\",\"maxItems\",\"minItems\",\"maximum\",\"minimum\",\"uniqueItems\",\"multipleOf\",\"required\",\"enum\",\"const\"]);function inlineRef(e,t=true){if(typeof e==\"boolean\")return true;if(t===true)return!hasRef(e);if(!t)return false;return countKeys(e)<=t}t.inlineRef=inlineRef;const i=new Set([\"$ref\",\"$recursiveRef\",\"$recursiveAnchor\",\"$dynamicRef\",\"$dynamicAnchor\"]);function hasRef(e){for(const t in e){if(i.has(t))return true;const r=e[t];if(Array.isArray(r)&&r.some(hasRef))return true;if(typeof r==\"object\"&&hasRef(r))return true}return false}function countKeys(e){let t=0;for(const r in e){if(r===\"$ref\")return Infinity;t++;if(o.has(r))continue;if(typeof e[r]==\"object\"){(0,n.eachItem)(e[r],(e=>t+=countKeys(e)))}if(t===Infinity)return Infinity}return t}function getFullPath(e,t=\"\",r){if(r!==false)t=normalizeId(t);const n=e.parse(t);return _getFullPath(e,n)}t.getFullPath=getFullPath;function _getFullPath(e,t){const r=e.serialize(t);return r.split(\"#\")[0]+\"#\"}t._getFullPath=_getFullPath;const c=/#\\/?$/;function normalizeId(e){return e?e.replace(c,\"\"):\"\"}t.normalizeId=normalizeId;function resolveUrl(e,t,r){r=normalizeId(r);return e.resolve(t,r)}t.resolveUrl=resolveUrl;const u=/^[a-z_][-a-z0-9._]*$/i;function getSchemaRefs(e,t){if(typeof e==\"boolean\")return{};const{schemaId:r,uriResolver:n}=this.opts;const o=normalizeId(e[r]||t);const i={\"\":o};const c=getFullPath(n,o,false);const d={};const l=new Set;s(e,{allKeys:true},((e,t,n,a)=>{if(a===undefined)return;const s=c+t;let o=i[a];if(typeof e[r]==\"string\")o=addRef.call(this,e[r]);addAnchor.call(this,e.$anchor);addAnchor.call(this,e.$dynamicAnchor);i[t]=o;function addRef(t){const r=this.opts.uriResolver.resolve;t=normalizeId(o?r(o,t):t);if(l.has(t))throw ambiguos(t);l.add(t);let n=this.refs[t];if(typeof n==\"string\")n=this.refs[n];if(typeof n==\"object\"){checkAmbiguosRef(e,n.schema,t)}else if(t!==normalizeId(s)){if(t[0]===\"#\"){checkAmbiguosRef(e,d[t],t);d[t]=e}else{this.refs[t]=s}}return t}function addAnchor(e){if(typeof e==\"string\"){if(!u.test(e))throw new Error(`invalid anchor \"${e}\"`);addRef.call(this,`#${e}`)}}}));return d;function checkAmbiguosRef(e,t,r){if(t!==undefined&&!a(e,t))throw ambiguos(r)}function ambiguos(e){return new Error(`reference \"${e}\" resolves to more than one schema`)}}t.getSchemaRefs=getSchemaRefs},315:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.getRules=t.isJSONType=void 0;const r=[\"string\",\"number\",\"integer\",\"boolean\",\"null\",\"object\",\"array\"];const n=new Set(r);function isJSONType(e){return typeof e==\"string\"&&n.has(e)}t.isJSONType=isJSONType;function getRules(){const e={number:{type:\"number\",rules:[]},string:{type:\"string\",rules:[]},array:{type:\"array\",rules:[]},object:{type:\"object\",rules:[]}};return{types:{...e,integer:true,boolean:true,null:true},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}t.getRules=getRules},5206:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const n=r(3561);const a=r(1364);function toHash(e){const t={};for(const r of e)t[r]=true;return t}t.toHash=toHash;function alwaysValidSchema(e,t){if(typeof t==\"boolean\")return t;if(Object.keys(t).length===0)return true;checkUnknownRules(e,t);return!schemaHasRules(t,e.self.RULES.all)}t.alwaysValidSchema=alwaysValidSchema;function checkUnknownRules(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t===\"boolean\")return;const a=n.RULES.keywords;for(const r in t){if(!a[r])checkStrictMode(e,`unknown keyword: \"${r}\"`)}}t.checkUnknownRules=checkUnknownRules;function schemaHasRules(e,t){if(typeof e==\"boolean\")return!e;for(const r in e)if(t[r])return true;return false}t.schemaHasRules=schemaHasRules;function schemaHasRulesButRef(e,t){if(typeof e==\"boolean\")return!e;for(const r in e)if(r!==\"$ref\"&&t.all[r])return true;return false}t.schemaHasRulesButRef=schemaHasRulesButRef;function schemaRefOrVal({topSchemaRef:e,schemaPath:t},r,a,s){if(!s){if(typeof r==\"number\"||typeof r==\"boolean\")return r;if(typeof r==\"string\")return(0,n._)`${r}`}return(0,n._)`${e}${t}${(0,n.getProperty)(a)}`}t.schemaRefOrVal=schemaRefOrVal;function unescapeFragment(e){return unescapeJsonPointer(decodeURIComponent(e))}t.unescapeFragment=unescapeFragment;function escapeFragment(e){return encodeURIComponent(escapeJsonPointer(e))}t.escapeFragment=escapeFragment;function escapeJsonPointer(e){if(typeof e==\"number\")return`${e}`;return e.replace(/~/g,\"~0\").replace(/\\//g,\"~1\")}t.escapeJsonPointer=escapeJsonPointer;function unescapeJsonPointer(e){return e.replace(/~1/g,\"/\").replace(/~0/g,\"~\")}t.unescapeJsonPointer=unescapeJsonPointer;function eachItem(e,t){if(Array.isArray(e)){for(const r of e)t(r)}else{t(e)}}t.eachItem=eachItem;function makeMergeEvaluated({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:a}){return(s,o,i,c)=>{const u=i===undefined?o:i instanceof n.Name?(o instanceof n.Name?e(s,o,i):t(s,o,i),i):o instanceof n.Name?(t(s,i,o),o):r(o,i);return c===n.Name&&!(u instanceof n.Name)?a(s,u):u}}t.mergeEvaluated={props:makeMergeEvaluated({mergeNames:(e,t,r)=>e.if((0,n._)`${r} !== true && ${t} !== undefined`,(()=>{e.if((0,n._)`${t} === true`,(()=>e.assign(r,true)),(()=>e.assign(r,(0,n._)`${r} || {}`).code((0,n._)`Object.assign(${r}, ${t})`)))})),mergeToName:(e,t,r)=>e.if((0,n._)`${r} !== true`,(()=>{if(t===true){e.assign(r,true)}else{e.assign(r,(0,n._)`${r} || {}`);setEvaluated(e,r,t)}})),mergeValues:(e,t)=>e===true?true:{...e,...t},resultToName:evaluatedPropsToName}),items:makeMergeEvaluated({mergeNames:(e,t,r)=>e.if((0,n._)`${r} !== true && ${t} !== undefined`,(()=>e.assign(r,(0,n._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`))),mergeToName:(e,t,r)=>e.if((0,n._)`${r} !== true`,(()=>e.assign(r,t===true?true:(0,n._)`${r} > ${t} ? ${r} : ${t}`))),mergeValues:(e,t)=>e===true?true:Math.max(e,t),resultToName:(e,t)=>e.var(\"items\",t)})};function evaluatedPropsToName(e,t){if(t===true)return e.var(\"props\",true);const r=e.var(\"props\",(0,n._)`{}`);if(t!==undefined)setEvaluated(e,r,t);return r}t.evaluatedPropsToName=evaluatedPropsToName;function setEvaluated(e,t,r){Object.keys(r).forEach((r=>e.assign((0,n._)`${t}${(0,n.getProperty)(r)}`,true)))}t.setEvaluated=setEvaluated;const s={};function useFunc(e,t){return e.scopeValue(\"func\",{ref:t,code:s[t.code]||(s[t.code]=new a._Code(t.code))})}t.useFunc=useFunc;var o;(function(e){e[e[\"Num\"]=0]=\"Num\";e[e[\"Str\"]=1]=\"Str\"})(o||(t.Type=o={}));function getErrorPath(e,t,r){if(e instanceof n.Name){const a=t===o.Num;return r?a?(0,n._)`\"[\" + ${e} + \"]\"`:(0,n._)`\"['\" + ${e} + \"']\"`:a?(0,n._)`\"/\" + ${e}`:(0,n._)`\"/\" + ${e}.replace(/~/g, \"~0\").replace(/\\\\//g, \"~1\")`}return r?(0,n.getProperty)(e).toString():\"/\"+escapeJsonPointer(e)}t.getErrorPath=getErrorPath;function checkStrictMode(e,t,r=e.opts.strictSchema){if(!r)return;t=`strict mode: ${t}`;if(r===true)throw new Error(t);e.self.logger.warn(t)}t.checkStrictMode=checkStrictMode},6567:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0;function schemaHasRulesForType({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==true&&shouldUseGroup(e,n)}t.schemaHasRulesForType=schemaHasRulesForType;function shouldUseGroup(e,t){return t.rules.some((t=>shouldUseRule(e,t)))}t.shouldUseGroup=shouldUseGroup;function shouldUseRule(e,t){var r;return e[t.keyword]!==undefined||((r=t.definition.implements)===null||r===void 0?void 0:r.some((t=>e[t]!==undefined)))}t.shouldUseRule=shouldUseRule},7144:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const n=r(9443);const a=r(3561);const s=r(6937);const o={message:\"boolean schema is false\"};function topBoolOrEmptySchema(e){const{gen:t,schema:r,validateName:n}=e;if(r===false){falseSchemaError(e,false)}else if(typeof r==\"object\"&&r.$async===true){t.return(s.default.data)}else{t.assign((0,a._)`${n}.errors`,null);t.return(true)}}t.topBoolOrEmptySchema=topBoolOrEmptySchema;function boolOrEmptySchema(e,t){const{gen:r,schema:n}=e;if(n===false){r.var(t,false);falseSchemaError(e)}else{r.var(t,true)}}t.boolOrEmptySchema=boolOrEmptySchema;function falseSchemaError(e,t){const{gen:r,data:a}=e;const s={gen:r,keyword:\"false schema\",data:a,schema:false,schemaCode:false,schemaValue:false,params:{},it:e};(0,n.reportError)(s,o,undefined,t)}},6794:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const n=r(315);const a=r(6567);const s=r(9443);const o=r(3561);const i=r(5206);var c;(function(e){e[e[\"Correct\"]=0]=\"Correct\";e[e[\"Wrong\"]=1]=\"Wrong\"})(c||(t.DataType=c={}));function getSchemaTypes(e){const t=getJSONTypes(e.type);const r=t.includes(\"null\");if(r){if(e.nullable===false)throw new Error(\"type: null contradicts nullable: false\")}else{if(!t.length&&e.nullable!==undefined){throw new Error('\"nullable\" cannot be used without \"type\"')}if(e.nullable===true)t.push(\"null\")}return t}t.getSchemaTypes=getSchemaTypes;function getJSONTypes(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(n.isJSONType))return t;throw new Error(\"type must be JSONType or JSONType[]: \"+t.join(\",\"))}t.getJSONTypes=getJSONTypes;function coerceAndCheckDataType(e,t){const{gen:r,data:n,opts:s}=e;const o=coerceToTypes(t,s.coerceTypes);const i=t.length>0&&!(o.length===0&&t.length===1&&(0,a.schemaHasRulesForType)(e,t[0]));if(i){const a=checkDataTypes(t,n,s.strictNumbers,c.Wrong);r.if(a,(()=>{if(o.length)coerceData(e,t,o);else reportTypeError(e)}))}return i}t.coerceAndCheckDataType=coerceAndCheckDataType;const u=new Set([\"string\",\"number\",\"integer\",\"boolean\",\"null\"]);function coerceToTypes(e,t){return t?e.filter((e=>u.has(e)||t===\"array\"&&e===\"array\")):[]}function coerceData(e,t,r){const{gen:n,data:a,opts:s}=e;const i=n.let(\"dataType\",(0,o._)`typeof ${a}`);const c=n.let(\"coerced\",(0,o._)`undefined`);if(s.coerceTypes===\"array\"){n.if((0,o._)`${i} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,(()=>n.assign(a,(0,o._)`${a}[0]`).assign(i,(0,o._)`typeof ${a}`).if(checkDataTypes(t,a,s.strictNumbers),(()=>n.assign(c,a)))))}n.if((0,o._)`${c} !== undefined`);for(const e of r){if(u.has(e)||e===\"array\"&&s.coerceTypes===\"array\"){coerceSpecificType(e)}}n.else();reportTypeError(e);n.endIf();n.if((0,o._)`${c} !== undefined`,(()=>{n.assign(a,c);assignParentData(e,c)}));function coerceSpecificType(e){switch(e){case\"string\":n.elseIf((0,o._)`${i} == \"number\" || ${i} == \"boolean\"`).assign(c,(0,o._)`\"\" + ${a}`).elseIf((0,o._)`${a} === null`).assign(c,(0,o._)`\"\"`);return;case\"number\":n.elseIf((0,o._)`${i} == \"boolean\" || ${a} === null
^^^^^^·
SyntaxError: Cannot use import statement outside a module

  63 |         return originalRequire.call(this, `next/dist/server/route-modules/pages/vendored/contexts/${path.basename(request, '.shared-runtime')}`);
  64 |     }
> 65 |     return originalRequire.call(this, request);
     |                            ^
  66 | };
  67 |
  68 | //# sourceMappingURL=require-hook.js.map

  at mod.require (../packages/next/dist/server/require-hook.js:65:28)
  at Object.<anonymous> (../packages/next/dist/telemetry/storage.js:12:54)
  "
  at Object.toContain (integration/app-dynamic-error/test/index.test.ts:13:24)

Read more about building and testing Next.js in contributing.md.

pnpm test test/integration/amphtml-fragment-style/test/index.test.js

  • AMP Fragment Styles > production mode > adds styles from fragment in AMP mode correctly
Expand output

● AMP Fragment Styles › production mode › adds styles from fragment in AMP mode correctly

command failed with code 1 signal null
unhandledRejection /root/actions-runner/_work/next.js/next.js/packages/next/dist/compiled/conf/index.js:1
import{createRequire as e}from"module";import*as t from"next/dist/compiled/semver";var r={8999:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.formatNames=t.fastFormats=t.fullFormats=void 0;function fmtDef(e,t){return{validate:e,compare:t}}t.fullFormats={date:fmtDef(date,compareDate),time:fmtDef(getTime(true),compareTime),"date-time":fmtDef(getDateTime(true),compareDateTime),"iso-time":fmtDef(getTime(),compareIsoTime),"iso-date-time":fmtDef(getDateTime(),compareIsoDateTime),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:uri,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:regex,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:byte,int32:{type:"number",validate:validateInt32},int64:{type:"number",validate:validateInt64},float:{type:"number",validate:validateNumber},double:{type:"number",validate:validateNumber},password:true,binary:true};t.fastFormats={...t.fullFormats,date:fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,compareDate),time:fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,compareTime),"date-time":fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,compareDateTime),"iso-time":fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,compareIsoTime),"iso-date-time":fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,compareIsoDateTime),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};t.formatNames=Object.keys(t.fullFormats);function isLeapYear(e){return e%4===0&&(e%100!==0||e%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;const n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function date(e){const t=r.exec(e);if(!t)return false;const a=+t[1];const s=+t[2];const o=+t[3];return s>=1&&s<=12&&o>=1&&o<=(s===2&&isLeapYear(a)?29:n[s])}function compareDate(e,t){if(!(e&&t))return undefined;if(e>t)return 1;if(e<t)return-1;return 0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function getTime(e){return function time(t){const r=a.exec(t);if(!r)return false;const n=+r[1];const s=+r[2];const o=+r[3];const i=r[4];const c=r[5]==="-"?-1:1;const u=+(r[6]||0);const d=+(r[7]||0);if(u>23||d>59||e&&!i)return false;if(n<=23&&s<=59&&o<60)return true;const l=s-d*c;const f=n-u*c-(l<0?1:0);return(f===23||f===-1)&&(l===59||l===-1)&&o<61}}function compareTime(e,t){if(!(e&&t))return undefined;const r=new Date("2020-01-01T"+e).valueOf();const n=new Date("2020-01-01T"+t).valueOf();if(!(r&&n))return undefined;return r-n}function compareIsoTime(e,t){if(!(e&&t))return undefined;const r=a.exec(e);const n=a.exec(t);if(!(r&&n))return undefined;e=r[1]+r[2]+r[3];t=n[1]+n[2]+n[3];if(e>t)return 1;if(e<t)return-1;return 0}const s=/t|\s/i;function getDateTime(e){const t=getTime(e);return function date_time(e){const r=e.split(s);return r.length===2&&date(r[0])&&t(r[1])}}function compareDateTime(e,t){if(!(e&&t))return undefined;const r=new Date(e).valueOf();const n=new Date(t).valueOf();if(!(r&&n))return undefined;return r-n}function compareIsoDateTime(e,t){if(!(e&&t))return undefined;const[r,n]=e.split(s);const[a,o]=t.split(s);const i=compareDate(r,a);if(i===undefined)return undefined;return i||compareTime(n,o)}const o=/\/|:/;const i=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function uri(e){return o.test(e)&&i.test(e)}const c=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function byte(e){c.lastIndex=0;return c.test(e)}const u=-(2**31);const d=2**31-1;function validateInt32(e){return Number.isInteger(e)&&e<=d&&e>=u}function validateInt64(e){return Number.isInteger(e)}function validateNumber(){return true}const l=/[^\\]\\Z/;function regex(e){if(l.test(e))return false;try{new RegExp(e);return true}catch(e){return false}}},4421:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(8999);const a=r(9971);const s=r(3561);const o=new s.Name("fullFormats");const i=new s.Name("fastFormats");const formatsPlugin=(e,t={keywords:true})=>{if(Array.isArray(t)){addFormats(e,t,n.fullFormats,o);return e}const[r,s]=t.mode==="fast"?[n.fastFormats,i]:[n.fullFormats,o];const c=t.formats||n.formatNames;addFormats(e,c,r,s);if(t.keywords)(0,a.default)(e);return e};formatsPlugin.get=(e,t="full")=>{const r=t==="fast"?n.fastFormats:n.fullFormats;const a=r[e];if(!a)throw new Error(`Unknown format "${e}"`);return a};function addFormats(e,t,r,n){var a;var o;(a=(o=e.opts.code).formats)!==null&&a!==void 0?a:o.formats=(0,s._)`require("ajv-formats/dist/formats").${n}`;for(const n of t)e.addFormat(n,r[n])}e.exports=t=formatsPlugin;Object.defineProperty(t,"__esModule",{value:true});t["default"]=formatsPlugin},9971:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.formatLimitDefinition=void 0;const n=r(8219);const a=r(3561);const s=a.operators;const o={formatMaximum:{okStr:"<=",ok:s.LTE,fail:s.GT},formatMinimum:{okStr:">=",ok:s.GTE,fail:s.LT},formatExclusiveMaximum:{okStr:"<",ok:s.LT,fail:s.GTE},formatExclusiveMinimum:{okStr:">",ok:s.GT,fail:s.LTE}};const i={message:({keyword:e,schemaCode:t})=>(0,a.str)`should be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,a._)`{comparison: ${o[e].okStr}, limit: ${t}}`};t.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:true,error:i,code(e){const{gen:t,data:r,schemaCode:s,keyword:i,it:c}=e;const{opts:u,self:d}=c;if(!u.validateFormats)return;const l=new n.KeywordCxt(c,d.RULES.all.format.definition,"format");if(l.$data)validate$DataFormat();else validateFormat();function validate$DataFormat(){const r=t.scopeValue("formats",{ref:d.formats,code:u.code.formats});const n=t.const("fmt",(0,a._)`${r}[${l.schemaCode}]`);e.fail$data((0,a.or)((0,a._)`typeof ${n} != "object"`,(0,a._)`${n} instanceof RegExp`,(0,a._)`typeof ${n}.compare != "function"`,compareCode(n)))}function validateFormat(){const r=l.schema;const n=d.formats[r];if(!n||n===true)return;if(typeof n!="object"||n instanceof RegExp||typeof n.compare!="function"){throw new Error(`"${i}": format "${r}" does not define "compare" function`)}const s=t.scopeValue("formats",{key:r,ref:n,code:u.code.formats?(0,a._)`${u.code.formats}${(0,a.getProperty)(r)}`:undefined});e.fail$data(compareCode(s))}function compareCode(e){return(0,a._)`${e}.compare(${r}, ${s}) ${o[i].fail} 0`}},dependencies:["format"]};const formatLimitPlugin=e=>{e.addKeyword(t.formatLimitDefinition);return e};t["default"]=formatLimitPlugin},4521:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const n=r(3872);const a=r(4392);const s=r(4814);const o=r(7397);const i="https://json-schema.org/draft/2020-12/schema";class Ajv2020 extends n.default{constructor(e={}){super({...e,dynamicRef:true,next:true,unevaluated:true})}_addVocabularies(){super._addVocabularies();a.default.forEach((e=>this.addVocabulary(e)));if(this.opts.discriminator)this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:e,meta:t}=this.opts;if(!t)return;o.default.call(this,e);this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:undefined)}}t.Ajv2020=Ajv2020;e.exports=t=Ajv2020;e.exports.Ajv2020=Ajv2020;Object.defineProperty(t,"__esModule",{value:true});t["default"]=Ajv2020;var c=r(6056);Object.defineProperty(t,"KeywordCxt",{enumerable:true,get:function(){return c.KeywordCxt}});var u=r(3561);Object.defineProperty(t,"_",{enumerable:true,get:function(){return u._}});Object.defineProperty(t,"str",{enumerable:true,get:function(){return u.str}});Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return u.stringify}});Object.defineProperty(t,"nil",{enumerable:true,get:function(){return u.nil}});Object.defineProperty(t,"Name",{enumerable:true,get:function(){return u.Name}});Object.defineProperty(t,"CodeGen",{enumerable:true,get:function(){return u.CodeGen}});var d=r(818);Object.defineProperty(t,"ValidationError",{enumerable:true,get:function(){return d.default}});var l=r(9554);Object.defineProperty(t,"MissingRefError",{enumerable:true,get:function(){return l.default}})},8219:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=r(3872);const a=r(6832);const s=r(4814);const o=r(5137);const i=["/properties"];const c="http://json-schema.org/draft-07/schema";class Ajv extends n.default{_addVocabularies(){super._addVocabularies();a.default.forEach((e=>this.addVocabulary(e)));if(this.opts.discriminator)this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();if(!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,i):o;this.addMetaSchema(e,c,false);this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:undefined)}}t.Ajv=Ajv;e.exports=t=Ajv;e.exports.Ajv=Ajv;Object.defineProperty(t,"__esModule",{value:true});t["default"]=Ajv;var u=r(6056);Object.defineProperty(t,"KeywordCxt",{enumerable:true,get:function(){return u.KeywordCxt}});var d=r(3561);Object.defineProperty(t,"_",{enumerable:true,get:function(){return d._}});Object.defineProperty(t,"str",{enumerable:true,get:function(){return d.str}});Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return d.stringify}});Object.defineProperty(t,"nil",{enumerable:true,get:function(){return d.nil}});Object.defineProperty(t,"Name",{enumerable:true,get:function(){return d.Name}});Object.defineProperty(t,"CodeGen",{enumerable:true,get:function(){return d.CodeGen}});var l=r(818);Object.defineProperty(t,"ValidationError",{enumerable:true,get:function(){return l.default}});var f=r(9554);Object.defineProperty(t,"MissingRefError",{enumerable:true,get:function(){return f.default}})},1364:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class _CodeOrName{}t._CodeOrName=_CodeOrName;t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Name extends _CodeOrName{constructor(e){super();if(!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return false}get names(){return{[this.str]:1}}}t.Name=Name;class _Code extends _CodeOrName{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return false;const e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce(((e,t)=>{if(t instanceof Name)e[t.str]=(e[t.str]||0)+1;return e}),{})}}t._Code=_Code;t.nil=new _Code("");function _(e,...t){const r=[e[0]];let n=0;while(n<t.length){addCodeArg(r,t[n]);r.push(e[++n])}return new _Code(r)}t._=_;const r=new _Code("+");function str(e,...t){const n=[safeStringify(e[0])];let a=0;while(a<t.length){n.push(r);addCodeArg(n,t[a]);n.push(r,safeStringify(e[++a]))}optimize(n);return new _Code(n)}t.str=str;function addCodeArg(e,t){if(t instanceof _Code)e.push(...t._items);else if(t instanceof Name)e.push(t);else e.push(interpolate(t))}t.addCodeArg=addCodeArg;function optimize(e){let t=1;while(t<e.length-1){if(e[t]===r){const r=mergeExprItems(e[t-1],e[t+1]);if(r!==undefined){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function mergeExprItems(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof Name||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Name))return`"${e}${t.slice(1)}`;return}function strConcat(e,t){return t.emptyStr()?e:e.emptyStr()?t:str`${e}${t}`}t.strConcat=strConcat;function interpolate(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:safeStringify(Array.isArray(e)?e.join(","):e)}function stringify(e){return new _Code(safeStringify(e))}t.stringify=stringify;function safeStringify(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=safeStringify;function getProperty(e){return typeof e=="string"&&t.IDENTIFIER.test(e)?new _Code(`.${e}`):_`[${e}]`}t.getProperty=getProperty;function getEsmExportName(e){if(typeof e=="string"&&t.IDENTIFIER.test(e)){return new _Code(`${e}`)}throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}t.getEsmExportName=getEsmExportName;function regexpCode(e){return new _Code(e.toString())}t.regexpCode=regexpCode},3561:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const n=r(1364);const a=r(3087);var s=r(1364);Object.defineProperty(t,"_",{enumerable:true,get:function(){return s._}});Object.defineProperty(t,"str",{enumerable:true,get:function(){return s.str}});Object.defineProperty(t,"strConcat",{enumerable:true,get:function(){return s.strConcat}});Object.defineProperty(t,"nil",{enumerable:true,get:function(){return s.nil}});Object.defineProperty(t,"getProperty",{enumerable:true,get:function(){return s.getProperty}});Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return s.stringify}});Object.defineProperty(t,"regexpCode",{enumerable:true,get:function(){return s.regexpCode}});Object.defineProperty(t,"Name",{enumerable:true,get:function(){return s.Name}});var o=r(3087);Object.defineProperty(t,"Scope",{enumerable:true,get:function(){return o.Scope}});Object.defineProperty(t,"ValueScope",{enumerable:true,get:function(){return o.ValueScope}});Object.defineProperty(t,"ValueScopeName",{enumerable:true,get:function(){return o.ValueScopeName}});Object.defineProperty(t,"varKinds",{enumerable:true,get:function(){return o.varKinds}});t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class Node{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Def extends Node{constructor(e,t,r){super();this.varKind=e;this.name=t;this.rhs=r}render({es5:e,_n:t}){const r=e?a.varKinds.var:this.varKind;const n=this.rhs===undefined?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=optimizeExpr(this.rhs,e,t);return this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class Assign extends Node{constructor(e,t,r){super();this.lhs=e;this.rhs=t;this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof n.Name&&!e[this.lhs.str]&&!this.sideEffects)return;this.rhs=optimizeExpr(this.rhs,e,t);return this}get names(){const e=this.lhs instanceof n.Name?{}:{...this.lhs.names};return addExprNames(e,this.rhs)}}class AssignOp extends Assign{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Label extends Node{constructor(e){super();this.label=e;this.names={}}render({_n:e}){return`${this.label}:`+e}}class Break extends Node{constructor(e){super();this.label=e;this.names={}}render({_n:e}){const t=this.label?` ${this.label}`:"";return`break${t};`+e}}class Throw extends Node{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class AnyCode extends Node{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:undefined}optimizeNames(e,t){this.code=optimizeExpr(this.code,e,t);return this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class ParentNode extends Node{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;while(t--){const r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:undefined}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;while(n--){const a=r[n];if(a.optimizeNames(e,t))continue;subtractNames(e,a.names);r.splice(n,1)}return r.length>0?this:undefined}get names(){return this.nodes.reduce(((e,t)=>addNames(e,t.names)),{})}}class BlockNode extends ParentNode{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Root extends ParentNode{}class Else extends BlockNode{}Else.kind="else";class If extends BlockNode{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(e===true)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new Else(e):e}if(t){if(e===false)return t instanceof If?t:t.nodes;if(this.nodes.length)return this;return new If(not(e),t instanceof If?[t]:t.nodes)}if(e===false||!this.nodes.length)return undefined;return this}optimizeNames(e,t){var r;this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t);if(!(super.optimizeNames(e,t)||this.else))return;this.condition=optimizeExpr(this.condition,e,t);return this}get names(){const e=super.names;addExprNames(e,this.condition);if(this.else)addNames(e,this.else.names);return e}}If.kind="if";class For extends BlockNode{}For.kind="for";class ForLoop extends For{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;this.iteration=optimizeExpr(this.iteration,e,t);return this}get names(){return addNames(super.names,this.iteration.names)}}class ForRange extends For{constructor(e,t,r,n){super();this.varKind=e;this.name=t;this.from=r;this.to=n}render(e){const t=e.es5?a.varKinds.var:this.varKind;const{name:r,from:n,to:s}=this;return`for(${t} ${r}=${n}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){const e=addExprNames(super.names,this.from);return addExprNames(e,this.to)}}class ForIter extends For{constructor(e,t,r,n){super();this.loop=e;this.varKind=t;this.name=r;this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;this.iterable=optimizeExpr(this.iterable,e,t);return this}get names(){return addNames(super.names,this.iterable.names)}}class Func extends BlockNode{constructor(e,t,r){super();this.name=e;this.args=t;this.async=r}render(e){const t=this.async?"async ":"";return`${t}function ${this.name}(${this.args})`+super.render(e)}}Func.kind="func";class Return extends ParentNode{render(e){return"return "+super.render(e)}}Return.kind="return";class Try extends BlockNode{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;super.optimizeNodes();(e=this.catch)===null||e===void 0?void 0:e.optimizeNodes();(t=this.finally)===null||t===void 0?void 0:t.optimizeNodes();return this}optimizeNames(e,t){var r,n;super.optimizeNames(e,t);(r=this.catch)===null||r===void 0?void 0:r.optimizeNames(e,t);(n=this.finally)===null||n===void 0?void 0:n.optimizeNames(e,t);return this}get names(){const e=super.names;if(this.catch)addNames(e,this.catch.names);if(this.finally)addNames(e,this.finally.names);return e}}class Catch extends BlockNode{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Catch.kind="catch";class Finally extends BlockNode{render(e){return"finally"+super.render(e)}}Finally.kind="finally";class CodeGen{constructor(e,t={}){this._values={};this._blockStarts=[];this._constants={};this.opts={...t,_n:t.lines?"\n":""};this._extScope=e;this._scope=new a.Scope({parent:e});this._nodes=[new Root]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);const n=this._values[r.prefix]||(this._values[r.prefix]=new Set);n.add(r);return r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const a=this._scope.toName(t);if(r!==undefined&&n)this._constants[a.str]=r;this._leafNode(new Def(e,a,r));return a}const(e,t,r){return this._def(a.varKinds.const,e,t,r)}let(e,t,r){return this._def(a.varKinds.let,e,t,r)}var(e,t,r){return this._def(a.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Assign(e,t,r))}add(e,r){return this._leafNode(new AssignOp(e,t.operators.ADD,r))}code(e){if(typeof e=="function")e();else if(e!==n.nil)this._leafNode(new AnyCode(e));return this}object(...e){const t=["{"];for(const[r,a]of e){if(t.length>1)t.push(",");t.push(r);if(r!==a||this.opts.es5){t.push(":");(0,n.addCodeArg)(t,a)}}t.push("}");return new n._Code(t)}if(e,t,r){this._blockNode(new If(e));if(t&&r){this.code(t).else().code(r).endIf()}else if(t){this.code(t).endIf()}else if(r){throw new Error('CodeGen: "else" body without "then" body')}return this}elseIf(e){return this._elseNode(new If(e))}else(){return this._elseNode(new Else)}endIf(){return this._endBlockNode(If,Else)}_for(e,t){this._blockNode(e);if(t)this.code(t).endFor();return this}for(e,t){return this._for(new ForLoop(e),t)}forRange(e,t,r,n,s=(this.opts.es5?a.varKinds.var:a.varKinds.let)){const o=this._scope.toName(e);return this._for(new ForRange(s,o,t,r),(()=>n(o)))}forOf(e,t,r,s=a.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,n._)`${e}.length`,(t=>{this.var(o,(0,n._)`${e}[${t}]`);r(o)}))}return this._for(new ForIter("of",s,o,t),(()=>r(o)))}forIn(e,t,r,s=(this.opts.es5?a.varKinds.var:a.varKinds.const)){if(this.opts.ownProperties){return this.forOf(e,(0,n._)`Object.keys(${t})`,r)}const o=this._scope.toName(e);return this._for(new ForIter("in",s,o,t),(()=>r(o)))}endFor(){return this._endBlockNode(For)}label(e){return this._leafNode(new Label(e))}break(e){return this._leafNode(new Break(e))}return(e){const t=new Return;this._blockNode(t);this.code(e);if(t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Return)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new Try;this._blockNode(n);this.code(e);if(t){const e=this.name("e");this._currNode=n.catch=new Catch(e);t(e)}if(r){this._currNode=n.finally=new Finally;this.code(r)}return this._endBlockNode(Catch,Finally)}throw(e){return this._leafNode(new Throw(e))}block(e,t){this._blockStarts.push(this._nodes.length);if(e)this.code(e).endBlock(t);return this}endBlock(e){const t=this._blockStarts.pop();if(t===undefined)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||e!==undefined&&r!==e){throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`)}this._nodes.length=t;return this}func(e,t=n.nil,r,a){this._blockNode(new Func(e,t,r));if(a)this.code(a).endFunc();return this}endFunc(){return this._endBlockNode(Func)}optimize(e=1){while(e-- >0){this._root.optimizeNodes();this._root.optimizeNames(this._root.names,this._constants)}}_leafNode(e){this._currNode.nodes.push(e);return this}_blockNode(e){this._currNode.nodes.push(e);this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t){this._nodes.pop();return this}throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof If)){throw new Error('CodeGen: "else" without "if"')}this._currNode=t.else=e;return this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}}t.CodeGen=CodeGen;function addNames(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function addExprNames(e,t){return t instanceof n._CodeOrName?addNames(e,t.names):e}function optimizeExpr(e,t,r){if(e instanceof n.Name)return replaceName(e);if(!canOptimize(e))return e;return new n._Code(e._items.reduce(((e,t)=>{if(t instanceof n.Name)t=replaceName(t);if(t instanceof n._Code)e.push(...t._items);else e.push(t);return e}),[]));function replaceName(e){const n=r[e.str];if(n===undefined||t[e.str]!==1)return e;delete t[e.str];return n}function canOptimize(e){return e instanceof n._Code&&e._items.some((e=>e instanceof n.Name&&t[e.str]===1&&r[e.str]!==undefined))}}function subtractNames(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function not(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,n._)`!${par(e)}`}t.not=not;const i=mappend(t.operators.AND);function and(...e){return e.reduce(i)}t.and=and;const c=mappend(t.operators.OR);function or(...e){return e.reduce(c)}t.or=or;function mappend(e){return(t,r)=>t===n.nil?r:r===n.nil?t:(0,n._)`${par(t)} ${e} ${par(r)}`}function par(e){return e instanceof n.Name?e:(0,n._)`(${e})`}},3087:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=r(1364);class ValueError extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var a;(function(e){e[e["Started"]=0]="Started";e[e["Completed"]=1]="Completed"})(a||(t.UsedValueState=a={}));t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class Scope{constructor({prefixes:e,parent:t}={}){this._names={};this._prefixes=e;this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){const t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e)){throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`)}return this._names[e]={prefix:e,index:0}}}t.Scope=Scope;class ValueScopeName extends n.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e;this.scopePath=(0,n._)`.${new n.Name(t)}[${r}]`}}t.ValueScopeName=ValueScopeName;const s=(0,n._)`\n`;class ValueScope extends Scope{constructor(e){super(e);this._values={};this._scope=e.scope;this.opts={...e,_n:e.lines?s:n.nil}}get(){return this._scope}name(e){return new ValueScopeName(e,this._newName(e))}value(e,t){var r;if(t.ref===undefined)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e);const{prefix:a}=n;const s=(r=t.key)!==null&&r!==void 0?r:t.ref;let o=this._values[a];if(o){const e=o.get(s);if(e)return e}else{o=this._values[a]=new Map}o.set(s,n);const i=this._scope[a]||(this._scope[a]=[]);const c=i.length;i[c]=t.ref;n.setValue(t,{property:a,itemIndex:c});return n}getValue(e,t){const r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(t.scopePath===undefined)throw new Error(`CodeGen: name "${t}" has no value`);return(0,n._)`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(e.value===undefined)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(e,r,s={},o){let i=n.nil;for(const c in e){const u=e[c];if(!u)continue;const d=s[c]=s[c]||new Map;u.forEach((e=>{if(d.has(e))return;d.set(e,a.Started);let s=r(e);if(s){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;i=(0,n._)`${i}${r} ${e} = ${s};${this.opts._n}`}else if(s=o===null||o===void 0?void 0:o(e)){i=(0,n._)`${i}${s}${this.opts._n}`}else{throw new ValueError(e)}d.set(e,a.Completed)}))}return i}}t.ValueScope=ValueScope},9443:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=r(3561);const a=r(5206);const s=r(6937);t.keywordError={message:({keyword:e})=>(0,n.str)`must pass "${e}" keyword validation`};t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,n.str)`"${e}" keyword must be ${t} ($data)`:(0,n.str)`"${e}" keyword is invalid ($data)`};function reportError(e,r=t.keywordError,a,s){const{it:o}=e;const{gen:i,compositeRule:c,allErrors:u}=o;const d=errorObjectCode(e,r,a);if(s!==null&&s!==void 0?s:c||u){addError(i,d)}else{returnErrors(o,(0,n._)`[${d}]`)}}t.reportError=reportError;function reportExtraError(e,r=t.keywordError,n){const{it:a}=e;const{gen:o,compositeRule:i,allErrors:c}=a;const u=errorObjectCode(e,r,n);addError(o,u);if(!(i||c)){returnErrors(a,s.default.vErrors)}}t.reportExtraError=reportExtraError;function resetErrorsCount(e,t){e.assign(s.default.errors,t);e.if((0,n._)`${s.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign((0,n._)`${s.default.vErrors}.length`,t)),(()=>e.assign(s.default.vErrors,null)))))}t.resetErrorsCount=resetErrorsCount;function extendErrors({gen:e,keyword:t,schemaValue:r,data:a,errsCount:o,it:i}){if(o===undefined)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",o,s.default.errors,(o=>{e.const(c,(0,n._)`${s.default.vErrors}[${o}]`);e.if((0,n._)`${c}.instancePath === undefined`,(()=>e.assign((0,n._)`${c}.instancePath`,(0,n.strConcat)(s.default.instancePath,i.errorPath))));e.assign((0,n._)`${c}.schemaPath`,(0,n.str)`${i.errSchemaPath}/${t}`);if(i.opts.verbose){e.assign((0,n._)`${c}.schema`,r);e.assign((0,n._)`${c}.data`,a)}}))}t.extendErrors=extendErrors;function addError(e,t){const r=e.const("err",t);e.if((0,n._)`${s.default.vErrors} === null`,(()=>e.assign(s.default.vErrors,(0,n._)`[${r}]`)),(0,n._)`${s.default.vErrors}.push(${r})`);e.code((0,n._)`${s.default.errors}++`)}function returnErrors(e,t){const{gen:r,validateName:a,schemaEnv:s}=e;if(s.$async){r.throw((0,n._)`new ${e.ValidationError}(${t})`)}else{r.assign((0,n._)`${a}.errors`,t);r.return(false)}}const o={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function errorObjectCode(e,t,r){const{createErrors:a}=e.it;if(a===false)return(0,n._)`{}`;return errorObject(e,t,r)}function errorObject(e,t,r={}){const{gen:n,it:a}=e;const s=[errorInstancePath(a,r),errorSchemaPath(e,r)];extraErrorProps(e,t,s);return n.object(...s)}function errorInstancePath({errorPath:e},{instancePath:t}){const r=t?(0,n.str)`${e}${(0,a.getErrorPath)(t,a.Type.Str)}`:e;return[s.default.instancePath,(0,n.strConcat)(s.default.instancePath,r)]}function errorSchemaPath({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:s}){let i=s?t:(0,n.str)`${t}/${e}`;if(r){i=(0,n.str)`${i}${(0,a.getErrorPath)(r,a.Type.Str)}`}return[o.schemaPath,i]}function extraErrorProps(e,{params:t,message:r},a){const{keyword:i,data:c,schemaValue:u,it:d}=e;const{opts:l,propertyName:f,topSchemaRef:p,schemaPath:m}=d;a.push([o.keyword,i],[o.params,typeof t=="function"?t(e):t||(0,n._)`{}`]);if(l.messages){a.push([o.message,typeof r=="function"?r(e):r])}if(l.verbose){a.push([o.schema,u],[o.parentSchema,(0,n._)`${p}${m}`],[s.default.data,c])}if(f)a.push([o.propertyName,f])}},5178:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=r(3561);const a=r(818);const s=r(6937);const o=r(1489);const i=r(5206);const c=r(6056);class SchemaEnv{constructor(e){var t;this.refs={};this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema;this.schemaId=e.schemaId;this.root=e.root||this;this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,o.normalizeId)(r===null||r===void 0?void 0:r[e.schemaId||"$id"]);this.schemaPath=e.schemaPath;this.localRefs=e.localRefs;this.meta=e.meta;this.$async=r===null||r===void 0?void 0:r.$async;this.refs={}}}t.SchemaEnv=SchemaEnv;function compileSchema(e){const t=getCompilingSchema.call(this,e);if(t)return t;const r=(0,o.getFullPath)(this.opts.uriResolver,e.root.baseId);const{es5:i,lines:u}=this.opts.code;const{ownProperties:d}=this.opts;const l=new n.CodeGen(this.scope,{es5:i,lines:u,ownProperties:d});let f;if(e.$async){f=l.scopeValue("Error",{ref:a.default,code:(0,n._)`require("ajv/dist/runtime/validation_error").default`})}const p=l.scopeName("validate");e.validateName=p;const m={gen:l,allErrors:this.opts.allErrors,data:s.default.data,parentData:s.default.parentData,parentDataProperty:s.default.parentDataProperty,dataNames:[s.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:l.scopeValue("schema",this.opts.code.source===true?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:f,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,n._)`""`,opts:this.opts,self:this};let h;try{this._compilations.add(e);(0,c.validateFunctionCode)(m);l.optimize(this.opts.code.optimize);const t=l.toString();h=`${l.scopeRefs(s.default.scope)}return ${t}`;if(this.opts.code.process)h=this.opts.code.process(h,e);const r=new Function(`${s.default.self}`,`${s.default.scope}`,h);const a=r(this,this.scope.get());this.scope.value(p,{ref:a});a.errors=null;a.schema=e.schema;a.schemaEnv=e;if(e.$async)a.$async=true;if(this.opts.code.source===true){a.source={validateName:p,validateCode:t,scopeValues:l._values}}if(this.opts.unevaluated){const{props:e,items:t}=m;a.evaluated={props:e instanceof n.Name?undefined:e,items:t instanceof n.Name?undefined:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name};if(a.source)a.source.evaluated=(0,n.stringify)(a.evaluated)}e.validate=a;return e}catch(t){delete e.validate;delete e.validateName;if(h)this.logger.error("Error compiling schema, function code:",h);throw t}finally{this._compilations.delete(e)}}t.compileSchema=compileSchema;function resolveRef(e,t,r){var n;r=(0,o.resolveUrl)(this.opts.uriResolver,t,r);const a=e.refs[r];if(a)return a;let s=resolve.call(this,e,r);if(s===undefined){const a=(n=e.localRefs)===null||n===void 0?void 0:n[r];const{schemaId:o}=this.opts;if(a)s=new SchemaEnv({schema:a,schemaId:o,root:e,baseId:t})}if(s===undefined)return;return e.refs[r]=inlineOrCompile.call(this,s)}t.resolveRef=resolveRef;function inlineOrCompile(e){if((0,o.inlineRef)(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:compileSchema.call(this,e)}function getCompilingSchema(e){for(const t of this._compilations){if(sameSchemaEnv(t,e))return t}}t.getCompilingSchema=getCompilingSchema;function sameSchemaEnv(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function resolve(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||resolveSchema.call(this,e,t)}function resolveSchema(e,t){const r=this.opts.uriResolver.parse(t);const n=(0,o._getFullPath)(this.opts.uriResolver,r);let a=(0,o.getFullPath)(this.opts.uriResolver,e.baseId,undefined);if(Object.keys(e.schema).length>0&&n===a){return getJsonPointer.call(this,r,e)}const s=(0,o.normalizeId)(n);const i=this.refs[s]||this.schemas[s];if(typeof i=="string"){const t=resolveSchema.call(this,e,i);if(typeof(t===null||t===void 0?void 0:t.schema)!=="object")return;return getJsonPointer.call(this,r,t)}if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;if(!i.validate)compileSchema.call(this,i);if(s===(0,o.normalizeId)(t)){const{schema:t}=i;const{schemaId:r}=this.opts;const n=t[r];if(n)a=(0,o.resolveUrl)(this.opts.uriResolver,a,n);return new SchemaEnv({schema:t,schemaId:r,root:e,baseId:a})}return getJsonPointer.call(this,r,i)}t.resolveSchema=resolveSchema;const u=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function getJsonPointer(e,{baseId:t,schema:r,root:n}){var a;if(((a=e.fragment)===null||a===void 0?void 0:a[0])!=="/")return;for(const n of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;const e=r[(0,i.unescapeFragment)(n)];if(e===undefined)return;r=e;const a=typeof r==="object"&&r[this.opts.schemaId];if(!u.has(n)&&a){t=(0,o.resolveUrl)(this.opts.uriResolver,t,a)}}let s;if(typeof r!="boolean"&&r.$ref&&!(0,i.schemaHasRulesButRef)(r,this.RULES)){const e=(0,o.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=resolveSchema.call(this,n,e)}const{schemaId:c}=this.opts;s=s||new SchemaEnv({schema:r,schemaId:c,root:n,baseId:t});if(s.schema!==s.root.schema)return s;return undefined}},6937:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(3561);const a={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")};t["default"]=a},9554:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(1489);class MissingRefError extends Error{constructor(e,t,r,a){super(a||`can't resolve reference ${r} from id ${t}`);this.missingRef=(0,n.resolveUrl)(e,t,r);this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t["default"]=MissingRefError},1489:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const n=r(5206);const a=r(1230);const s=r(9122);const o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function inlineRef(e,t=true){if(typeof e=="boolean")return true;if(t===true)return!hasRef(e);if(!t)return false;return countKeys(e)<=t}t.inlineRef=inlineRef;const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function hasRef(e){for(const t in e){if(i.has(t))return true;const r=e[t];if(Array.isArray(r)&&r.some(hasRef))return true;if(typeof r=="object"&&hasRef(r))return true}return false}function countKeys(e){let t=0;for(const r in e){if(r==="$ref")return Infinity;t++;if(o.has(r))continue;if(typeof e[r]=="object"){(0,n.eachItem)(e[r],(e=>t+=countKeys(e)))}if(t===Infinity)return Infinity}return t}function getFullPath(e,t="",r){if(r!==false)t=normalizeId(t);const n=e.parse(t);return _getFullPath(e,n)}t.getFullPath=getFullPath;function _getFullPath(e,t){const r=e.serialize(t);return r.split("#")[0]+"#"}t._getFullPath=_getFullPath;const c=/#\/?$/;function normalizeId(e){return e?e.replace(c,""):""}t.normalizeId=normalizeId;function resolveUrl(e,t,r){r=normalizeId(r);return e.resolve(t,r)}t.resolveUrl=resolveUrl;const u=/^[a-z_][-a-z0-9._]*$/i;function getSchemaRefs(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts;const o=normalizeId(e[r]||t);const i={"":o};const c=getFullPath(n,o,false);const d={};const l=new Set;s(e,{allKeys:true},((e,t,n,a)=>{if(a===undefined)return;const s=c+t;let o=i[a];if(typeof e[r]=="string")o=addRef.call(this,e[r]);addAnchor.call(this,e.$anchor);addAnchor.call(this,e.$dynamicAnchor);i[t]=o;function addRef(t){const r=this.opts.uriResolver.resolve;t=normalizeId(o?r(o,t):t);if(l.has(t))throw ambiguos(t);l.add(t);let n=this.refs[t];if(typeof n=="string")n=this.refs[n];if(typeof n=="object"){checkAmbiguosRef(e,n.schema,t)}else if(t!==normalizeId(s)){if(t[0]==="#"){checkAmbiguosRef(e,d[t],t);d[t]=e}else{this.refs[t]=s}}return t}function addAnchor(e){if(typeof e=="string"){if(!u.test(e))throw new Error(`invalid anchor "${e}"`);addRef.call(this,`#${e}`)}}}));return d;function checkAmbiguosRef(e,t,r){if(t!==undefined&&!a(e,t))throw ambiguos(r)}function ambiguos(e){return new Error(`reference "${e}" resolves to more than one schema`)}}t.getSchemaRefs=getSchemaRefs},315:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.getRules=t.isJSONType=void 0;const r=["string","number","integer","boolean","null","object","array"];const n=new Set(r);function isJSONType(e){return typeof e=="string"&&n.has(e)}t.isJSONType=isJSONType;function getRules(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:true,boolean:true,null:true},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}t.getRules=getRules},5206:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const n=r(3561);const a=r(1364);function toHash(e){const t={};for(const r of e)t[r]=true;return t}t.toHash=toHash;function alwaysValidSchema(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return true;checkUnknownRules(e,t);return!schemaHasRules(t,e.self.RULES.all)}t.alwaysValidSchema=alwaysValidSchema;function checkUnknownRules(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;const a=n.RULES.keywords;for(const r in t){if(!a[r])checkStrictMode(e,`unknown keyword: "${r}"`)}}t.checkUnknownRules=checkUnknownRules;function schemaHasRules(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(t[r])return true;return false}t.schemaHasRules=schemaHasRules;function schemaHasRulesButRef(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(r!=="$ref"&&t.all[r])return true;return false}t.schemaHasRulesButRef=schemaHasRulesButRef;function schemaRefOrVal({topSchemaRef:e,schemaPath:t},r,a,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,n._)`${r}`}return(0,n._)`${e}${t}${(0,n.getProperty)(a)}`}t.schemaRefOrVal=schemaRefOrVal;function unescapeFragment(e){return unescapeJsonPointer(decodeURIComponent(e))}t.unescapeFragment=unescapeFragment;function escapeFragment(e){return encodeURIComponent(escapeJsonPointer(e))}t.escapeFragment=escapeFragment;function escapeJsonPointer(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}t.escapeJsonPointer=escapeJsonPointer;function unescapeJsonPointer(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}t.unescapeJsonPointer=unescapeJsonPointer;function eachItem(e,t){if(Array.isArray(e)){for(const r of e)t(r)}else{t(e)}}t.eachItem=eachItem;function makeMergeEvaluated({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:a}){return(s,o,i,c)=>{const u=i===undefined?o:i instanceof n.Name?(o instanceof n.Name?e(s,o,i):t(s,o,i),i):o instanceof n.Name?(t(s,i,o),o):r(o,i);return c===n.Name&&!(u instanceof n.Name)?a(s,u):u}}t.mergeEvaluated={props:makeMergeEvaluated({mergeNames:(e,t,r)=>e.if((0,n._)`${r} !== true && ${t} !== undefined`,(()=>{e.if((0,n._)`${t} === true`,(()=>e.assign(r,true)),(()=>e.assign(r,(0,n._)`${r} || {}`).code((0,n._)`Object.assign(${r}, ${t})`)))})),mergeToName:(e,t,r)=>e.if((0,n._)`${r} !== true`,(()=>{if(t===true){e.assign(r,true)}else{e.assign(r,(0,n._)`${r} || {}`);setEvaluated(e,r,t)}})),mergeValues:(e,t)=>e===true?true:{...e,...t},resultToName:evaluatedPropsToName}),items:makeMergeEvaluated({mergeNames:(e,t,r)=>e.if((0,n._)`${r} !== true && ${t} !== undefined`,(()=>e.assign(r,(0,n._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`))),mergeToName:(e,t,r)=>e.if((0,n._)`${r} !== true`,(()=>e.assign(r,t===true?true:(0,n._)`${r} > ${t} ? ${r} : ${t}`))),mergeValues:(e,t)=>e===true?true:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function evaluatedPropsToName(e,t){if(t===true)return e.var("props",true);const r=e.var("props",(0,n._)`{}`);if(t!==undefined)setEvaluated(e,r,t);return r}t.evaluatedPropsToName=evaluatedPropsToName;function setEvaluated(e,t,r){Object.keys(r).forEach((r=>e.assign((0,n._)`${t}${(0,n.getProperty)(r)}`,true)))}t.setEvaluated=setEvaluated;const s={};function useFunc(e,t){return e.scopeValue("func",{ref:t,code:s[t.code]||(s[t.code]=new a._Code(t.code))})}t.useFunc=useFunc;var o;(function(e){e[e["Num"]=0]="Num";e[e["Str"]=1]="Str"})(o||(t.Type=o={}));function getErrorPath(e,t,r){if(e instanceof n.Name){const a=t===o.Num;return r?a?(0,n._)`"[" + ${e} + "]"`:(0,n._)`"['" + ${e} + "']"`:a?(0,n._)`"/" + ${e}`:(0,n._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,n.getProperty)(e).toString():"/"+escapeJsonPointer(e)}t.getErrorPath=getErrorPath;function checkStrictMode(e,t,r=e.opts.strictSchema){if(!r)return;t=`strict mode: ${t}`;if(r===true)throw new Error(t);e.self.logger.warn(t)}t.checkStrictMode=checkStrictMode},6567:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0;function schemaHasRulesForType({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==true&&shouldUseGroup(e,n)}t.schemaHasRulesForType=schemaHasRulesForType;function shouldUseGroup(e,t){return t.rules.some((t=>shouldUseRule(e,t)))}t.shouldUseGroup=shouldUseGroup;function shouldUseRule(e,t){var r;return e[t.keyword]!==undefined||((r=t.definition.implements)===null||r===void 0?void 0:r.some((t=>e[t]!==undefined)))}t.shouldUseRule=shouldUseRule},7144:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const n=r(9443);const a=r(3561);const s=r(6937);const o={message:"boolean schema is false"};function topBoolOrEmptySchema(e){const{gen:t,schema:r,validateName:n}=e;if(r===false){falseSchemaError(e,false)}else if(typeof r=="object"&&r.$async===true){t.return(s.default.data)}else{t.assign((0,a._)`${n}.errors`,null);t.return(true)}}t.topBoolOrEmptySchema=topBoolOrEmptySchema;function boolOrEmptySchema(e,t){const{gen:r,schema:n}=e;if(n===false){r.var(t,false);falseSchemaError(e)}else{r.var(t,true)}}t.boolOrEmptySchema=boolOrEmptySchema;function falseSchemaError(e,t){const{gen:r,data:a}=e;const s={gen:r,keyword:"false schema",data:a,schema:false,schemaCode:false,schemaValue:false,params:{},it:e};(0,n.reportError)(s,o,undefined,t)}},6794:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const n=r(315);const a=r(6567);const s=r(9443);const o=r(3561);const i=r(5206);var c;(function(e){e[e["Correct"]=0]="Correct";e[e["Wrong"]=1]="Wrong"})(c||(t.DataType=c={}));function getSchemaTypes(e){const t=getJSONTypes(e.type);const r=t.includes("null");if(r){if(e.nullable===false)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==undefined){throw new Error('"nullable" cannot be used without "type"')}if(e.nullable===true)t.push("null")}return t}t.getSchemaTypes=getSchemaTypes;function getJSONTypes(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(n.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}t.getJSONTypes=getJSONTypes;function coerceAndCheckDataType(e,t){const{gen:r,data:n,opts:s}=e;const o=coerceToTypes(t,s.coerceTypes);const i=t.length>0&&!(o.length===0&&t.length===1&&(0,a.schemaHasRulesForType)(e,t[0]));if(i){const a=checkDataTypes(t,n,s.strictNumbers,c.Wrong);r.if(a,(()=>{if(o.length)coerceData(e,t,o);else reportTypeError(e)}))}return i}t.coerceAndCheckDataType=coerceAndCheckDataType;const u=new Set(["string","number","integer","boolean","null"]);function coerceToTypes(e,t){return t?e.filter((e=>u.has(e)||t==="array"&&e==="array")):[]}function coerceData(e,t,r){const{gen:n,data:a,opts:s}=e;const i=n.let("dataType",(0,o._)`typeof ${a}`);const c=n.let("coerced",(0,o._)`undefined`);if(s.coerceTypes==="array"){n.if((0,o._)`${i} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,(()=>n.assign(a,(0,o._)`${a}[0]`).assign(i,(0,o._)`typeof ${a}`).if(checkDataTypes(t,a,s.strictNumbers),(()=>n.assign(c,a)))))}n.if((0,o._)`${c} !== undefined`);for(const e of r){if(u.has(e)||e==="array"&&s.coerceTypes==="array"){coerceSpecificType(e)}}n.else();reportTypeError(e);n.endIf();n.if((0,o._)`${c} !== undefined`,(()=>{n.assign(a,c);assignParentData(e,c)}));function coerceSpecificType(e){switch(e){case"string":n.elseIf((0,o._)`${i} == "number" || ${i} == "boolean"`).assign(c,(0,o._)`"" + ${a}`).elseIf((0,o._)`${a} === null`).assign(c,(0,o._)`""`);return;case"number":n.elseIf((0,o._)`${i} == "boolean" || ${a} === null
^^^^^^

SyntaxError: Cannot use import statement outside a module

  63 |         return originalRequire.call(this, `next/dist/server/route-modules/pages/vendored/contexts/${path.basename(request, '.shared-runtime')}`);
  64 |     }
> 65 |     return originalRequire.call(this, request);
     |                            ^
  66 | };
  67 |
  68 | //# sourceMappingURL=require-hook.js.map

  at mod.require (../packages/next/dist/server/require-hook.js:65:28)
  at Object.<anonymous> (../packages/next/dist/telemetry/storage.js:12:54)
  at ChildProcess.<anonymous> (lib/next-test-utils.ts:291:11)

Read more about building and testing Next.js in contributing.md.

pnpm test test/integration/create-next-app/examples.test.ts

Expand output

● Test suite failed to run

Jest encountered an unexpected token

Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

By default "node_modules" folder is ignored by transformers.

Here's what you can do:
 • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
 • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
 • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
 • If you need a custom transformation specify a "transform" option in your config.
 • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/configuration
For information about custom transformations, see:
https://jestjs.io/docs/code-transformation

Details:

/root/actions-runner/_work/next.js/next.js/packages/next/dist/compiled/conf/index.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import{createRequire as e}from"module";import*as t from"next/dist/compiled/semver";var r={8999:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.formatNames=t.fastFormats=t.fullFormats=void 0;function fmtDef(e,t){return{validate:e,compare:t}}t.fullFormats={date:fmtDef(date,compareDate),time:fmtDef(getTime(true),compareTime),"date-time":fmtDef(getDateTime(true),compareDateTime),"iso-time":fmtDef(getTime(),compareIsoTime),"iso-date-time":fmtDef(getDateTime(),compareIsoDateTime),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:uri,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:regex,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:byte,int32:{type:"number",validate:validateInt32},int64:{type:"number",validate:validateInt64},float:{type:"number",validate:validateNumber},double:{type:"number",validate:validateNumber},password:true,binary:true};t.fastFormats={...t.fullFormats,date:fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,compareDate),time:fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,compareTime),"date-time":fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,compareDateTime),"iso-time":fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,compareIsoTime),"iso-date-time":fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,compareIsoDateTime),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};t.formatNames=Object.keys(t.fullFormats);function isLeapYear(e){return e%4===0&&(e%100!==0||e%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;const n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function date(e){const t=r.exec(e);if(!t)return false;const a=+t[1];const s=+t[2];const o=+t[3];return s>=1&&s<=12&&o>=1&&o<=(s===2&&isLeapYear(a)?29:n[s])}function compareDate(e,t){if(!(e&&t))return undefined;if(e>t)return 1;if(e<t)return-1;return 0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function getTime(e){return function time(t){const r=a.exec(t);if(!r)return false;const n=+r[1];const s=+r[2];const o=+r[3];const i=r[4];const c=r[5]==="-"?-1:1;const u=+(r[6]||0);const d=+(r[7]||0);if(u>23||d>59||e&&!i)return false;if(n<=23&&s<=59&&o<60)return true;const l=s-d*c;const f=n-u*c-(l<0?1:0);return(f===23||f===-1)&&(l===59||l===-1)&&o<61}}function compareTime(e,t){if(!(e&&t))return undefined;const r=new Date("2020-01-01T"+e).valueOf();const n=new Date("2020-01-01T"+t).valueOf();if(!(r&&n))return undefined;return r-n}function compareIsoTime(e,t){if(!(e&&t))return undefined;const r=a.exec(e);const n=a.exec(t);if(!(r&&n))return undefined;e=r[1]+r[2]+r[3];t=n[1]+n[2]+n[3];if(e>t)return 1;if(e<t)return-1;return 0}const s=/t|\s/i;function getDateTime(e){const t=getTime(e);return function date_time(e){const r=e.split(s);return r.length===2&&date(r[0])&&t(r[1])}}function compareDateTime(e,t){if(!(e&&t))return undefined;const r=new Date(e).valueOf();const n=new Date(t).valueOf();if(!(r&&n))return undefined;return r-n}function compareIsoDateTime(e,t){if(!(e&&t))return undefined;const[r,n]=e.split(s);const[a,o]=t.split(s);const i=compareDate(r,a);if(i===undefined)return undefined;return i||compareTime(n,o)}const o=/\/|:/;const i=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function uri(e){return o.test(e)&&i.test(e)}const c=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function byte(e){c.lastIndex=0;return c.test(e)}const u=-(2**31);const d=2**31-1;function validateInt32(e){return Number.isInteger(e)&&e<=d&&e>=u}function validateInt64(e){return Number.isInteger(e)}function validateNumber(){return true}const l=/[^\\]\\Z/;function regex(e){if(l.test(e))return false;try{new RegExp(e);return true}catch(e){return false}}},4421:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(8999);const a=r(9971);const s=r(3561);const o=new s.Name("fullFormats");const i=new s.Name("fastFormats");const formatsPlugin=(e,t={keywords:true})=>{if(Array.isArray(t)){addFormats(e,t,n.fullFormats,o);return e}const[r,s]=t.mode==="fast"?[n.fastFormats,i]:[n.fullFormats,o];const c=t.formats||n.formatNames;addFormats(e,c,r,s);if(t.keywords)(0,a.default)(e);return e};formatsPlugin.get=(e,t="full")=>{const r=t==="fast"?n.fastFormats:n.fullFormats;const a=r[e];if(!a)throw new Error(`Unknown format "${e}"`);return a};function addFormats(e,t,r,n){var a;var o;(a=(o=e.opts.code).formats)!==null&&a!==void 0?a:o.formats=(0,s._)`require("ajv-formats/dist/formats").${n}`;for(const n of t)e.addFormat(n,r[n])}e.exports=t=formatsPlugin;Object.defineProperty(t,"__esModule",{value:true});t["default"]=formatsPlugin},9971:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.formatLimitDefinition=void 0;const n=r(8219);const a=r(3561);const s=a.operators;const o={formatMaximum:{okStr:"<=",ok:s.LTE,fail:s.GT},formatMinimum:{okStr:">=",ok:s.GTE,fail:s.LT},formatExclusiveMaximum:{okStr:"<",ok:s.LT,fail:s.GTE},formatExclusiveMinimum:{okStr:">",ok:s.GT,fail:s.LTE}};const i={message:({keyword:e,schemaCode:t})=>(0,a.str)`should be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,a._)`{comparison: ${o[e].okStr}, limit: ${t}}`};t.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:true,error:i,code(e){const{gen:t,data:r,schemaCode:s,keyword:i,it:c}=e;const{opts:u,self:d}=c;if(!u.validateFormats)return;const l=new n.KeywordCxt(c,d.RULES.all.format.definition,"format");if(l.$data)validate$DataFormat();else validateFormat();function validate$DataFormat(){const r=t.scopeValue("formats",{ref:d.formats,code:u.code.formats});const n=t.const("fmt",(0,a._)`${r}[${l.schemaCode}]`);e.fail$data((0,a.or)((0,a._)`typeof ${n} != "object"`,(0,a._)`${n} instanceof RegExp`,(0,a._)`typeof ${n}.compare != "function"`,compareCode(n)))}function validateFormat(){const r=l.schema;const n=d.formats[r];if(!n||n===true)return;if(typeof n!="object"||n instanceof RegExp||typeof n.compare!="function"){throw new Error(`"${i}": format "${r}" does not define "compare" function`)}const s=t.scopeValue("formats",{key:r,ref:n,code:u.code.formats?(0,a._)`${u.code.formats}${(0,a.getProperty)(r)}`:undefined});e.fail$data(compareCode(s))}function compareCode(e){return(0,a._)`${e}.compare(${r}, ${s}) ${o[i].fail} 0`}},dependencies:["format"]};const formatLimitPlugin=e=>{e.addKeyword(t.formatLimitDefinition);return e};t["default"]=formatLimitPlugin},4521:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const n=r(3872);const a=r(4392);const s=r(4814);const o=r(7397);const i="https://json-schema.org/draft/2020-12/schema";class Ajv2020 extends n.default{constructor(e={}){super({...e,dynamicRef:true,next:true,unevaluated:true})}_addVocabularies(){super._addVocabularies();a.default.forEach((e=>this.addVocabulary(e)));if(this.opts.discriminator)this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:e,meta:t}=this.opts;if(!t)return;o.default.call(this,e);this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:undefined)}}t.Ajv2020=Ajv2020;e.exports=t=Ajv2020;e.exports.Ajv2020=Ajv2020;Object.defineProperty(t,"__esModule",{value:true});t["default"]=Ajv2020;var c=r(6056);Object.defineProperty(t,"KeywordCxt",{enumerable:true,get:function(){return c.KeywordCxt}});var u=r(3561);Object.defineProperty(t,"_",{enumerable:true,get:function(){return u._}});Object.defineProperty(t,"str",{enumerable:true,get:function(){return u.str}});Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return u.stringify}});Object.defineProperty(t,"nil",{enumerable:true,get:function(){return u.nil}});Object.defineProperty(t,"Name",{enumerable:true,get:function(){return u.Name}});Object.defineProperty(t,"CodeGen",{enumerable:true,get:function(){return u.CodeGen}});var d=r(818);Object.defineProperty(t,"ValidationError",{enumerable:true,get:function(){return d.default}});var l=r(9554);Object.defineProperty(t,"MissingRefError",{enumerable:true,get:function(){return l.default}})},8219:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=r(3872);const a=r(6832);const s=r(4814);const o=r(5137);const i=["/properties"];const c="http://json-schema.org/draft-07/schema";class Ajv extends n.default{_addVocabularies(){super._addVocabularies();a.default.forEach((e=>this.addVocabulary(e)));if(this.opts.discriminator)this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();if(!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,i):o;this.addMetaSchema(e,c,false);this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:undefined)}}t.Ajv=Ajv;e.exports=t=Ajv;e.exports.Ajv=Ajv;Object.defineProperty(t,"__esModule",{value:true});t["default"]=Ajv;var u=r(6056);Object.defineProperty(t,"KeywordCxt",{enumerable:true,get:function(){return u.KeywordCxt}});var d=r(3561);Object.defineProperty(t,"_",{enumerable:true,get:function(){return d._}});Object.defineProperty(t,"str",{enumerable:true,get:function(){return d.str}});Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return d.stringify}});Object.defineProperty(t,"nil",{enumerable:true,get:function(){return d.nil}});Object.defineProperty(t,"Name",{enumerable:true,get:function(){return d.Name}});Object.defineProperty(t,"CodeGen",{enumerable:true,get:function(){return d.CodeGen}});var l=r(818);Object.defineProperty(t,"ValidationError",{enumerable:true,get:function(){return l.default}});var f=r(9554);Object.defineProperty(t,"MissingRefError",{enumerable:true,get:function(){return f.default}})},1364:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class _CodeOrName{}t._CodeOrName=_CodeOrName;t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Name extends _CodeOrName{constructor(e){super();if(!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return false}get names(){return{[this.str]:1}}}t.Name=Name;class _Code extends _CodeOrName{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return false;const e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce(((e,t)=>{if(t instanceof Name)e[t.str]=(e[t.str]||0)+1;return e}),{})}}t._Code=_Code;t.nil=new _Code("");function _(e,...t){const r=[e[0]];let n=0;while(n<t.length){addCodeArg(r,t[n]);r.push(e[++n])}return new _Code(r)}t._=_;const r=new _Code("+");function str(e,...t){const n=[safeStringify(e[0])];let a=0;while(a<t.length){n.push(r);addCodeArg(n,t[a]);n.push(r,safeStringify(e[++a]))}optimize(n);return new _Code(n)}t.str=str;function addCodeArg(e,t){if(t instanceof _Code)e.push(...t._items);else if(t instanceof Name)e.push(t);else e.push(interpolate(t))}t.addCodeArg=addCodeArg;function optimize(e){let t=1;while(t<e.length-1){if(e[t]===r){const r=mergeExprItems(e[t-1],e[t+1]);if(r!==undefined){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function mergeExprItems(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof Name||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Name))return`"${e}${t.slice(1)}`;return}function strConcat(e,t){return t.emptyStr()?e:e.emptyStr()?t:str`${e}${t}`}t.strConcat=strConcat;function interpolate(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:safeStringify(Array.isArray(e)?e.join(","):e)}function stringify(e){return new _Code(safeStringify(e))}t.stringify=stringify;function safeStringify(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=safeStringify;function getProperty(e){return typeof e=="string"&&t.IDENTIFIER.test(e)?new _Code(`.${e}`):_`[${e}]`}t.getProperty=getProperty;function getEsmExportName(e){if(typeof e=="string"&&t.IDENTIFIER.test(e)){return new _Code(`${e}`)}throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}t.getEsmExportName=getEsmExportName;function regexpCode(e){return new _Code(e.toString())}t.regexpCode=regexpCode},3561:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const n=r(1364);const a=r(3087);var s=r(1364);Object.defineProperty(t,"_",{enumerable:true,get:function(){return s._}});Object.defineProperty(t,"str",{enumerable:true,get:function(){return s.str}});Object.defineProperty(t,"strConcat",{enumerable:true,get:function(){return s.strConcat}});Object.defineProperty(t,"nil",{enumerable:true,get:function(){return s.nil}});Object.defineProperty(t,"getProperty",{enumerable:true,get:function(){return s.getProperty}});Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return s.stringify}});Object.defineProperty(t,"regexpCode",{enumerable:true,get:function(){return s.regexpCode}});Object.defineProperty(t,"Name",{enumerable:true,get:function(){return s.Name}});var o=r(3087);Object.defineProperty(t,"Scope",{enumerable:true,get:function(){return o.Scope}});Object.defineProperty(t,"ValueScope",{enumerable:true,get:function(){return o.ValueScope}});Object.defineProperty(t,"ValueScopeName",{enumerable:true,get:function(){return o.ValueScopeName}});Object.defineProperty(t,"varKinds",{enumerable:true,get:function(){return o.varKinds}});t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class Node{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Def extends Node{constructor(e,t,r){super();this.varKind=e;this.name=t;this.rhs=r}render({es5:e,_n:t}){const r=e?a.varKinds.var:this.varKind;const n=this.rhs===undefined?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=optimizeExpr(this.rhs,e,t);return this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class Assign extends Node{constructor(e,t,r){super();this.lhs=e;this.rhs=t;this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof n.Name&&!e[this.lhs.str]&&!this.sideEffects)return;this.rhs=optimizeExpr(this.rhs,e,t);return this}get names(){const e=this.lhs instanceof n.Name?{}:{...this.lhs.names};return addExprNames(e,this.rhs)}}class AssignOp extends Assign{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Label extends Node{constructor(e){super();this.label=e;this.names={}}render({_n:e}){return`${this.label}:`+e}}class Break extends Node{constructor(e){super();this.label=e;this.names={}}render({_n:e}){const t=this.label?` ${this.label}`:"";return`break${t};`+e}}class Throw extends Node{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class AnyCode extends Node{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:undefined}optimizeNames(e,t){this.code=optimizeExpr(this.code,e,t);return this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class ParentNode extends Node{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;while(t--){const r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:undefined}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;while(n--){const a=r[n];if(a.optimizeNames(e,t))continue;subtractNames(e,a.names);r.splice(n,1)}return r.length>0?this:undefined}get names(){return this.nodes.reduce(((e,t)=>addNames(e,t.names)),{})}}class BlockNode extends ParentNode{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Root extends ParentNode{}class Else extends BlockNode{}Else.kind="else";class If extends BlockNode{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(e===true)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new Else(e):e}if(t){if(e===false)return t instanceof If?t:t.nodes;if(this.nodes.length)return this;return new If(not(e),t instanceof If?[t]:t.nodes)}if(e===false||!this.nodes.length)return undefined;return this}optimizeNames(e,t){var r;this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t);if(!(super.optimizeNames(e,t)||this.else))return;this.condition=optimizeExpr(this.condition,e,t);return this}get names(){const e=super.names;addExprNames(e,this.condition);if(this.else)addNames(e,this.else.names);return e}}If.kind="if";class For extends BlockNode{}For.kind="for";class ForLoop extends For{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;this.iteration=optimizeExpr(this.iteration,e,t);return this}get names(){return addNames(super.names,this.iteration.names)}}class ForRange extends For{constructor(e,t,r,n){super();this.varKind=e;this.name=t;this.from=r;this.to=n}render(e){const t=e.es5?a.varKinds.var:this.varKind;const{name:r,from:n,to:s}=this;return`for(${t} ${r}=${n}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){const e=addExprNames(super.names,this.from);return addExprNames(e,this.to)}}class ForIter extends For{constructor(e,t,r,n){super();this.loop=e;this.varKind=t;this.name=r;this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;this.iterable=optimizeExpr(this.iterable,e,t);return this}get names(){return addNames(super.names,this.iterable.names)}}class Func extends BlockNode{constructor(e,t,r){super();this.name=e;this.args=t;this.async=r}render(e){const t=this.async?"async ":"";return`${t}function ${this.name}(${this.args})`+super.render(e)}}Func.kind="func";class Return extends ParentNode{render(e){return"return "+super.render(e)}}Return.kind="return";class Try extends BlockNode{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;super.optimizeNodes();(e=this.catch)===null||e===void 0?void 0:e.optimizeNodes();(t=this.finally)===null||t===void 0?void 0:t.optimizeNodes();return this}optimizeNames(e,t){var r,n;super.optimizeNames(e,t);(r=this.catch)===null||r===void 0?void 0:r.optimizeNames(e,t);(n=this.finally)===null||n===void 0?void 0:n.optimizeNames(e,t);return this}get names(){const e=super.names;if(this.catch)addNames(e,this.catch.names);if(this.finally)addNames(e,this.finally.names);return e}}class Catch extends BlockNode{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Catch.kind="catch";class Finally extends BlockNode{render(e){return"finally"+super.render(e)}}Finally.kind="finally";class CodeGen{constructor(e,t={}){this._values={};this._blockStarts=[];this._constants={};this.opts={...t,_n:t.lines?"\n":""};this._extScope=e;this._scope=new a.Scope({parent:e});this._nodes=[new Root]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);const n=this._values[r.prefix]||(this._values[r.prefix]=new Set);n.add(r);return r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const a=this._scope.toName(t);if(r!==undefined&&n)this._constants[a.str]=r;this._leafNode(new Def(e,a,r));return a}const(e,t,r){return this._def(a.varKinds.const,e,t,r)}let(e,t,r){return this._def(a.varKinds.let,e,t,r)}var(e,t,r){return this._def(a.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Assign(e,t,r))}add(e,r){return this._leafNode(new AssignOp(e,t.operators.ADD,r))}code(e){if(typeof e=="function")e();else if(e!==n.nil)this._leafNode(new AnyCode(e));return this}object(...e){const t=["{"];for(const[r,a]of e){if(t.length>1)t.push(",");t.push(r);if(r!==a||this.opts.es5){t.push(":");(0,n.addCodeArg)(t,a)}}t.push("}");return new n._Code(t)}if(e,t,r){this._blockNode(new If(e));if(t&&r){this.code(t).else().code(r).endIf()}else if(t){this.code(t).endIf()}else if(r){throw new Error('CodeGen: "else" body without "then" body')}return this}elseIf(e){return this._elseNode(new If(e))}else(){return this._elseNode(new Else)}endIf(){return this._endBlockNode(If,Else)}_for(e,t){this._blockNode(e);if(t)this.code(t).endFor();return this}for(e,t){return this._for(new ForLoop(e),t)}forRange(e,t,r,n,s=(this.opts.es5?a.varKinds.var:a.varKinds.let)){const o=this._scope.toName(e);return this._for(new ForRange(s,o,t,r),(()=>n(o)))}forOf(e,t,r,s=a.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,n._)`${e}.length`,(t=>{this.var(o,(0,n._)`${e}[${t}]`);r(o)}))}return this._for(new ForIter("of",s,o,t),(()=>r(o)))}forIn(e,t,r,s=(this.opts.es5?a.varKinds.var:a.varKinds.const)){if(this.opts.ownProperties){return this.forOf(e,(0,n._)`Object.keys(${t})`,r)}const o=this._scope.toName(e);return this._for(new ForIter("in",s,o,t),(()=>r(o)))}endFor(){return this._endBlockNode(For)}label(e){return this._leafNode(new Label(e))}break(e){return this._leafNode(new Break(e))}return(e){const t=new Return;this._blockNode(t);this.code(e);if(t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Return)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new Try;this._blockNode(n);this.code(e);if(t){const e=this.name("e");this._currNode=n.catch=new Catch(e);t(e)}if(r){this._currNode=n.finally=new Finally;this.code(r)}return this._endBlockNode(Catch,Finally)}throw(e){return this._leafNode(new Throw(e))}block(e,t){this._blockStarts.push(this._nodes.length);if(e)this.code(e).endBlock(t);return this}endBlock(e){const t=this._blockStarts.pop();if(t===undefined)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||e!==undefined&&r!==e){throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`)}this._nodes.length=t;return this}func(e,t=n.nil,r,a){this._blockNode(new Func(e,t,r));if(a)this.code(a).endFunc();return this}endFunc(){return this._endBlockNode(Func)}optimize(e=1){while(e-- >0){this._root.optimizeNodes();this._root.optimizeNames(this._root.names,this._constants)}}_leafNode(e){this._currNode.nodes.push(e);return this}_blockNode(e){this._currNode.nodes.push(e);this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t){this._nodes.pop();return this}throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof If)){throw new Error('CodeGen: "else" without "if"')}this._currNode=t.else=e;return this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}}t.CodeGen=CodeGen;function addNames(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function addExprNames(e,t){return t instanceof n._CodeOrName?addNames(e,t.names):e}function optimizeExpr(e,t,r){if(e instanceof n.Name)return replaceName(e);if(!canOptimize(e))return e;return new n._Code(e._items.reduce(((e,t)=>{if(t instanceof n.Name)t=replaceName(t);if(t instanceof n._Code)e.push(...t._items);else e.push(t);return e}),[]));function replaceName(e){const n=r[e.str];if(n===undefined||t[e.str]!==1)return e;delete t[e.str];return n}function canOptimize(e){return e instanceof n._Code&&e._items.some((e=>e instanceof n.Name&&t[e.str]===1&&r[e.str]!==undefined))}}function subtractNames(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function not(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,n._)`!${par(e)}`}t.not=not;const i=mappend(t.operators.AND);function and(...e){return e.reduce(i)}t.and=and;const c=mappend(t.operators.OR);function or(...e){return e.reduce(c)}t.or=or;function mappend(e){return(t,r)=>t===n.nil?r:r===n.nil?t:(0,n._)`${par(t)} ${e} ${par(r)}`}function par(e){return e instanceof n.Name?e:(0,n._)`(${e})`}},3087:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=r(1364);class ValueError extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var a;(function(e){e[e["Started"]=0]="Started";e[e["Completed"]=1]="Completed"})(a||(t.UsedValueState=a={}));t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class Scope{constructor({prefixes:e,parent:t}={}){this._names={};this._prefixes=e;this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){const t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e)){throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`)}return this._names[e]={prefix:e,index:0}}}t.Scope=Scope;class ValueScopeName extends n.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e;this.scopePath=(0,n._)`.${new n.Name(t)}[${r}]`}}t.ValueScopeName=ValueScopeName;const s=(0,n._)`\n`;class ValueScope extends Scope{constructor(e){super(e);this._values={};this._scope=e.scope;this.opts={...e,_n:e.lines?s:n.nil}}get(){return this._scope}name(e){return new ValueScopeName(e,this._newName(e))}value(e,t){var r;if(t.ref===undefined)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e);const{prefix:a}=n;const s=(r=t.key)!==null&&r!==void 0?r:t.ref;let o=this._values[a];if(o){const e=o.get(s);if(e)return e}else{o=this._values[a]=new Map}o.set(s,n);const i=this._scope[a]||(this._scope[a]=[]);const c=i.length;i[c]=t.ref;n.setValue(t,{property:a,itemIndex:c});return n}getValue(e,t){const r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(t.scopePath===undefined)throw new Error(`CodeGen: name "${t}" has no value`);return(0,n._)`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(e.value===undefined)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(e,r,s={},o){let i=n.nil;for(const c in e){const u=e[c];if(!u)continue;const d=s[c]=s[c]||new Map;u.forEach((e=>{if(d.has(e))return;d.set(e,a.Started);let s=r(e);if(s){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;i=(0,n._)`${i}${r} ${e} = ${s};${this.opts._n}`}else if(s=o===null||o===void 0?void 0:o(e)){i=(0,n._)`${i}${s}${this.opts._n}`}else{throw new ValueError(e)}d.set(e,a.Completed)}))}return i}}t.ValueScope=ValueScope},9443:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=r(3561);const a=r(5206);const s=r(6937);t.keywordError={message:({keyword:e})=>(0,n.str)`must pass "${e}" keyword validation`};t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,n.str)`"${e}" keyword must be ${t} ($data)`:(0,n.str)`"${e}" keyword is invalid ($data)`};function reportError(e,r=t.keywordError,a,s){const{it:o}=e;const{gen:i,compositeRule:c,allErrors:u}=o;const d=errorObjectCode(e,r,a);if(s!==null&&s!==void 0?s:c||u){addError(i,d)}else{returnErrors(o,(0,n._)`[${d}]`)}}t.reportError=reportError;function reportExtraError(e,r=t.keywordError,n){const{it:a}=e;const{gen:o,compositeRule:i,allErrors:c}=a;const u=errorObjectCode(e,r,n);addError(o,u);if(!(i||c)){returnErrors(a,s.default.vErrors)}}t.reportExtraError=reportExtraError;function resetErrorsCount(e,t){e.assign(s.default.errors,t);e.if((0,n._)`${s.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign((0,n._)`${s.default.vErrors}.length`,t)),(()=>e.assign(s.default.vErrors,null)))))}t.resetErrorsCount=resetErrorsCount;function extendErrors({gen:e,keyword:t,schemaValue:r,data:a,errsCount:o,it:i}){if(o===undefined)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",o,s.default.errors,(o=>{e.const(c,(0,n._)`${s.default.vErrors}[${o}]`);e.if((0,n._)`${c}.instancePath === undefined`,(()=>e.assign((0,n._)`${c}.instancePath`,(0,n.strConcat)(s.default.instancePath,i.errorPath))));e.assign((0,n._)`${c}.schemaPath`,(0,n.str)`${i.errSchemaPath}/${t}`);if(i.opts.verbose){e.assign((0,n._)`${c}.schema`,r);e.assign((0,n._)`${c}.data`,a)}}))}t.extendErrors=extendErrors;function addError(e,t){const r=e.const("err",t);e.if((0,n._)`${s.default.vErrors} === null`,(()=>e.assign(s.default.vErrors,(0,n._)`[${r}]`)),(0,n._)`${s.default.vErrors}.push(${r})`);e.code((0,n._)`${s.default.errors}++`)}function returnErrors(e,t){const{gen:r,validateName:a,schemaEnv:s}=e;if(s.$async){r.throw((0,n._)`new ${e.ValidationError}(${t})`)}else{r.assign((0,n._)`${a}.errors`,t);r.return(false)}}const o={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function errorObjectCode(e,t,r){const{createErrors:a}=e.it;if(a===false)return(0,n._)`{}`;return errorObject(e,t,r)}function errorObject(e,t,r={}){const{gen:n,it:a}=e;const s=[errorInstancePath(a,r),errorSchemaPath(e,r)];extraErrorProps(e,t,s);return n.object(...s)}function errorInstancePath({errorPath:e},{instancePath:t}){const r=t?(0,n.str)`${e}${(0,a.getErrorPath)(t,a.Type.Str)}`:e;return[s.default.instancePath,(0,n.strConcat)(s.default.instancePath,r)]}function errorSchemaPath({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:s}){let i=s?t:(0,n.str)`${t}/${e}`;if(r){i=(0,n.str)`${i}${(0,a.getErrorPath)(r,a.Type.Str)}`}return[o.schemaPath,i]}function extraErrorProps(e,{params:t,message:r},a){const{keyword:i,data:c,schemaValue:u,it:d}=e;const{opts:l,propertyName:f,topSchemaRef:p,schemaPath:m}=d;a.push([o.keyword,i],[o.params,typeof t=="function"?t(e):t||(0,n._)`{}`]);if(l.messages){a.push([o.message,typeof r=="function"?r(e):r])}if(l.verbose){a.push([o.schema,u],[o.parentSchema,(0,n._)`${p}${m}`],[s.default.data,c])}if(f)a.push([o.propertyName,f])}},5178:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=r(3561);const a=r(818);const s=r(6937);const o=r(1489);const i=r(5206);const c=r(6056);class SchemaEnv{constructor(e){var t;this.refs={};this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema;this.schemaId=e.schemaId;this.root=e.root||this;this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,o.normalizeId)(r===null||r===void 0?void 0:r[e.schemaId||"$id"]);this.schemaPath=e.schemaPath;this.localRefs=e.localRefs;this.meta=e.meta;this.$async=r===null||r===void 0?void 0:r.$async;this.refs={}}}t.SchemaEnv=SchemaEnv;function compileSchema(e){const t=getCompilingSchema.call(this,e);if(t)return t;const r=(0,o.getFullPath)(this.opts.uriResolver,e.root.baseId);const{es5:i,lines:u}=this.opts.code;const{ownProperties:d}=this.opts;const l=new n.CodeGen(this.scope,{es5:i,lines:u,ownProperties:d});let f;if(e.$async){f=l.scopeValue("Error",{ref:a.default,code:(0,n._)`require("ajv/dist/runtime/validation_error").default`})}const p=l.scopeName("validate");e.validateName=p;const m={gen:l,allErrors:this.opts.allErrors,data:s.default.data,parentData:s.default.parentData,parentDataProperty:s.default.parentDataProperty,dataNames:[s.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:l.scopeValue("schema",this.opts.code.source===true?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:f,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,n._)`""`,opts:this.opts,self:this};let h;try{this._compilations.add(e);(0,c.validateFunctionCode)(m);l.optimize(this.opts.code.optimize);const t=l.toString();h=`${l.scopeRefs(s.default.scope)}return ${t}`;if(this.opts.code.process)h=this.opts.code.process(h,e);const r=new Function(`${s.default.self}`,`${s.default.scope}`,h);const a=r(this,this.scope.get());this.scope.value(p,{ref:a});a.errors=null;a.schema=e.schema;a.schemaEnv=e;if(e.$async)a.$async=true;if(this.opts.code.source===true){a.source={validateName:p,validateCode:t,scopeValues:l._values}}if(this.opts.unevaluated){const{props:e,items:t}=m;a.evaluated={props:e instanceof n.Name?undefined:e,items:t instanceof n.Name?undefined:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name};if(a.source)a.source.evaluated=(0,n.stringify)(a.evaluated)}e.validate=a;return e}catch(t){delete e.validate;delete e.validateName;if(h)this.logger.error("Error compiling schema, function code:",h);throw t}finally{this._compilations.delete(e)}}t.compileSchema=compileSchema;function resolveRef(e,t,r){var n;r=(0,o.resolveUrl)(this.opts.uriResolver,t,r);const a=e.refs[r];if(a)return a;let s=resolve.call(this,e,r);if(s===undefined){const a=(n=e.localRefs)===null||n===void 0?void 0:n[r];const{schemaId:o}=this.opts;if(a)s=new SchemaEnv({schema:a,schemaId:o,root:e,baseId:t})}if(s===undefined)return;return e.refs[r]=inlineOrCompile.call(this,s)}t.resolveRef=resolveRef;function inlineOrCompile(e){if((0,o.inlineRef)(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:compileSchema.call(this,e)}function getCompilingSchema(e){for(const t of this._compilations){if(sameSchemaEnv(t,e))return t}}t.getCompilingSchema=getCompilingSchema;function sameSchemaEnv(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function resolve(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||resolveSchema.call(this,e,t)}function resolveSchema(e,t){const r=this.opts.uriResolver.parse(t);const n=(0,o._getFullPath)(this.opts.uriResolver,r);let a=(0,o.getFullPath)(this.opts.uriResolver,e.baseId,undefined);if(Object.keys(e.schema).length>0&&n===a){return getJsonPointer.call(this,r,e)}const s=(0,o.normalizeId)(n);const i=this.refs[s]||this.schemas[s];if(typeof i=="string"){const t=resolveSchema.call(this,e,i);if(typeof(t===null||t===void 0?void 0:t.schema)!=="object")return;return getJsonPointer.call(this,r,t)}if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;if(!i.validate)compileSchema.call(this,i);if(s===(0,o.normalizeId)(t)){const{schema:t}=i;const{schemaId:r}=this.opts;const n=t[r];if(n)a=(0,o.resolveUrl)(this.opts.uriResolver,a,n);return new SchemaEnv({schema:t,schemaId:r,root:e,baseId:a})}return getJsonPointer.call(this,r,i)}t.resolveSchema=resolveSchema;const u=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function getJsonPointer(e,{baseId:t,schema:r,root:n}){var a;if(((a=e.fragment)===null||a===void 0?void 0:a[0])!=="/")return;for(const n of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;const e=r[(0,i.unescapeFragment)(n)];if(e===undefined)return;r=e;const a=typeof r==="object"&&r[this.opts.schemaId];if(!u.has(n)&&a){t=(0,o.resolveUrl)(this.opts.uriResolver,t,a)}}let s;if(typeof r!="boolean"&&r.$ref&&!(0,i.schemaHasRulesButRef)(r,this.RULES)){const e=(0,o.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=resolveSchema.call(this,n,e)}const{schemaId:c}=this.opts;s=s||new SchemaEnv({schema:r,schemaId:c,root:n,baseId:t});if(s.schema!==s.root.schema)return s;return undefined}},6937:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(3561);const a={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")};t["default"]=a},9554:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(1489);class MissingRefError extends Error{constructor(e,t,r,a){super(a||`can't resolve reference ${r} from id ${t}`);this.missingRef=(0,n.resolveUrl)(e,t,r);this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t["default"]=MissingRefError},1489:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const n=r(5206);const a=r(1230);const s=r(9122);const o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function inlineRef(e,t=true){if(typeof e=="boolean")return true;if(t===true)return!hasRef(e);if(!t)return false;return countKeys(e)<=t}t.inlineRef=inlineRef;const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function hasRef(e){for(const t in e){if(i.has(t))return true;const r=e[t];if(Array.isArray(r)&&r.some(hasRef))return true;if(typeof r=="object"&&hasRef(r))return true}return false}function countKeys(e){let t=0;for(const r in e){if(r==="$ref")return Infinity;t++;if(o.has(r))continue;if(typeof e[r]=="object"){(0,n.eachItem)(e[r],(e=>t+=countKeys(e)))}if(t===Infinity)return Infinity}return t}function getFullPath(e,t="",r){if(r!==false)t=normalizeId(t);const n=e.parse(t);return _getFullPath(e,n)}t.getFullPath=getFullPath;function _getFullPath(e,t){const r=e.serialize(t);return r.split("#")[0]+"#"}t._getFullPath=_getFullPath;const c=/#\/?$/;function normalizeId(e){return e?e.replace(c,""):""}t.normalizeId=normalizeId;function resolveUrl(e,t,r){r=normalizeId(r);return e.resolve(t,r)}t.resolveUrl=resolveUrl;const u=/^[a-z_][-a-z0-9._]*$/i;function getSchemaRefs(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts;const o=normalizeId(e[r]||t);const i={"":o};const c=getFullPath(n,o,false);const d={};const l=new Set;s(e,{allKeys:true},((e,t,n,a)=>{if(a===undefined)return;const s=c+t;let o=i[a];if(typeof e[r]=="string")o=addRef.call(this,e[r]);addAnchor.call(this,e.$anchor);addAnchor.call(this,e.$dynamicAnchor);i[t]=o;function addRef(t){const r=this.opts.uriResolver.resolve;t=normalizeId(o?r(o,t):t);if(l.has(t))throw ambiguos(t);l.add(t);let n=this.refs[t];if(typeof n=="string")n=this.refs[n];if(typeof n=="object"){checkAmbiguosRef(e,n.schema,t)}else if(t!==normalizeId(s)){if(t[0]==="#"){checkAmbiguosRef(e,d[t],t);d[t]=e}else{this.refs[t]=s}}return t}function addAnchor(e){if(typeof e=="string"){if(!u.test(e))throw new Error(`invalid anchor "${e}"`);addRef.call(this,`#${e}`)}}}));return d;function checkAmbiguosRef(e,t,r){if(t!==undefined&&!a(e,t))throw ambiguos(r)}function ambiguos(e){return new Error(`reference "${e}" resolves to more than one schema`)}}t.getSchemaRefs=getSchemaRefs},315:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.getRules=t.isJSONType=void 0;const r=["string","number","integer","boolean","null","object","array"];const n=new Set(r);function isJSONType(e){return typeof e=="string"&&n.has(e)}t.isJSONType=isJSONType;function getRules(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:true,boolean:true,null:true},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}t.getRules=getRules},5206:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const n=r(3561);const a=r(1364);function toHash(e){const t={};for(const r of e)t[r]=true;return t}t.toHash=toHash;function alwaysValidSchema(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return true;checkUnknownRules(e,t);return!schemaHasRules(t,e.self.RULES.all)}t.alwaysValidSchema=alwaysValidSchema;function checkUnknownRules(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;const a=n.RULES.keywords;for(const r in t){if(!a[r])checkStrictMode(e,`unknown keyword: "${r}"`)}}t.checkUnknownRules=checkUnknownRules;function schemaHasRules(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(t[r])return true;return false}t.schemaHasRules=schemaHasRules;function schemaHasRulesButRef(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(r!=="$ref"&&t.all[r])return true;return false}t.schemaHasRulesButRef=schemaHasRulesButRef;function schemaRefOrVal({topSchemaRef:e,schemaPath:t},r,a,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,n._)`${r}`}return(0,n._)`${e}${t}${(0,n.getProperty)(a)}`}t.schemaRefOrVal=schemaRefOrVal;function unescapeFragment(e){return unescapeJsonPointer(decodeURIComponent(e))}t.unescapeFragment=unescapeFragment;function escapeFragment(e){return encodeURIComponent(escapeJsonPointer(e))}t.escapeFragment=escapeFragment;function escapeJsonPointer(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}t.escapeJsonPointer=escapeJsonPointer;function unescapeJsonPointer(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}t.unescapeJsonPointer=unescapeJsonPointer;function eachItem(e,t){if(Array.isArray(e)){for(const r of e)t(r)}else{t(e)}}t.eachItem=eachItem;function makeMergeEvaluated({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:a}){return(s,o,i,c)=>{const u=i===undefined?o:i instanceof n.Name?(o instanceof n.Name?e(s,o,i):t(s,o,i),i):o instanceof n.Name?(t(s,i,o),o):r(o,i);return c===n.Name&&!(u instanceof n.Name)?a(s,u):u}}t.mergeEvaluated={props:makeMergeEvaluated({mergeNames:(e,t,r)=>e.if((0,n._)`${r} !== true && ${t} !== undefined`,(()=>{e.if((0,n._)`${t} === true`,(()=>e.assign(r,true)),(()=>e.assign(r,(0,n._)`${r} || {}`).code((0,n._)`Object.assign(${r}, ${t})`)))})),mergeToName:(e,t,r)=>e.if((0,n._)`${r} !== true`,(()=>{if(t===true){e.assign(r,true)}else{e.assign(r,(0,n._)`${r} || {}`);setEvaluated(e,r,t)}})),mergeValues:(e,t)=>e===true?true:{...e,...t},resultToName:evaluatedPropsToName}),items:makeMergeEvaluated({mergeNames:(e,t,r)=>e.if((0,n._)`${r} !== true && ${t} !== undefined`,(()=>e.assign(r,(0,n._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`))),mergeToName:(e,t,r)=>e.if((0,n._)`${r} !== true`,(()=>e.assign(r,t===true?true:(0,n._)`${r} > ${t} ? ${r} : ${t}`))),mergeValues:(e,t)=>e===true?true:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function evaluatedPropsToName(e,t){if(t===true)return e.var("props",true);const r=e.var("props",(0,n._)`{}`);if(t!==undefined)setEvaluated(e,r,t);return r}t.evaluatedPropsToName=evaluatedPropsToName;function setEvaluated(e,t,r){Object.keys(r).forEach((r=>e.assign((0,n._)`${t}${(0,n.getProperty)(r)}`,true)))}t.setEvaluated=setEvaluated;const s={};function useFunc(e,t){return e.scopeValue("func",{ref:t,code:s[t.code]||(s[t.code]=new a._Code(t.code))})}t.useFunc=useFunc;var o;(function(e){e[e["Num"]=0]="Num";e[e["Str"]=1]="Str"})(o||(t.Type=o={}));function getErrorPath(e,t,r){if(e instanceof n.Name){const a=t===o.Num;return r?a?(0,n._)`"[" + ${e} + "]"`:(0,n._)`"['" + ${e} + "']"`:a?(0,n._)`"/" + ${e}`:(0,n._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,n.getProperty)(e).toString():"/"+escapeJsonPointer(e)}t.getErrorPath=getErrorPath;function checkStrictMode(e,t,r=e.opts.strictSchema){if(!r)return;t=`strict mode: ${t}`;if(r===true)throw new Error(t);e.self.logger.warn(t)}t.checkStrictMode=checkStrictMode},6567:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0;function schemaHasRulesForType({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==true&&shouldUseGroup(e,n)}t.schemaHasRulesForType=schemaHasRulesForType;function shouldUseGroup(e,t){return t.rules.some((t=>shouldUseRule(e,t)))}t.shouldUseGroup=shouldUseGroup;function shouldUseRule(e,t){var r;return e[t.keyword]!==undefined||((r=t.definition.implements)===null||r===void 0?void 0:r.some((t=>e[t]!==undefined)))}t.shouldUseRule=shouldUseRule},7144:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const n=r(9443);const a=r(3561);const s=r(6937);const o={message:"boolean schema is false"};function topBoolOrEmptySchema(e){const{gen:t,schema:r,validateName:n}=e;if(r===false){falseSchemaError(e,false)}else if(typeof r=="object"&&r.$async===true){t.return(s.default.data)}else{t.assign((0,a._)`${n}.errors`,null);t.return(true)}}t.topBoolOrEmptySchema=topBoolOrEmptySchema;function boolOrEmptySchema(e,t){const{gen:r,schema:n}=e;if(n===false){r.var(t,false);falseSchemaError(e)}else{r.var(t,true)}}t.boolOrEmptySchema=boolOrEmptySchema;function falseSchemaError(e,t){const{gen:r,data:a}=e;const s={gen:r,keyword:"false schema",data:a,schema:false,schemaCode:false,schemaValue:false,params:{},it:e};(0,n.reportError)(s,o,undefined,t)}},6794:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const n=r(315);const a=r(6567);const s=r(9443);const o=r(3561);const i=r(5206);var c;(function(e){e[e["Correct"]=0]="Correct";e[e["Wrong"]=1]="Wrong"})(c||(t.DataType=c={}));function getSchemaTypes(e){const t=getJSONTypes(e.type);const r=t.includes("null");if(r){if(e.nullable===false)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==undefined){throw new Error('"nullable" cannot be used without "type"')}if(e.nullable===true)t.push("null")}return t}t.getSchemaTypes=getSchemaTypes;function getJSONTypes(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(n.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}t.getJSONTypes=getJSONTypes;function coerceAndCheckDataType(e,t){const{gen:r,data:n,opts:s}=e;const o=coerceToTypes(t,s.coerceTypes);const i=t.length>0&&!(o.length===0&&t.length===1&&(0,a.schemaHasRulesForType)(e,t[0]));if(i){const a=checkDataTypes(t,n,s.strictNumbers,c.Wrong);r.if(a,(()=>{if(o.length)coerceData(e,t,o);else reportTypeError(e)}))}return i}t.coerceAndCheckDataType=coerceAndCheckDataType;const u=new Set(["string","number","integer","boolean","null"]);function coerceToTypes(e,t){return t?e.filter((e=>u.has(e)||t==="array"&&e==="array")):[]}function coerceData(e,t,r){const{gen:n,data:a,opts:s}=e;const i=n.let("dataType",(0,o._)`typeof ${a}`);const c=n.let("coerced",(0,o._)`undefined`);if(s.coerceTypes==="array"){n.if((0,o._)`${i} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,(()=>n.assign(a,(0,o._)`${a}[0]`).assign(i,(0,o._)`typeof ${a}`).if(checkDataTypes(t,a,s.strictNumbers),(()=>n.assign(c,a)))))}n.if((0,o._)`${c} !== undefined`);for(const e of r){if(u.has(e)||e==="array"&&s.coerceTypes==="array"){coerceSpecificType(e)}}n.else();reportTypeError(e);n.endIf();n.if((0,o._)`${c} !== undefined`,(()=>{n.assign(a,c);assignParentData(e,c)}));function coerceSpecificType(e){switch(e){case"string":n.elseIf((0,o._)`${i} == "number" || ${i} == "boolean"`).assign(c,(0,o._)`"" + ${a}`).elseIf((0,o._)`${a} === null`).assign(c,(0,o._)`""`);return;case"number":n.elseIf((0,o._)`${i} == "boolean" || ${a} === null
                                                                                  ^^^^^^

SyntaxError: Cannot use import statement outside a module

  46 |   delete cloneEnv.CONTINUOUS_INTEGRATION
  47 |   delete cloneEnv.RUN_ID
> 48 |   delete cloneEnv.BUILD_NUMBER
     |                               ^
  49 |
  50 |   cloneEnv.NEXT_PRIVATE_TEST_VERSION = testVersion || 'canary'
  51 |

  at Runtime.createScriptFromCode (../node_modules/.pnpm/jest-runtime@29.7.0/node_modules/jest-runtime/build/index.js:1505:14)
  at Object.<anonymous> (integration/create-next-app/lib/utils.ts:48:54)
  at Object.<anonymous> (integration/create-next-app/utils.ts:67:16)
  at Object.<anonymous> (integration/create-next-app/examples.test.ts:7:16)

Read more about building and testing Next.js in contributing.md.

pnpm test test/integration/config-promise-error/test/index.test.js

  • Promise in next config > production mode > should warn when a promise is returned on webpack
Expand output

● Promise in next config › production mode › should warn when a promise is returned on webpack

expect(received).toMatch(expected)

Expected pattern: /> Promise returned in next config\. https:\/\//
Received string:  "unhandledRejection /root/actions-runner/_work/next.js/next.js/packages/next/dist/compiled/conf/index.js:1
import{createRequire as e}from\"module\";import*as t from\"next/dist/compiled/semver\";var r={8999:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.formatNames=t.fastFormats=t.fullFormats=void 0;function fmtDef(e,t){return{validate:e,compare:t}}t.fullFormats={date:fmtDef(date,compareDate),time:fmtDef(getTime(true),compareTime),\"date-time\":fmtDef(getDateTime(true),compareDateTime),\"iso-time\":fmtDef(getTime(),compareIsoTime),\"iso-date-time\":fmtDef(getDateTime(),compareIsoDateTime),duration:/^P(?!$)((\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?|(\\d+W)?)$/,uri:uri,\"uri-reference\":/^(?:[a-z][a-z0-9+\\-.]*:)?(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\\.[a-z0-9\\-._~!$&'()*+,;=:]+)\\]|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)|(?:[a-z0-9\\-._~!$&'\"()*+,;=]|%[0-9a-f]{2})*)(?::\\d*)?(?:\\/(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})*)*|\\/(?:(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'\"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\\?(?:[a-z0-9\\-._~!$&'\"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\\-._~!$&'\"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,\"uri-template\":/^(?:(?:[^\\x00-\\x20\"'<>%\\\\^`{|}]|%[0-9a-f]{2})|\\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?)*\\})*$/i,url:/^(?:https?|ftp):\\/\\/(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)(?:\\.(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))$/i,regex:regex,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,\"json-pointer\":/^(?:\\/(?:[^~/]|~0|~1)*)*$/,\"json-pointer-uri-fragment\":/^#(?:\\/(?:[a-z0-9_\\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,\"relative-json-pointer\":/^(?:0|[1-9][0-9]*)(?:#|(?:\\/(?:[^~/]|~0|~1)*)*)$/,byte:byte,int32:{type:\"number\",validate:validateInt32},int64:{type:\"number\",validate:validateInt64},float:{type:\"number\",validate:validateNumber},double:{type:\"number\",validate:validateNumber},password:true,binary:true};t.fastFormats={...t.fullFormats,date:fmtDef(/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/,compareDate),time:fmtDef(/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i,compareTime),\"date-time\":fmtDef(/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\dt(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i,compareDateTime),\"iso-time\":fmtDef(/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)?$/i,compareIsoTime),\"iso-date-time\":fmtDef(/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s](?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)?$/i,compareIsoDateTime),uri:/^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/)?[^\\s]*$/i,\"uri-reference\":/^(?:(?:[a-z][a-z0-9+\\-.]*:)?\\/?\\/)?(?:[^\\\\\\s#][^\\s#]*)?(?:#[^\\\\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};t.formatNames=Object.keys(t.fullFormats);function isLeapYear(e){return e%4===0&&(e%100!==0||e%400===0)}const r=/^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$/;const n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function date(e){const t=r.exec(e);if(!t)return false;const a=+t[1];const s=+t[2];const o=+t[3];return s>=1&&s<=12&&o>=1&&o<=(s===2&&isLeapYear(a)?29:n[s])}function compareDate(e,t){if(!(e&&t))return undefined;if(e>t)return 1;if(e<t)return-1;return 0}const a=/^(\\d\\d):(\\d\\d):(\\d\\d(?:\\.\\d+)?)(z|([+-])(\\d\\d)(?::?(\\d\\d))?)?$/i;function getTime(e){return function time(t){const r=a.exec(t);if(!r)return false;const n=+r[1];const s=+r[2];const o=+r[3];const i=r[4];const c=r[5]===\"-\"?-1:1;const u=+(r[6]||0);const d=+(r[7]||0);if(u>23||d>59||e&&!i)return false;if(n<=23&&s<=59&&o<60)return true;const l=s-d*c;const f=n-u*c-(l<0?1:0);return(f===23||f===-1)&&(l===59||l===-1)&&o<61}}function compareTime(e,t){if(!(e&&t))return undefined;const r=new Date(\"2020-01-01T\"+e).valueOf();const n=new Date(\"2020-01-01T\"+t).valueOf();if(!(r&&n))return undefined;return r-n}function compareIsoTime(e,t){if(!(e&&t))return undefined;const r=a.exec(e);const n=a.exec(t);if(!(r&&n))return undefined;e=r[1]+r[2]+r[3];t=n[1]+n[2]+n[3];if(e>t)return 1;if(e<t)return-1;return 0}const s=/t|\\s/i;function getDateTime(e){const t=getTime(e);return function date_time(e){const r=e.split(s);return r.length===2&&date(r[0])&&t(r[1])}}function compareDateTime(e,t){if(!(e&&t))return undefined;const r=new Date(e).valueOf();const n=new Date(t).valueOf();if(!(r&&n))return undefined;return r-n}function compareIsoDateTime(e,t){if(!(e&&t))return undefined;const[r,n]=e.split(s);const[a,o]=t.split(s);const i=compareDate(r,a);if(i===undefined)return undefined;return i||compareTime(n,o)}const o=/\\/|:/;const i=/^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\\.[a-z0-9\\-._~!$&'()*+,;=:]+)\\]|(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)|(?:[a-z0-9\\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\\d*)?(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\\/(?:(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\\/(?:[a-z0-9\\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\\?(?:[a-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function uri(e){return o.test(e)&&i.test(e)}const c=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function byte(e){c.lastIndex=0;return c.test(e)}const u=-(2**31);const d=2**31-1;function validateInt32(e){return Number.isInteger(e)&&e<=d&&e>=u}function validateInt64(e){return Number.isInteger(e)}function validateNumber(){return true}const l=/[^\\\\]\\\\Z/;function regex(e){if(l.test(e))return false;try{new RegExp(e);return true}catch(e){return false}}},4421:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});const n=r(8999);const a=r(9971);const s=r(3561);const o=new s.Name(\"fullFormats\");const i=new s.Name(\"fastFormats\");const formatsPlugin=(e,t={keywords:true})=>{if(Array.isArray(t)){addFormats(e,t,n.fullFormats,o);return e}const[r,s]=t.mode===\"fast\"?[n.fastFormats,i]:[n.fullFormats,o];const c=t.formats||n.formatNames;addFormats(e,c,r,s);if(t.keywords)(0,a.default)(e);return e};formatsPlugin.get=(e,t=\"full\")=>{const r=t===\"fast\"?n.fastFormats:n.fullFormats;const a=r[e];if(!a)throw new Error(`Unknown format \"${e}\"`);return a};function addFormats(e,t,r,n){var a;var o;(a=(o=e.opts.code).formats)!==null&&a!==void 0?a:o.formats=(0,s._)`require(\"ajv-formats/dist/formats\").${n}`;for(const n of t)e.addFormat(n,r[n])}e.exports=t=formatsPlugin;Object.defineProperty(t,\"__esModule\",{value:true});t[\"default\"]=formatsPlugin},9971:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.formatLimitDefinition=void 0;const n=r(8219);const a=r(3561);const s=a.operators;const o={formatMaximum:{okStr:\"<=\",ok:s.LTE,fail:s.GT},formatMinimum:{okStr:\">=\",ok:s.GTE,fail:s.LT},formatExclusiveMaximum:{okStr:\"<\",ok:s.LT,fail:s.GTE},formatExclusiveMinimum:{okStr:\">\",ok:s.GT,fail:s.LTE}};const i={message:({keyword:e,schemaCode:t})=>(0,a.str)`should be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,a._)`{comparison: ${o[e].okStr}, limit: ${t}}`};t.formatLimitDefinition={keyword:Object.keys(o),type:\"string\",schemaType:\"string\",$data:true,error:i,code(e){const{gen:t,data:r,schemaCode:s,keyword:i,it:c}=e;const{opts:u,self:d}=c;if(!u.validateFormats)return;const l=new n.KeywordCxt(c,d.RULES.all.format.definition,\"format\");if(l.$data)validate$DataFormat();else validateFormat();function validate$DataFormat(){const r=t.scopeValue(\"formats\",{ref:d.formats,code:u.code.formats});const n=t.const(\"fmt\",(0,a._)`${r}[${l.schemaCode}]`);e.fail$data((0,a.or)((0,a._)`typeof ${n} != \"object\"`,(0,a._)`${n} instanceof RegExp`,(0,a._)`typeof ${n}.compare != \"function\"`,compareCode(n)))}function validateFormat(){const r=l.schema;const n=d.formats[r];if(!n||n===true)return;if(typeof n!=\"object\"||n instanceof RegExp||typeof n.compare!=\"function\"){throw new Error(`\"${i}\": format \"${r}\" does not define \"compare\" function`)}const s=t.scopeValue(\"formats\",{key:r,ref:n,code:u.code.formats?(0,a._)`${u.code.formats}${(0,a.getProperty)(r)}`:undefined});e.fail$data(compareCode(s))}function compareCode(e){return(0,a._)`${e}.compare(${r}, ${s}) ${o[i].fail} 0`}},dependencies:[\"format\"]};const formatLimitPlugin=e=>{e.addKeyword(t.formatLimitDefinition);return e};t[\"default\"]=formatLimitPlugin},4521:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const n=r(3872);const a=r(4392);const s=r(4814);const o=r(7397);const i=\"https://json-schema.org/draft/2020-12/schema\";class Ajv2020 extends n.default{constructor(e={}){super({...e,dynamicRef:true,next:true,unevaluated:true})}_addVocabularies(){super._addVocabularies();a.default.forEach((e=>this.addVocabulary(e)));if(this.opts.discriminator)this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:e,meta:t}=this.opts;if(!t)return;o.default.call(this,e);this.refs[\"http://json-schema.org/schema\"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:undefined)}}t.Ajv2020=Ajv2020;e.exports=t=Ajv2020;e.exports.Ajv2020=Ajv2020;Object.defineProperty(t,\"__esModule\",{value:true});t[\"default\"]=Ajv2020;var c=r(6056);Object.defineProperty(t,\"KeywordCxt\",{enumerable:true,get:function(){return c.KeywordCxt}});var u=r(3561);Object.defineProperty(t,\"_\",{enumerable:true,get:function(){return u._}});Object.defineProperty(t,\"str\",{enumerable:true,get:function(){return u.str}});Object.defineProperty(t,\"stringify\",{enumerable:true,get:function(){return u.stringify}});Object.defineProperty(t,\"nil\",{enumerable:true,get:function(){return u.nil}});Object.defineProperty(t,\"Name\",{enumerable:true,get:function(){return u.Name}});Object.defineProperty(t,\"CodeGen\",{enumerable:true,get:function(){return u.CodeGen}});var d=r(818);Object.defineProperty(t,\"ValidationError\",{enumerable:true,get:function(){return d.default}});var l=r(9554);Object.defineProperty(t,\"MissingRefError\",{enumerable:true,get:function(){return l.default}})},8219:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=r(3872);const a=r(6832);const s=r(4814);const o=r(5137);const i=[\"/properties\"];const c=\"http://json-schema.org/draft-07/schema\";class Ajv extends n.default{_addVocabularies(){super._addVocabularies();a.default.forEach((e=>this.addVocabulary(e)));if(this.opts.discriminator)this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();if(!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,i):o;this.addMetaSchema(e,c,false);this.refs[\"http://json-schema.org/schema\"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:undefined)}}t.Ajv=Ajv;e.exports=t=Ajv;e.exports.Ajv=Ajv;Object.defineProperty(t,\"__esModule\",{value:true});t[\"default\"]=Ajv;var u=r(6056);Object.defineProperty(t,\"KeywordCxt\",{enumerable:true,get:function(){return u.KeywordCxt}});var d=r(3561);Object.defineProperty(t,\"_\",{enumerable:true,get:function(){return d._}});Object.defineProperty(t,\"str\",{enumerable:true,get:function(){return d.str}});Object.defineProperty(t,\"stringify\",{enumerable:true,get:function(){return d.stringify}});Object.defineProperty(t,\"nil\",{enumerable:true,get:function(){return d.nil}});Object.defineProperty(t,\"Name\",{enumerable:true,get:function(){return d.Name}});Object.defineProperty(t,\"CodeGen\",{enumerable:true,get:function(){return d.CodeGen}});var l=r(818);Object.defineProperty(t,\"ValidationError\",{enumerable:true,get:function(){return l.default}});var f=r(9554);Object.defineProperty(t,\"MissingRefError\",{enumerable:true,get:function(){return f.default}})},1364:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class _CodeOrName{}t._CodeOrName=_CodeOrName;t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Name extends _CodeOrName{constructor(e){super();if(!t.IDENTIFIER.test(e))throw new Error(\"CodeGen: name must be a valid identifier\");this.str=e}toString(){return this.str}emptyStr(){return false}get names(){return{[this.str]:1}}}t.Name=Name;class _Code extends _CodeOrName{constructor(e){super();this._items=typeof e===\"string\"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return false;const e=this._items[0];return e===\"\"||e==='\"\"'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),\"\")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce(((e,t)=>{if(t instanceof Name)e[t.str]=(e[t.str]||0)+1;return e}),{})}}t._Code=_Code;t.nil=new _Code(\"\");function _(e,...t){const r=[e[0]];let n=0;while(n<t.length){addCodeArg(r,t[n]);r.push(e[++n])}return new _Code(r)}t._=_;const r=new _Code(\"+\");function str(e,...t){const n=[safeStringify(e[0])];let a=0;while(a<t.length){n.push(r);addCodeArg(n,t[a]);n.push(r,safeStringify(e[++a]))}optimize(n);return new _Code(n)}t.str=str;function addCodeArg(e,t){if(t instanceof _Code)e.push(...t._items);else if(t instanceof Name)e.push(t);else e.push(interpolate(t))}t.addCodeArg=addCodeArg;function optimize(e){let t=1;while(t<e.length-1){if(e[t]===r){const r=mergeExprItems(e[t-1],e[t+1]);if(r!==undefined){e.splice(t-1,3,r);continue}e[t++]=\"+\"}t++}}function mergeExprItems(e,t){if(t==='\"\"')return e;if(e==='\"\"')return t;if(typeof e==\"string\"){if(t instanceof Name||e[e.length-1]!=='\"')return;if(typeof t!=\"string\")return`${e.slice(0,-1)}${t}\"`;if(t[0]==='\"')return e.slice(0,-1)+t.slice(1);return}if(typeof t==\"string\"&&t[0]==='\"'&&!(e instanceof Name))return`\"${e}${t.slice(1)}`;return}function strConcat(e,t){return t.emptyStr()?e:e.emptyStr()?t:str`${e}${t}`}t.strConcat=strConcat;function interpolate(e){return typeof e==\"number\"||typeof e==\"boolean\"||e===null?e:safeStringify(Array.isArray(e)?e.join(\",\"):e)}function stringify(e){return new _Code(safeStringify(e))}t.stringify=stringify;function safeStringify(e){return JSON.stringify(e).replace(/\\u2028/g,\"\\\\u2028\").replace(/\\u2029/g,\"\\\\u2029\")}t.safeStringify=safeStringify;function getProperty(e){return typeof e==\"string\"&&t.IDENTIFIER.test(e)?new _Code(`.${e}`):_`[${e}]`}t.getProperty=getProperty;function getEsmExportName(e){if(typeof e==\"string\"&&t.IDENTIFIER.test(e)){return new _Code(`${e}`)}throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}t.getEsmExportName=getEsmExportName;function regexpCode(e){return new _Code(e.toString())}t.regexpCode=regexpCode},3561:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const n=r(1364);const a=r(3087);var s=r(1364);Object.defineProperty(t,\"_\",{enumerable:true,get:function(){return s._}});Object.defineProperty(t,\"str\",{enumerable:true,get:function(){return s.str}});Object.defineProperty(t,\"strConcat\",{enumerable:true,get:function(){return s.strConcat}});Object.defineProperty(t,\"nil\",{enumerable:true,get:function(){return s.nil}});Object.defineProperty(t,\"getProperty\",{enumerable:true,get:function(){return s.getProperty}});Object.defineProperty(t,\"stringify\",{enumerable:true,get:function(){return s.stringify}});Object.defineProperty(t,\"regexpCode\",{enumerable:true,get:function(){return s.regexpCode}});Object.defineProperty(t,\"Name\",{enumerable:true,get:function(){return s.Name}});var o=r(3087);Object.defineProperty(t,\"Scope\",{enumerable:true,get:function(){return o.Scope}});Object.defineProperty(t,\"ValueScope\",{enumerable:true,get:function(){return o.ValueScope}});Object.defineProperty(t,\"ValueScopeName\",{enumerable:true,get:function(){return o.ValueScopeName}});Object.defineProperty(t,\"varKinds\",{enumerable:true,get:function(){return o.varKinds}});t.operators={GT:new n._Code(\">\"),GTE:new n._Code(\">=\"),LT:new n._Code(\"<\"),LTE:new n._Code(\"<=\"),EQ:new n._Code(\"===\"),NEQ:new n._Code(\"!==\"),NOT:new n._Code(\"!\"),OR:new n._Code(\"||\"),AND:new n._Code(\"&&\"),ADD:new n._Code(\"+\")};class Node{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Def extends Node{constructor(e,t,r){super();this.varKind=e;this.name=t;this.rhs=r}render({es5:e,_n:t}){const r=e?a.varKinds.var:this.varKind;const n=this.rhs===undefined?\"\":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=optimizeExpr(this.rhs,e,t);return this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class Assign extends Node{constructor(e,t,r){super();this.lhs=e;this.rhs=t;this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof n.Name&&!e[this.lhs.str]&&!this.sideEffects)return;this.rhs=optimizeExpr(this.rhs,e,t);return this}get names(){const e=this.lhs instanceof n.Name?{}:{...this.lhs.names};return addExprNames(e,this.rhs)}}class AssignOp extends Assign{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Label extends Node{constructor(e){super();this.label=e;this.names={}}render({_n:e}){return`${this.label}:`+e}}class Break extends Node{constructor(e){super();this.label=e;this.names={}}render({_n:e}){const t=this.label?` ${this.label}`:\"\";return`break${t};`+e}}class Throw extends Node{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class AnyCode extends Node{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:undefined}optimizeNames(e,t){this.code=optimizeExpr(this.code,e,t);return this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class ParentNode extends Node{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),\"\")}optimizeNodes(){const{nodes:e}=this;let t=e.length;while(t--){const r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:undefined}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;while(n--){const a=r[n];if(a.optimizeNames(e,t))continue;subtractNames(e,a.names);r.splice(n,1)}return r.length>0?this:undefined}get names(){return this.nodes.reduce(((e,t)=>addNames(e,t.names)),{})}}class BlockNode extends ParentNode{render(e){return\"{\"+e._n+super.render(e)+\"}\"+e._n}}class Root extends ParentNode{}class Else extends BlockNode{}Else.kind=\"else\";class If extends BlockNode{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+=\"else \"+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(e===true)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new Else(e):e}if(t){if(e===false)return t instanceof If?t:t.nodes;if(this.nodes.length)return this;return new If(not(e),t instanceof If?[t]:t.nodes)}if(e===false||!this.nodes.length)return undefined;return this}optimizeNames(e,t){var r;this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t);if(!(super.optimizeNames(e,t)||this.else))return;this.condition=optimizeExpr(this.condition,e,t);return this}get names(){const e=super.names;addExprNames(e,this.condition);if(this.else)addNames(e,this.else.names);return e}}If.kind=\"if\";class For extends BlockNode{}For.kind=\"for\";class ForLoop extends For{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;this.iteration=optimizeExpr(this.iteration,e,t);return this}get names(){return addNames(super.names,this.iteration.names)}}class ForRange extends For{constructor(e,t,r,n){super();this.varKind=e;this.name=t;this.from=r;this.to=n}render(e){const t=e.es5?a.varKinds.var:this.varKind;const{name:r,from:n,to:s}=this;return`for(${t} ${r}=${n}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){const e=addExprNames(super.names,this.from);return addExprNames(e,this.to)}}class ForIter extends For{constructor(e,t,r,n){super();this.loop=e;this.varKind=t;this.name=r;this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;this.iterable=optimizeExpr(this.iterable,e,t);return this}get names(){return addNames(super.names,this.iterable.names)}}class Func extends BlockNode{constructor(e,t,r){super();this.name=e;this.args=t;this.async=r}render(e){const t=this.async?\"async \":\"\";return`${t}function ${this.name}(${this.args})`+super.render(e)}}Func.kind=\"func\";class Return extends ParentNode{render(e){return\"return \"+super.render(e)}}Return.kind=\"return\";class Try extends BlockNode{render(e){let t=\"try\"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;super.optimizeNodes();(e=this.catch)===null||e===void 0?void 0:e.optimizeNodes();(t=this.finally)===null||t===void 0?void 0:t.optimizeNodes();return this}optimizeNames(e,t){var r,n;super.optimizeNames(e,t);(r=this.catch)===null||r===void 0?void 0:r.optimizeNames(e,t);(n=this.finally)===null||n===void 0?void 0:n.optimizeNames(e,t);return this}get names(){const e=super.names;if(this.catch)addNames(e,this.catch.names);if(this.finally)addNames(e,this.finally.names);return e}}class Catch extends BlockNode{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Catch.kind=\"catch\";class Finally extends BlockNode{render(e){return\"finally\"+super.render(e)}}Finally.kind=\"finally\";class CodeGen{constructor(e,t={}){this._values={};this._blockStarts=[];this._constants={};this.opts={...t,_n:t.lines?\"\\n\":\"\"};this._extScope=e;this._scope=new a.Scope({parent:e});this._nodes=[new Root]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);const n=this._values[r.prefix]||(this._values[r.prefix]=new Set);n.add(r);return r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const a=this._scope.toName(t);if(r!==undefined&&n)this._constants[a.str]=r;this._leafNode(new Def(e,a,r));return a}const(e,t,r){return this._def(a.varKinds.const,e,t,r)}let(e,t,r){return this._def(a.varKinds.let,e,t,r)}var(e,t,r){return this._def(a.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Assign(e,t,r))}add(e,r){return this._leafNode(new AssignOp(e,t.operators.ADD,r))}code(e){if(typeof e==\"function\")e();else if(e!==n.nil)this._leafNode(new AnyCode(e));return this}object(...e){const t=[\"{\"];for(const[r,a]of e){if(t.length>1)t.push(\",\");t.push(r);if(r!==a||this.opts.es5){t.push(\":\");(0,n.addCodeArg)(t,a)}}t.push(\"}\");return new n._Code(t)}if(e,t,r){this._blockNode(new If(e));if(t&&r){this.code(t).else().code(r).endIf()}else if(t){this.code(t).endIf()}else if(r){throw new Error('CodeGen: \"else\" body without \"then\" body')}return this}elseIf(e){return this._elseNode(new If(e))}else(){return this._elseNode(new Else)}endIf(){return this._endBlockNode(If,Else)}_for(e,t){this._blockNode(e);if(t)this.code(t).endFor();return this}for(e,t){return this._for(new ForLoop(e),t)}forRange(e,t,r,n,s=(this.opts.es5?a.varKinds.var:a.varKinds.let)){const o=this._scope.toName(e);return this._for(new ForRange(s,o,t,r),(()=>n(o)))}forOf(e,t,r,s=a.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var(\"_arr\",t);return this.forRange(\"_i\",0,(0,n._)`${e}.length`,(t=>{this.var(o,(0,n._)`${e}[${t}]`);r(o)}))}return this._for(new ForIter(\"of\",s,o,t),(()=>r(o)))}forIn(e,t,r,s=(this.opts.es5?a.varKinds.var:a.varKinds.const)){if(this.opts.ownProperties){return this.forOf(e,(0,n._)`Object.keys(${t})`,r)}const o=this._scope.toName(e);return this._for(new ForIter(\"in\",s,o,t),(()=>r(o)))}endFor(){return this._endBlockNode(For)}label(e){return this._leafNode(new Label(e))}break(e){return this._leafNode(new Break(e))}return(e){const t=new Return;this._blockNode(t);this.code(e);if(t.nodes.length!==1)throw new Error('CodeGen: \"return\" should have one node');return this._endBlockNode(Return)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: \"try\" without \"catch\" and \"finally\"');const n=new Try;this._blockNode(n);this.code(e);if(t){const e=this.name(\"e\");this._currNode=n.catch=new Catch(e);t(e)}if(r){this._currNode=n.finally=new Finally;this.code(r)}return this._endBlockNode(Catch,Finally)}throw(e){return this._leafNode(new Throw(e))}block(e,t){this._blockStarts.push(this._nodes.length);if(e)this.code(e).endBlock(t);return this}endBlock(e){const t=this._blockStarts.pop();if(t===undefined)throw new Error(\"CodeGen: not in self-balancing block\");const r=this._nodes.length-t;if(r<0||e!==undefined&&r!==e){throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`)}this._nodes.length=t;return this}func(e,t=n.nil,r,a){this._blockNode(new Func(e,t,r));if(a)this.code(a).endFunc();return this}endFunc(){return this._endBlockNode(Func)}optimize(e=1){while(e-- >0){this._root.optimizeNodes();this._root.optimizeNames(this._root.names,this._constants)}}_leafNode(e){this._currNode.nodes.push(e);return this}_blockNode(e){this._currNode.nodes.push(e);this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t){this._nodes.pop();return this}throw new Error(`CodeGen: not in block \"${t?`${e.kind}/${t.kind}`:e.kind}\"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof If)){throw new Error('CodeGen: \"else\" without \"if\"')}this._currNode=t.else=e;return this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}}t.CodeGen=CodeGen;function addNames(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function addExprNames(e,t){return t instanceof n._CodeOrName?addNames(e,t.names):e}function optimizeExpr(e,t,r){if(e instanceof n.Name)return replaceName(e);if(!canOptimize(e))return e;return new n._Code(e._items.reduce(((e,t)=>{if(t instanceof n.Name)t=replaceName(t);if(t instanceof n._Code)e.push(...t._items);else e.push(t);return e}),[]));function replaceName(e){const n=r[e.str];if(n===undefined||t[e.str]!==1)return e;delete t[e.str];return n}function canOptimize(e){return e instanceof n._Code&&e._items.some((e=>e instanceof n.Name&&t[e.str]===1&&r[e.str]!==undefined))}}function subtractNames(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function not(e){return typeof e==\"boolean\"||typeof e==\"number\"||e===null?!e:(0,n._)`!${par(e)}`}t.not=not;const i=mappend(t.operators.AND);function and(...e){return e.reduce(i)}t.and=and;const c=mappend(t.operators.OR);function or(...e){return e.reduce(c)}t.or=or;function mappend(e){return(t,r)=>t===n.nil?r:r===n.nil?t:(0,n._)`${par(t)} ${e} ${par(r)}`}function par(e){return e instanceof n.Name?e:(0,n._)`(${e})`}},3087:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=r(1364);class ValueError extends Error{constructor(e){super(`CodeGen: \"code\" for ${e} not defined`);this.value=e.value}}var a;(function(e){e[e[\"Started\"]=0]=\"Started\";e[e[\"Completed\"]=1]=\"Completed\"})(a||(t.UsedValueState=a={}));t.varKinds={const:new n.Name(\"const\"),let:new n.Name(\"let\"),var:new n.Name(\"var\")};class Scope{constructor({prefixes:e,parent:t}={}){this._names={};this._prefixes=e;this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){const t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e)){throw new Error(`CodeGen: prefix \"${e}\" is not allowed in this scope`)}return this._names[e]={prefix:e,index:0}}}t.Scope=Scope;class ValueScopeName extends n.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e;this.scopePath=(0,n._)`.${new n.Name(t)}[${r}]`}}t.ValueScopeName=ValueScopeName;const s=(0,n._)`\\n`;class ValueScope extends Scope{constructor(e){super(e);this._values={};this._scope=e.scope;this.opts={...e,_n:e.lines?s:n.nil}}get(){return this._scope}name(e){return new ValueScopeName(e,this._newName(e))}value(e,t){var r;if(t.ref===undefined)throw new Error(\"CodeGen: ref must be passed in value\");const n=this.toName(e);const{prefix:a}=n;const s=(r=t.key)!==null&&r!==void 0?r:t.ref;let o=this._values[a];if(o){const e=o.get(s);if(e)return e}else{o=this._values[a]=new Map}o.set(s,n);const i=this._scope[a]||(this._scope[a]=[]);const c=i.length;i[c]=t.ref;n.setValue(t,{property:a,itemIndex:c});return n}getValue(e,t){const r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(t.scopePath===undefined)throw new Error(`CodeGen: name \"${t}\" has no value`);return(0,n._)`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(e.value===undefined)throw new Error(`CodeGen: name \"${e}\" has no value`);return e.value.code}),t,r)}_reduceValues(e,r,s={},o){let i=n.nil;for(const c in e){const u=e[c];if(!u)continue;const d=s[c]=s[c]||new Map;u.forEach((e=>{if(d.has(e))return;d.set(e,a.Started);let s=r(e);if(s){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;i=(0,n._)`${i}${r} ${e} = ${s};${this.opts._n}`}else if(s=o===null||o===void 0?void 0:o(e)){i=(0,n._)`${i}${s}${this.opts._n}`}else{throw new ValueError(e)}d.set(e,a.Completed)}))}return i}}t.ValueScope=ValueScope},9443:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=r(3561);const a=r(5206);const s=r(6937);t.keywordError={message:({keyword:e})=>(0,n.str)`must pass \"${e}\" keyword validation`};t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,n.str)`\"${e}\" keyword must be ${t} ($data)`:(0,n.str)`\"${e}\" keyword is invalid ($data)`};function reportError(e,r=t.keywordError,a,s){const{it:o}=e;const{gen:i,compositeRule:c,allErrors:u}=o;const d=errorObjectCode(e,r,a);if(s!==null&&s!==void 0?s:c||u){addError(i,d)}else{returnErrors(o,(0,n._)`[${d}]`)}}t.reportError=reportError;function reportExtraError(e,r=t.keywordError,n){const{it:a}=e;const{gen:o,compositeRule:i,allErrors:c}=a;const u=errorObjectCode(e,r,n);addError(o,u);if(!(i||c)){returnErrors(a,s.default.vErrors)}}t.reportExtraError=reportExtraError;function resetErrorsCount(e,t){e.assign(s.default.errors,t);e.if((0,n._)`${s.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign((0,n._)`${s.default.vErrors}.length`,t)),(()=>e.assign(s.default.vErrors,null)))))}t.resetErrorsCount=resetErrorsCount;function extendErrors({gen:e,keyword:t,schemaValue:r,data:a,errsCount:o,it:i}){if(o===undefined)throw new Error(\"ajv implementation error\");const c=e.name(\"err\");e.forRange(\"i\",o,s.default.errors,(o=>{e.const(c,(0,n._)`${s.default.vErrors}[${o}]`);e.if((0,n._)`${c}.instancePath === undefined`,(()=>e.assign((0,n._)`${c}.instancePath`,(0,n.strConcat)(s.default.instancePath,i.errorPath))));e.assign((0,n._)`${c}.schemaPath`,(0,n.str)`${i.errSchemaPath}/${t}`);if(i.opts.verbose){e.assign((0,n._)`${c}.schema`,r);e.assign((0,n._)`${c}.data`,a)}}))}t.extendErrors=extendErrors;function addError(e,t){const r=e.const(\"err\",t);e.if((0,n._)`${s.default.vErrors} === null`,(()=>e.assign(s.default.vErrors,(0,n._)`[${r}]`)),(0,n._)`${s.default.vErrors}.push(${r})`);e.code((0,n._)`${s.default.errors}++`)}function returnErrors(e,t){const{gen:r,validateName:a,schemaEnv:s}=e;if(s.$async){r.throw((0,n._)`new ${e.ValidationError}(${t})`)}else{r.assign((0,n._)`${a}.errors`,t);r.return(false)}}const o={keyword:new n.Name(\"keyword\"),schemaPath:new n.Name(\"schemaPath\"),params:new n.Name(\"params\"),propertyName:new n.Name(\"propertyName\"),message:new n.Name(\"message\"),schema:new n.Name(\"schema\"),parentSchema:new n.Name(\"parentSchema\")};function errorObjectCode(e,t,r){const{createErrors:a}=e.it;if(a===false)return(0,n._)`{}`;return errorObject(e,t,r)}function errorObject(e,t,r={}){const{gen:n,it:a}=e;const s=[errorInstancePath(a,r),errorSchemaPath(e,r)];extraErrorProps(e,t,s);return n.object(...s)}function errorInstancePath({errorPath:e},{instancePath:t}){const r=t?(0,n.str)`${e}${(0,a.getErrorPath)(t,a.Type.Str)}`:e;return[s.default.instancePath,(0,n.strConcat)(s.default.instancePath,r)]}function errorSchemaPath({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:s}){let i=s?t:(0,n.str)`${t}/${e}`;if(r){i=(0,n.str)`${i}${(0,a.getErrorPath)(r,a.Type.Str)}`}return[o.schemaPath,i]}function extraErrorProps(e,{params:t,message:r},a){const{keyword:i,data:c,schemaValue:u,it:d}=e;const{opts:l,propertyName:f,topSchemaRef:p,schemaPath:m}=d;a.push([o.keyword,i],[o.params,typeof t==\"function\"?t(e):t||(0,n._)`{}`]);if(l.messages){a.push([o.message,typeof r==\"function\"?r(e):r])}if(l.verbose){a.push([o.schema,u],[o.parentSchema,(0,n._)`${p}${m}`],[s.default.data,c])}if(f)a.push([o.propertyName,f])}},5178:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=r(3561);const a=r(818);const s=r(6937);const o=r(1489);const i=r(5206);const c=r(6056);class SchemaEnv{constructor(e){var t;this.refs={};this.dynamicAnchors={};let r;if(typeof e.schema==\"object\")r=e.schema;this.schema=e.schema;this.schemaId=e.schemaId;this.root=e.root||this;this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,o.normalizeId)(r===null||r===void 0?void 0:r[e.schemaId||\"$id\"]);this.schemaPath=e.schemaPath;this.localRefs=e.localRefs;this.meta=e.meta;this.$async=r===null||r===void 0?void 0:r.$async;this.refs={}}}t.SchemaEnv=SchemaEnv;function compileSchema(e){const t=getCompilingSchema.call(this,e);if(t)return t;const r=(0,o.getFullPath)(this.opts.uriResolver,e.root.baseId);const{es5:i,lines:u}=this.opts.code;const{ownProperties:d}=this.opts;const l=new n.CodeGen(this.scope,{es5:i,lines:u,ownProperties:d});let f;if(e.$async){f=l.scopeValue(\"Error\",{ref:a.default,code:(0,n._)`require(\"ajv/dist/runtime/validation_error\").default`})}const p=l.scopeName(\"validate\");e.validateName=p;const m={gen:l,allErrors:this.opts.allErrors,data:s.default.data,parentData:s.default.parentData,parentDataProperty:s.default.parentDataProperty,dataNames:[s.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:l.scopeValue(\"schema\",this.opts.code.source===true?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:f,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?\"\":\"#\"),errorPath:(0,n._)`\"\"`,opts:this.opts,self:this};let h;try{this._compilations.add(e);(0,c.validateFunctionCode)(m);l.optimize(this.opts.code.optimize);const t=l.toString();h=`${l.scopeRefs(s.default.scope)}return ${t}`;if(this.opts.code.process)h=this.opts.code.process(h,e);const r=new Function(`${s.default.self}`,`${s.default.scope}`,h);const a=r(this,this.scope.get());this.scope.value(p,{ref:a});a.errors=null;a.schema=e.schema;a.schemaEnv=e;if(e.$async)a.$async=true;if(this.opts.code.source===true){a.source={validateName:p,validateCode:t,scopeValues:l._values}}if(this.opts.unevaluated){const{props:e,items:t}=m;a.evaluated={props:e instanceof n.Name?undefined:e,items:t instanceof n.Name?undefined:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name};if(a.source)a.source.evaluated=(0,n.stringify)(a.evaluated)}e.validate=a;return e}catch(t){delete e.validate;delete e.validateName;if(h)this.logger.error(\"Error compiling schema, function code:\",h);throw t}finally{this._compilations.delete(e)}}t.compileSchema=compileSchema;function resolveRef(e,t,r){var n;r=(0,o.resolveUrl)(this.opts.uriResolver,t,r);const a=e.refs[r];if(a)return a;let s=resolve.call(this,e,r);if(s===undefined){const a=(n=e.localRefs)===null||n===void 0?void 0:n[r];const{schemaId:o}=this.opts;if(a)s=new SchemaEnv({schema:a,schemaId:o,root:e,baseId:t})}if(s===undefined)return;return e.refs[r]=inlineOrCompile.call(this,s)}t.resolveRef=resolveRef;function inlineOrCompile(e){if((0,o.inlineRef)(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:compileSchema.call(this,e)}function getCompilingSchema(e){for(const t of this._compilations){if(sameSchemaEnv(t,e))return t}}t.getCompilingSchema=getCompilingSchema;function sameSchemaEnv(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function resolve(e,t){let r;while(typeof(r=this.refs[t])==\"string\")t=r;return r||this.schemas[t]||resolveSchema.call(this,e,t)}function resolveSchema(e,t){const r=this.opts.uriResolver.parse(t);const n=(0,o._getFullPath)(this.opts.uriResolver,r);let a=(0,o.getFullPath)(this.opts.uriResolver,e.baseId,undefined);if(Object.keys(e.schema).length>0&&n===a){return getJsonPointer.call(this,r,e)}const s=(0,o.normalizeId)(n);const i=this.refs[s]||this.schemas[s];if(typeof i==\"string\"){const t=resolveSchema.call(this,e,i);if(typeof(t===null||t===void 0?void 0:t.schema)!==\"object\")return;return getJsonPointer.call(this,r,t)}if(typeof(i===null||i===void 0?void 0:i.schema)!==\"object\")return;if(!i.validate)compileSchema.call(this,i);if(s===(0,o.normalizeId)(t)){const{schema:t}=i;const{schemaId:r}=this.opts;const n=t[r];if(n)a=(0,o.resolveUrl)(this.opts.uriResolver,a,n);return new SchemaEnv({schema:t,schemaId:r,root:e,baseId:a})}return getJsonPointer.call(this,r,i)}t.resolveSchema=resolveSchema;const u=new Set([\"properties\",\"patternProperties\",\"enum\",\"dependencies\",\"definitions\"]);function getJsonPointer(e,{baseId:t,schema:r,root:n}){var a;if(((a=e.fragment)===null||a===void 0?void 0:a[0])!==\"/\")return;for(const n of e.fragment.slice(1).split(\"/\")){if(typeof r===\"boolean\")return;const e=r[(0,i.unescapeFragment)(n)];if(e===undefined)return;r=e;const a=typeof r===\"object\"&&r[this.opts.schemaId];if(!u.has(n)&&a){t=(0,o.resolveUrl)(this.opts.uriResolver,t,a)}}let s;if(typeof r!=\"boolean\"&&r.$ref&&!(0,i.schemaHasRulesButRef)(r,this.RULES)){const e=(0,o.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=resolveSchema.call(this,n,e)}const{schemaId:c}=this.opts;s=s||new SchemaEnv({schema:r,schemaId:c,root:n,baseId:t});if(s.schema!==s.root.schema)return s;return undefined}},6937:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});const n=r(3561);const a={data:new n.Name(\"data\"),valCxt:new n.Name(\"valCxt\"),instancePath:new n.Name(\"instancePath\"),parentData:new n.Name(\"parentData\"),parentDataProperty:new n.Name(\"parentDataProperty\"),rootData:new n.Name(\"rootData\"),dynamicAnchors:new n.Name(\"dynamicAnchors\"),vErrors:new n.Name(\"vErrors\"),errors:new n.Name(\"errors\"),this:new n.Name(\"this\"),self:new n.Name(\"self\"),scope:new n.Name(\"scope\"),json:new n.Name(\"json\"),jsonPos:new n.Name(\"jsonPos\"),jsonLen:new n.Name(\"jsonLen\"),jsonPart:new n.Name(\"jsonPart\")};t[\"default\"]=a},9554:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});const n=r(1489);class MissingRefError extends Error{constructor(e,t,r,a){super(a||`can't resolve reference ${r} from id ${t}`);this.missingRef=(0,n.resolveUrl)(e,t,r);this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t[\"default\"]=MissingRefError},1489:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const n=r(5206);const a=r(1230);const s=r(9122);const o=new Set([\"type\",\"format\",\"pattern\",\"maxLength\",\"minLength\",\"maxProperties\",\"minProperties\",\"maxItems\",\"minItems\",\"maximum\",\"minimum\",\"uniqueItems\",\"multipleOf\",\"required\",\"enum\",\"const\"]);function inlineRef(e,t=true){if(typeof e==\"boolean\")return true;if(t===true)return!hasRef(e);if(!t)return false;return countKeys(e)<=t}t.inlineRef=inlineRef;const i=new Set([\"$ref\",\"$recursiveRef\",\"$recursiveAnchor\",\"$dynamicRef\",\"$dynamicAnchor\"]);function hasRef(e){for(const t in e){if(i.has(t))return true;const r=e[t];if(Array.isArray(r)&&r.some(hasRef))return true;if(typeof r==\"object\"&&hasRef(r))return true}return false}function countKeys(e){let t=0;for(const r in e){if(r===\"$ref\")return Infinity;t++;if(o.has(r))continue;if(typeof e[r]==\"object\"){(0,n.eachItem)(e[r],(e=>t+=countKeys(e)))}if(t===Infinity)return Infinity}return t}function getFullPath(e,t=\"\",r){if(r!==false)t=normalizeId(t);const n=e.parse(t);return _getFullPath(e,n)}t.getFullPath=getFullPath;function _getFullPath(e,t){const r=e.serialize(t);return r.split(\"#\")[0]+\"#\"}t._getFullPath=_getFullPath;const c=/#\\/?$/;function normalizeId(e){return e?e.replace(c,\"\"):\"\"}t.normalizeId=normalizeId;function resolveUrl(e,t,r){r=normalizeId(r);return e.resolve(t,r)}t.resolveUrl=resolveUrl;const u=/^[a-z_][-a-z0-9._]*$/i;function getSchemaRefs(e,t){if(typeof e==\"boolean\")return{};const{schemaId:r,uriResolver:n}=this.opts;const o=normalizeId(e[r]||t);const i={\"\":o};const c=getFullPath(n,o,false);const d={};const l=new Set;s(e,{allKeys:true},((e,t,n,a)=>{if(a===undefined)return;const s=c+t;let o=i[a];if(typeof e[r]==\"string\")o=addRef.call(this,e[r]);addAnchor.call(this,e.$anchor);addAnchor.call(this,e.$dynamicAnchor);i[t]=o;function addRef(t){const r=this.opts.uriResolver.resolve;t=normalizeId(o?r(o,t):t);if(l.has(t))throw ambiguos(t);l.add(t);let n=this.refs[t];if(typeof n==\"string\")n=this.refs[n];if(typeof n==\"object\"){checkAmbiguosRef(e,n.schema,t)}else if(t!==normalizeId(s)){if(t[0]===\"#\"){checkAmbiguosRef(e,d[t],t);d[t]=e}else{this.refs[t]=s}}return t}function addAnchor(e){if(typeof e==\"string\"){if(!u.test(e))throw new Error(`invalid anchor \"${e}\"`);addRef.call(this,`#${e}`)}}}));return d;function checkAmbiguosRef(e,t,r){if(t!==undefined&&!a(e,t))throw ambiguos(r)}function ambiguos(e){return new Error(`reference \"${e}\" resolves to more than one schema`)}}t.getSchemaRefs=getSchemaRefs},315:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.getRules=t.isJSONType=void 0;const r=[\"string\",\"number\",\"integer\",\"boolean\",\"null\",\"object\",\"array\"];const n=new Set(r);function isJSONType(e){return typeof e==\"string\"&&n.has(e)}t.isJSONType=isJSONType;function getRules(){const e={number:{type:\"number\",rules:[]},string:{type:\"string\",rules:[]},array:{type:\"array\",rules:[]},object:{type:\"object\",rules:[]}};return{types:{...e,integer:true,boolean:true,null:true},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}t.getRules=getRules},5206:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const n=r(3561);const a=r(1364);function toHash(e){const t={};for(const r of e)t[r]=true;return t}t.toHash=toHash;function alwaysValidSchema(e,t){if(typeof t==\"boolean\")return t;if(Object.keys(t).length===0)return true;checkUnknownRules(e,t);return!schemaHasRules(t,e.self.RULES.all)}t.alwaysValidSchema=alwaysValidSchema;function checkUnknownRules(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t===\"boolean\")return;const a=n.RULES.keywords;for(const r in t){if(!a[r])checkStrictMode(e,`unknown keyword: \"${r}\"`)}}t.checkUnknownRules=checkUnknownRules;function schemaHasRules(e,t){if(typeof e==\"boolean\")return!e;for(const r in e)if(t[r])return true;return false}t.schemaHasRules=schemaHasRules;function schemaHasRulesButRef(e,t){if(typeof e==\"boolean\")return!e;for(const r in e)if(r!==\"$ref\"&&t.all[r])return true;return false}t.schemaHasRulesButRef=schemaHasRulesButRef;function schemaRefOrVal({topSchemaRef:e,schemaPath:t},r,a,s){if(!s){if(typeof r==\"number\"||typeof r==\"boolean\")return r;if(typeof r==\"string\")return(0,n._)`${r}`}return(0,n._)`${e}${t}${(0,n.getProperty)(a)}`}t.schemaRefOrVal=schemaRefOrVal;function unescapeFragment(e){return unescapeJsonPointer(decodeURIComponent(e))}t.unescapeFragment=unescapeFragment;function escapeFragment(e){return encodeURIComponent(escapeJsonPointer(e))}t.escapeFragment=escapeFragment;function escapeJsonPointer(e){if(typeof e==\"number\")return`${e}`;return e.replace(/~/g,\"~0\").replace(/\\//g,\"~1\")}t.escapeJsonPointer=escapeJsonPointer;function unescapeJsonPointer(e){return e.replace(/~1/g,\"/\").replace(/~0/g,\"~\")}t.unescapeJsonPointer=unescapeJsonPointer;function eachItem(e,t){if(Array.isArray(e)){for(const r of e)t(r)}else{t(e)}}t.eachItem=eachItem;function makeMergeEvaluated({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:a}){return(s,o,i,c)=>{const u=i===undefined?o:i instanceof n.Name?(o instanceof n.Name?e(s,o,i):t(s,o,i),i):o instanceof n.Name?(t(s,i,o),o):r(o,i);return c===n.Name&&!(u instanceof n.Name)?a(s,u):u}}t.mergeEvaluated={props:makeMergeEvaluated({mergeNames:(e,t,r)=>e.if((0,n._)`${r} !== true && ${t} !== undefined`,(()=>{e.if((0,n._)`${t} === true`,(()=>e.assign(r,true)),(()=>e.assign(r,(0,n._)`${r} || {}`).code((0,n._)`Object.assign(${r}, ${t})`)))})),mergeToName:(e,t,r)=>e.if((0,n._)`${r} !== true`,(()=>{if(t===true){e.assign(r,true)}else{e.assign(r,(0,n._)`${r} || {}`);setEvaluated(e,r,t)}})),mergeValues:(e,t)=>e===true?true:{...e,...t},resultToName:evaluatedPropsToName}),items:makeMergeEvaluated({mergeNames:(e,t,r)=>e.if((0,n._)`${r} !== true && ${t} !== undefined`,(()=>e.assign(r,(0,n._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`))),mergeToName:(e,t,r)=>e.if((0,n._)`${r} !== true`,(()=>e.assign(r,t===true?true:(0,n._)`${r} > ${t} ? ${r} : ${t}`))),mergeValues:(e,t)=>e===true?true:Math.max(e,t),resultToName:(e,t)=>e.var(\"items\",t)})};function evaluatedPropsToName(e,t){if(t===true)return e.var(\"props\",true);const r=e.var(\"props\",(0,n._)`{}`);if(t!==undefined)setEvaluated(e,r,t);return r}t.evaluatedPropsToName=evaluatedPropsToName;function setEvaluated(e,t,r){Object.keys(r).forEach((r=>e.assign((0,n._)`${t}${(0,n.getProperty)(r)}`,true)))}t.setEvaluated=setEvaluated;const s={};function useFunc(e,t){return e.scopeValue(\"func\",{ref:t,code:s[t.code]||(s[t.code]=new a._Code(t.code))})}t.useFunc=useFunc;var o;(function(e){e[e[\"Num\"]=0]=\"Num\";e[e[\"Str\"]=1]=\"Str\"})(o||(t.Type=o={}));function getErrorPath(e,t,r){if(e instanceof n.Name){const a=t===o.Num;return r?a?(0,n._)`\"[\" + ${e} + \"]\"`:(0,n._)`\"['\" + ${e} + \"']\"`:a?(0,n._)`\"/\" + ${e}`:(0,n._)`\"/\" + ${e}.replace(/~/g, \"~0\").replace(/\\\\//g, \"~1\")`}return r?(0,n.getProperty)(e).toString():\"/\"+escapeJsonPointer(e)}t.getErrorPath=getErrorPath;function checkStrictMode(e,t,r=e.opts.strictSchema){if(!r)return;t=`strict mode: ${t}`;if(r===true)throw new Error(t);e.self.logger.warn(t)}t.checkStrictMode=checkStrictMode},6567:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0;function schemaHasRulesForType({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==true&&shouldUseGroup(e,n)}t.schemaHasRulesForType=schemaHasRulesForType;function shouldUseGroup(e,t){return t.rules.some((t=>shouldUseRule(e,t)))}t.shouldUseGroup=shouldUseGroup;function shouldUseRule(e,t){var r;return e[t.keyword]!==undefined||((r=t.definition.implements)===null||r===void 0?void 0:r.some((t=>e[t]!==undefined)))}t.shouldUseRule=shouldUseRule},7144:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const n=r(9443);const a=r(3561);const s=r(6937);const o={message:\"boolean schema is false\"};function topBoolOrEmptySchema(e){const{gen:t,schema:r,validateName:n}=e;if(r===false){falseSchemaError(e,false)}else if(typeof r==\"object\"&&r.$async===true){t.return(s.default.data)}else{t.assign((0,a._)`${n}.errors`,null);t.return(true)}}t.topBoolOrEmptySchema=topBoolOrEmptySchema;function boolOrEmptySchema(e,t){const{gen:r,schema:n}=e;if(n===false){r.var(t,false);falseSchemaError(e)}else{r.var(t,true)}}t.boolOrEmptySchema=boolOrEmptySchema;function falseSchemaError(e,t){const{gen:r,data:a}=e;const s={gen:r,keyword:\"false schema\",data:a,schema:false,schemaCode:false,schemaValue:false,params:{},it:e};(0,n.reportError)(s,o,undefined,t)}},6794:(e,t,r)=>{Object.defineProperty(t,\"__esModule\",{value:true});t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const n=r(315);const a=r(6567);const s=r(9443);const o=r(3561);const i=r(5206);var c;(function(e){e[e[\"Correct\"]=0]=\"Correct\";e[e[\"Wrong\"]=1]=\"Wrong\"})(c||(t.DataType=c={}));function getSchemaTypes(e){const t=getJSONTypes(e.type);const r=t.includes(\"null\");if(r){if(e.nullable===false)throw new Error(\"type: null contradicts nullable: false\")}else{if(!t.length&&e.nullable!==undefined){throw new Error('\"nullable\" cannot be used without \"type\"')}if(e.nullable===true)t.push(\"null\")}return t}t.getSchemaTypes=getSchemaTypes;function getJSONTypes(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(n.isJSONType))return t;throw new Error(\"type must be JSONType or JSONType[]: \"+t.join(\",\"))}t.getJSONTypes=getJSONTypes;function coerceAndCheckDataType(e,t){const{gen:r,data:n,opts:s}=e;const o=coerceToTypes(t,s.coerceTypes);const i=t.length>0&&!(o.length===0&&t.length===1&&(0,a.schemaHasRulesForType)(e,t[0]));if(i){const a=checkDataTypes(t,n,s.strictNumbers,c.Wrong);r.if(a,(()=>{if(o.length)coerceData(e,t,o);else reportTypeError(e)}))}return i}t.coerceAndCheckDataType=coerceAndCheckDataType;const u=new Set([\"string\",\"number\",\"integer\",\"boolean\",\"null\"]);function coerceToTypes(e,t){return t?e.filter((e=>u.has(e)||t===\"array\"&&e===\"array\")):[]}function coerceData(e,t,r){const{gen:n,data:a,opts:s}=e;const i=n.let(\"dataType\",(0,o._)`typeof ${a}`);const c=n.let(\"coerced\",(0,o._)`undefined`);if(s.coerceTypes===\"array\"){n.if((0,o._)`${i} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,(()=>n.assign(a,(0,o._)`${a}[0]`).assign(i,(0,o._)`typeof ${a}`).if(checkDataTypes(t,a,s.strictNumbers),(()=>n.assign(c,a)))))}n.if((0,o._)`${c} !== undefined`);for(const e of r){if(u.has(e)||e===\"array\"&&s.coerceTypes===\"array\"){coerceSpecificType(e)}}n.else();reportTypeError(e);n.endIf();n.if((0,o._)`${c} !== undefined`,(()=>{n.assign(a,c);assignParentData(e,c)}));function coerceSpecificType(e){switch(e){case\"string\":n.elseIf((0,o._)`${i} == \"number\" || ${i} == \"boolean\"`).assign(c,(0,o._)`\"\" + ${a}`).elseIf((0,o._)`${a} === null`).assign(c,(0,o._)`\"\"`);return;case\"number\":n.elseIf((0,o._)`${i} == \"boolean\" || ${a} === null
^^^^^^·
SyntaxError: Cannot use import statement outside a module

  63 |         return originalRequire.call(this, `next/dist/server/route-modules/pages/vendored/contexts/${path.basename(request, '.shared-runtime')}`);
  64 |     }
> 65 |     return originalRequire.call(this, request);
     |                            ^
  66 | };
  67 |
  68 | //# sourceMappingURL=require-hook.js.map

  at mod.require (../packages/next/dist/server/require-hook.js:65:28)
  at Object.<anonymous> (../packages/next/dist/telemetry/storage.js:12:54)
  "
  at Object.toMatch (integration/config-promise-error/test/index.test.js:33:33)

Read more about building and testing Next.js in contributing.md.

TURBOPACK=1 pnpm test-start test/e2e/app-dir/app-compilation/index.test.ts (turbopack)

  • app dir > Loading > should render loading.js in initial html for slow page
Expand output

● app dir › Loading › should render loading.js in initial html for slow page

next build failed with code/signal 1

   97 |           if (code || signal)
   98 |             reject(
>  99 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  100 |             )
  101 |           else resolve()
  102 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:99:15)

Read more about building and testing Next.js in contributing.md.

pnpm test test/integration/build-trace-extra-entries/test/index.test.js

  • build trace with extra entries > production mode > should build and trace correctly
Expand output

● build trace with extra entries › production mode › should build and trace correctly

expect(received).toBe(expected) // Object.is equality

Expected: 0
Received: 1

  18 |         })
  19 |         console.log(result)
> 20 |         expect(result.code).toBe(0)
     |                             ^
  21 |
  22 |         const appTrace = await fs.readJSON(
  23 |           join(appDir, '.next/server/pages/_app.js.nft.json')

  at Object.toBe (integration/build-trace-extra-entries/test/index.test.js:20:29)

Read more about building and testing Next.js in contributing.md.

__NEXT_EXPERIMENTAL_PPR=true pnpm test-start test/e2e/app-dir/app-edge/app-edge.test.ts (PPR)

  • app-dir edge SSR > should handle edge only routes
  • app-dir edge SSR > should retrieve cookies in a server component in the edge runtime
  • app-dir edge SSR > should treat process as object without polyfill in edge runtime
  • app-dir edge SSR > should handle /index routes correctly
  • app-dir edge SSR > should generate matchers correctly in middleware manifest
Expand output

● app-dir edge SSR › should handle edge only routes

next build failed with code/signal 1

   97 |           if (code || signal)
   98 |             reject(
>  99 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  100 |             )
  101 |           else resolve()
  102 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:99:15)

● app-dir edge SSR › should retrieve cookies in a server component in the edge runtime

next build failed with code/signal 1

   97 |           if (code || signal)
   98 |             reject(
>  99 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  100 |             )
  101 |           else resolve()
  102 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:99:15)

● app-dir edge SSR › should treat process as object without polyfill in edge runtime

next build failed with code/signal 1

   97 |           if (code || signal)
   98 |             reject(
>  99 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  100 |             )
  101 |           else resolve()
  102 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:99:15)

● app-dir edge SSR › should handle /index routes correctly

next build failed with code/signal 1

   97 |           if (code || signal)
   98 |             reject(
>  99 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  100 |             )
  101 |           else resolve()
  102 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:99:15)

● app-dir edge SSR › should generate matchers correctly in middleware manifest

next build failed with code/signal 1

   97 |           if (code || signal)
   98 |             reject(
>  99 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  100 |             )
  101 |           else resolve()
  102 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:99:15)

Read more about building and testing Next.js in contributing.md.

__NEXT_EXPERIMENTAL_PPR=true pnpm test-start test/e2e/app-dir/actions-navigation/index.test.ts (PPR)

  • app-dir action handling > should handle actions correctly after navigation / redirection events
  • app-dir action handling > should handle actions correctly after following a relative link
Expand output

● app-dir action handling › should handle actions correctly after navigation / redirection events

next build failed with code/signal 1

   97 |           if (code || signal)
   98 |             reject(
>  99 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  100 |             )
  101 |           else resolve()
  102 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:99:15)

● app-dir action handling › should handle actions correctly after following a relative link

next build failed with code/signal 1

   97 |           if (code || signal)
   98 |             reject(
>  99 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  100 |             )
  101 |           else resolve()
  102 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:99:15)

Read more about building and testing Next.js in contributing.md.

pnpm test-start test/e2e/app-dir/app-routes-subrequests/app-routes-subrequests.test.ts

  • app-routes-subrequests > shortcuts after 5 subrequests
Expand output

● app-routes-subrequests › shortcuts after 5 subrequests

next build failed with code/signal 1

   97 |           if (code || signal)
   98 |             reject(
>  99 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  100 |             )
  101 |           else resolve()
  102 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:99:15)

Read more about building and testing Next.js in contributing.md.

TURBOPACK=1 pnpm test test/integration/404-page-custom-error/test/index.test.js (turbopack)

  • Default 404 Page with custom _error > production mode > should build successfully
  • Default 404 Page with custom _error > production mode > should respond to 404 correctly
  • Default 404 Page with custom _error > production mode > should render error correctly
  • Default 404 Page with custom _error > production mode > should render index page normal
  • Default 404 Page with custom _error > production mode > should set pages404 in routes-manifest correctly
  • Default 404 Page with custom _error > production mode > should have output 404.html
Expand output

● Default 404 Page with custom _error › production mode › should build successfully

expect(received).toBe(expected) // Object.is equality

Expected: 0
Received: 1

  63 |         })
  64 |
> 65 |         expect(code).toBe(0)
     |                      ^
  66 |
  67 |         appPort = await findPort()
  68 |

  at Object.toBe (integration/404-page-custom-error/test/index.test.js:65:22)

● Default 404 Page with custom _error › production mode › should respond to 404 correctly

TypeError: Invalid URL

  156 | ): Promise<Response> {
  157 |   const url = query ? withQuery(pathname, query) : pathname
> 158 |   return fetch(getFullUrl(appPort, url), opts)
      |               ^
  159 | }
  160 |
  161 | export function renderViaHTTP(

  at parseURL (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1164:12)
  at new Request (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1210:17)
  at ../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1439:19
  at fetch (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1437:9)
  at fetchViaHTTP (lib/next-test-utils.ts:158:15)
  at Object.<anonymous> (integration/404-page-custom-error/test/index.test.js:25:35)

● Default 404 Page with custom _error › production mode › should render error correctly

TypeError: Invalid URL

  156 | ): Promise<Response> {
  157 |   const url = query ? withQuery(pathname, query) : pathname
> 158 |   return fetch(getFullUrl(appPort, url), opts)
      |               ^
  159 | }
  160 |
  161 | export function renderViaHTTP(

  at parseURL (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1164:12)
  at new Request (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1210:17)
  at ../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1439:19
  at fetch (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1437:9)
  at fetchViaHTTP (lib/next-test-utils.ts:158:15)
  at fetchViaHTTP (lib/next-test-utils.ts:167:10)
  at Object.<anonymous> (integration/404-page-custom-error/test/index.test.js:31:37)

● Default 404 Page with custom _error › production mode › should render index page normal

TypeError: Invalid URL

  156 | ): Promise<Response> {
  157 |   const url = query ? withQuery(pathname, query) : pathname
> 158 |   return fetch(getFullUrl(appPort, url), opts)
      |               ^
  159 | }
  160 |
  161 | export function renderViaHTTP(

  at parseURL (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1164:12)
  at new Request (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1210:17)
  at ../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1439:19
  at fetch (../node_modules/.pnpm/node-fetch@2.6.7/node_modules/node-fetch/lib/index.js:1437:9)
  at fetchViaHTTP (lib/next-test-utils.ts:158:15)
  at fetchViaHTTP (lib/next-test-utils.ts:167:10)
  at Object.<anonymous> (integration/404-page-custom-error/test/index.test.js:36:37)

● Default 404 Page with custom _error › production mode › should set pages404 in routes-manifest correctly

ENOENT: no such file or directory, open '/root/actions-runner/_work/next.js/next.js/test/integration/404-page-custom-error/.next/routes-manifest.json'

● Default 404 Page with custom _error › production mode › should have output 404.html

ENOENT: no such file or directory, open '/root/actions-runner/_work/next.js/next.js/test/integration/404-page-custom-error/.next/server/pages-manifest.json'

  967 |
  968 | function readJson(path: string) {
> 969 |   return JSON.parse(readFileSync(path, 'utf-8'))
      |                                 ^
  970 | }
  971 |
  972 | export function getBuildManifest(dir: string) {

  at readJson (lib/next-test-utils.ts:969:33)
  at readJson (lib/next-test-utils.ts:1003:10)
  at getPagesManifest (lib/next-test-utils.ts:1013:25)
  at Object.<anonymous> (integration/404-page-custom-error/test/index.test.js:47:48)

Read more about building and testing Next.js in contributing.md.

__NEXT_EXPERIMENTAL_PPR=true pnpm test-start test/e2e/app-dir/app-a11y/index.test.ts (PPR)

  • app a11y features > route announcer > should not announce the initital title
  • app a11y features > route announcer > should announce document.title changes
  • app a11y features > route announcer > should announce h1 changes
  • app a11y features > route announcer > should announce route changes when h1 changes inside an inner layout
Expand output

● app a11y features › route announcer › should not announce the initital title

next build failed with code/signal 1

   97 |           if (code || signal)
   98 |             reject(
>  99 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  100 |             )
  101 |           else resolve()
  102 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:99:15)

● app a11y features › route announcer › should announce document.title changes

next build failed with code/signal 1

   97 |           if (code || signal)
   98 |             reject(
>  99 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  100 |             )
  101 |           else resolve()
  102 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:99:15)

● app a11y features › route announcer › should announce h1 changes

next build failed with code/signal 1

   97 |           if (code || signal)
   98 |             reject(
>  99 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  100 |             )
  101 |           else resolve()
  102 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:99:15)

● app a11y features › route announcer › should announce route changes when h1 changes inside an inner layout

next build failed with code/signal 1

   97 |           if (code || signal)
   98 |             reject(
>  99 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  100 |             )
  101 |           else resolve()
  102 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:99:15)

Read more about building and testing Next.js in contributing.md.

TURBOPACK=1 pnpm test-start test/e2e/app-dir/app-validation/validation.test.ts (turbopack)

  • app dir - validation > should error when passing invalid router state tree
Expand output

● app dir - validation › should error when passing invalid router state tree

next build failed with code/signal 1

   97 |           if (code || signal)
   98 |             reject(
>  99 |               new Error(`next build failed with code/signal ${code || signal}`)
      |               ^
  100 |             )
  101 |           else resolve()
  102 |         })

  at ChildProcess.<anonymous> (lib/next-modes/next-start.ts:99:15)

Read more about building and testing Next.js in contributing.md.

pnpm test-dev test/development/app-dir/dynamic-error-trace/index.test.ts

  • app dir - dynamic error trace > should show the error trace
Expand output

● app dir - dynamic error trace › should show the error trace

thrown: "Exceeded timeout of 120000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  252 |   let next: NextInstance | undefined
  253 |   if (!skipped) {
> 254 |     beforeAll(async () => {
      |     ^
  255 |       next = await createNext(options)
  256 |     })
  257 |     afterAll(async () => {

  at beforeAll (lib/e2e-utils.ts:254:5)
  at development/app-dir/dynamic-error-trace/index.test.ts:11:42
  at Object.describe (development/app-dir/dynamic-error-trace/index.test.ts:10:1)

● Test suite failed to run

thrown: "Exceeded timeout of 120000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  131 |
  132 | if (typeof afterAll === 'function') {
> 133 |   afterAll(async () => {
      |   ^
  134 |     if (nextInstance) {
  135 |       await nextInstance.destroy()
  136 |       throw new Error(

  at Object.afterAll (lib/e2e-utils.ts:133:3)
  at Object.<anonymous> (development/app-dir/dynamic-error-trace/index.test.ts:5:19)

Read more about building and testing Next.js in contributing.md.

pnpm test-dev test/development/acceptance-app/undefined-default-export.test.ts

  • Undefined default export > should error if page component does not have default export
  • Undefined default export > should error if not-found component does not have default export when trigger not-found boundary
  • Undefined default export > should error when page component export is not valid
  • Undefined default export > should error when page component export is not valid on initial load
Expand output

● Undefined default export › should error if page component does not have default export

thrown: "Exceeded timeout of 120000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  252 |   let next: NextInstance | undefined
  253 |   if (!skipped) {
> 254 |     beforeAll(async () => {
      |     ^
  255 |       next = await createNext(options)
  256 |     })
  257 |     afterAll(async () => {

  at beforeAll (lib/e2e-utils.ts:254:5)
  at development/acceptance-app/undefined-default-export.test.ts:6:33
  at Object.describe (development/acceptance-app/undefined-default-export.test.ts:5:1)

● Undefined default export › should error if not-found component does not have default export when trigger not-found boundary

thrown: "Exceeded timeout of 120000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  252 |   let next: NextInstance | undefined
  253 |   if (!skipped) {
> 254 |     beforeAll(async () => {
      |     ^
  255 |       next = await createNext(options)
  256 |     })
  257 |     afterAll(async () => {

  at beforeAll (lib/e2e-utils.ts:254:5)
  at development/acceptance-app/undefined-default-export.test.ts:6:33
  at Object.describe (development/acceptance-app/undefined-default-export.test.ts:5:1)

● Undefined default export › should error when page component export is not valid

thrown: "Exceeded timeout of 120000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  252 |   let next: NextInstance | undefined
  253 |   if (!skipped) {
> 254 |     beforeAll(async () => {
      |     ^
  255 |       next = await createNext(options)
  256 |     })
  257 |     afterAll(async () => {

  at beforeAll (lib/e2e-utils.ts:254:5)
  at development/acceptance-app/undefined-default-export.test.ts:6:33
  at Object.describe (development/acceptance-app/undefined-default-export.test.ts:5:1)

● Undefined default export › should error when page component export is not valid on initial load

thrown: "Exceeded timeout of 120000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  252 |   let next: NextInstance | undefined
  253 |   if (!skipped) {
> 254 |     beforeAll(async () => {
      |     ^
  255 |       next = await createNext(options)
  256 |     })
  257 |     afterAll(async () => {

  at beforeAll (lib/e2e-utils.ts:254:5)
  at development/acceptance-app/undefined-default-export.test.ts:6:33
  at Object.describe (development/acceptance-app/undefined-default-export.test.ts:5:1)

● Test suite failed to run

thrown: "Exceeded timeout of 120000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  131 |
  132 | if (typeof afterAll === 'function') {
> 133 |   afterAll(async () => {
      |   ^
  134 |     if (nextInstance) {
  135 |       await nextInstance.destroy()
  136 |       throw new Error(

  at Object.afterAll (lib/e2e-utils.ts:133:3)
  at Object.<anonymous> (development/acceptance-app/undefined-default-export.test.ts:6:19)

Read more about building and testing Next.js in contributing.md.

pnpm test-dev test/development/acceptance-app/rsc-runtime-errors.test.ts

  • Error overlay - RSC runtime errors > should show runtime errors if invalid client API from node_modules is executed
  • Error overlay - RSC runtime errors > should show runtime errors if invalid server API from node_modules is executed
  • Error overlay - RSC runtime errors > should show source code for jsx errors from server component
  • Error overlay - RSC runtime errors > should show the userland code error trace when fetch failed error occurred
  • Error overlay - RSC runtime errors > should contain nextjs version check in error overlay
  • Error overlay - RSC runtime errors > should not show the bundle layer info in the file trace
Expand output

● Error overlay - RSC runtime errors › should show runtime errors if invalid client API from node_modules is executed

thrown: "Exceeded timeout of 120000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  252 |   let next: NextInstance | undefined
  253 |   if (!skipped) {
> 254 |     beforeAll(async () => {
      |     ^
  255 |       next = await createNext(options)
  256 |     })
  257 |     afterAll(async () => {

  at beforeAll (lib/e2e-utils.ts:254:5)
  at development/acceptance-app/rsc-runtime-errors.test.ts:12:33
  at Object.describe (development/acceptance-app/rsc-runtime-errors.test.ts:11:1)

● Error overlay - RSC runtime errors › should show runtime errors if invalid server API from node_modules is executed

thrown: "Exceeded timeout of 120000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  252 |   let next: NextInstance | undefined
  253 |   if (!skipped) {
> 254 |     beforeAll(async () => {
      |     ^
  255 |       next = await createNext(options)
  256 |     })
  257 |     afterAll(async () => {

  at beforeAll (lib/e2e-utils.ts:254:5)
  at development/acceptance-app/rsc-runtime-errors.test.ts:12:33
  at Object.describe (development/acceptance-app/rsc-runtime-errors.test.ts:11:1)

● Error overlay - RSC runtime errors › should show source code for jsx errors from server component

thrown: "Exceeded timeout of 120000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  252 |   let next: NextInstance | undefined
  253 |   if (!skipped) {
> 254 |     beforeAll(async () => {
      |     ^
  255 |       next = await createNext(options)
  256 |     })
  257 |     afterAll(async () => {

  at beforeAll (lib/e2e-utils.ts:254:5)
  at development/acceptance-app/rsc-runtime-errors.test.ts:12:33
  at Object.describe (development/acceptance-app/rsc-runtime-errors.test.ts:11:1)

● Error overlay - RSC runtime errors › should show the userland code error trace when fetch failed error occurred

thrown: "Exceeded timeout of 120000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  252 |   let next: NextInstance | undefined
  253 |   if (!skipped) {
> 254 |     beforeAll(async () => {
      |     ^
  255 |       next = await createNext(options)
  256 |     })
  257 |     afterAll(async () => {

  at beforeAll (lib/e2e-utils.ts:254:5)
  at development/acceptance-app/rsc-runtime-errors.test.ts:12:33
  at Object.describe (development/acceptance-app/rsc-runtime-errors.test.ts:11:1)

● Error overlay - RSC runtime errors › should contain nextjs version check in error overlay

thrown: "Exceeded timeout of 120000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  252 |   let next: NextInstance | undefined
  253 |   if (!skipped) {
> 254 |     beforeAll(async () => {
      |     ^
  255 |       next = await createNext(options)
  256 |     })
  257 |     afterAll(async () => {

  at beforeAll (lib/e2e-utils.ts:254:5)
  at development/acceptance-app/rsc-runtime-errors.test.ts:12:33
  at Object.describe (development/acceptance-app/rsc-runtime-errors.test.ts:11:1)

● Error overlay - RSC runtime errors › should not show the bundle layer info in the file trace

thrown: "Exceeded timeout of 120000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  252 |   let next: NextInstance | undefined
  253 |   if (!skipped) {
> 254 |     beforeAll(async () => {
      |     ^
  255 |       next = await createNext(options)
  256 |     })
  257 |     afterAll(async () => {

  at beforeAll (lib/e2e-utils.ts:254:5)
  at development/acceptance-app/rsc-runtime-errors.test.ts:12:33
  at Object.describe (development/acceptance-app/rsc-runtime-errors.test.ts:11:1)

● Test suite failed to run

thrown: "Exceeded timeout of 120000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  131 |
  132 | if (typeof afterAll === 'function') {
> 133 |   afterAll(async () => {
      |   ^
  134 |     if (nextInstance) {
  135 |       await nextInstance.destroy()
  136 |       throw new Error(

  at Object.afterAll (lib/e2e-utils.ts:133:3)
  at Object.<anonymous> (development/acceptance-app/rsc-runtime-errors.test.ts:7:19)

Read more about building and testing Next.js in contributing.md.

@samcx
Copy link
Member

samcx commented Jun 27, 2024

@torresgol10 It looks like the tsconfig.json change breaks all the tests :frog-eyes:

@torresgol10
Copy link
Contributor Author

@samcx It's weird, I ran the build and everything worked, I'll investigate what happened and figure out how to fix it.

@torresgol10
Copy link
Contributor Author

@samcx Sorry about that. Right now I don't know how to fix it, I found that it fails in the tests not in the build and it fails in the require-hook.ts in next in the mod.prototype.require function.

I don't know, if you could help me

@ijjk ijjk removed the CI approved Approve running CI for fork label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants