eve 0.33.0 → 0.33.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/src/compiled/.vendor-stamp.json +1 -1
  3. package/dist/src/compiled/@workflow/core/_quickjs-wasi.d.ts +3 -0
  4. package/dist/src/compiled/@workflow/core/events-consumer.d.ts +127 -6
  5. package/dist/src/compiled/@workflow/core/index.js +2 -2
  6. package/dist/src/compiled/@workflow/core/private.d.ts +87 -18
  7. package/dist/src/compiled/@workflow/core/private.js +1 -1
  8. package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +15 -1
  9. package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +116 -8
  10. package/dist/src/compiled/@workflow/core/runtime/quickjs-runtime.d.ts +36 -1
  11. package/dist/src/compiled/@workflow/core/runtime/quickjs-serde.d.ts +107 -0
  12. package/dist/src/compiled/@workflow/core/runtime/replay-budget.d.ts +5 -14
  13. package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +7 -0
  14. package/dist/src/compiled/@workflow/core/runtime/world-compatibility.d.ts +15 -0
  15. package/dist/src/compiled/@workflow/core/runtime.js +3 -3
  16. package/dist/src/compiled/@workflow/core/serialization/codec-devalue-vm.d.ts +7 -0
  17. package/dist/src/compiled/@workflow/core/serialization/workflow-vm.d.ts +8 -3
  18. package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +23 -0
  19. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  20. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  21. package/dist/src/compiled/@workflow/world-local/index.js +5 -5
  22. package/dist/src/compiled/@workflow/world-vercel/index.js +15 -15
  23. package/dist/src/compiled/_chunks/workflow/{attribute-changes-Du5ztewf.js → attribute-changes-6OqdYdi4.js} +2 -2
  24. package/dist/src/compiled/_chunks/workflow/dist-C8PhDW9B.js +1 -0
  25. package/dist/src/compiled/_chunks/workflow/functions-CXb61C6h.js +1 -0
  26. package/dist/src/compiled/_chunks/workflow/{functions-ClJbpZhR.js → functions-xMPAeWFr.js} +1 -1
  27. package/dist/src/compiled/_chunks/workflow/node-Smb57EnG.js +40 -0
  28. package/dist/src/compiled/_chunks/workflow/private-tvMBynnC.js +1 -0
  29. package/dist/src/compiled/_chunks/workflow/resume-hook-BrduAuFX.js +1 -0
  30. package/dist/src/compiled/_chunks/workflow/run-CX7_sJnW.js +1 -0
  31. package/dist/src/compiled/_chunks/workflow/sleep-tsb2HjWK.js +1 -0
  32. package/dist/src/compiled/_chunks/workflow/undici-BNc_0O4m.js +95 -0
  33. package/dist/src/compiled/_chunks/workflow/wait-until-BYKVqrwc.js +15 -0
  34. package/dist/src/compiled/_chunks/workflow/wrapper-CDq65xJV.js +8 -0
  35. package/dist/src/evals/autoevals-client.js +1 -1
  36. package/dist/src/evals/expect/index.js +1 -1
  37. package/dist/src/evals/judge.js +1 -1
  38. package/dist/src/execution/dispatch-runtime-actions-step.d.ts +3 -9
  39. package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
  40. package/dist/src/execution/durable-session-store.d.ts +5 -0
  41. package/dist/src/execution/durable-session-store.js +1 -1
  42. package/dist/src/execution/parked-delivery-wait.d.ts +8 -0
  43. package/dist/src/execution/parked-delivery-wait.js +1 -1
  44. package/dist/src/execution/route-child-delivery.js +1 -1
  45. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  46. package/dist/src/execution/subagent-hitl-proxy.d.ts +1 -0
  47. package/dist/src/execution/subagent-hitl-proxy.js +1 -1
  48. package/dist/src/execution/turn-workflow.js +1 -1
  49. package/dist/src/execution/workflow-entry.js +1 -1
  50. package/dist/src/execution/workflow-steps.d.ts +4 -1
  51. package/dist/src/execution/workflow-steps.js +1 -1
  52. package/dist/src/harness/hitl/approval-input-requests.d.ts +13 -0
  53. package/dist/src/harness/hitl/approval-input-requests.js +1 -0
  54. package/dist/src/harness/hitl/pending-input-resolution.d.ts +51 -0
  55. package/dist/src/harness/hitl/pending-input-resolution.js +1 -0
  56. package/dist/src/harness/hitl/question-input-requests.d.ts +15 -0
  57. package/dist/src/harness/hitl/question-input-requests.js +1 -0
  58. package/dist/src/harness/hitl/session-limit-input-requests.d.ts +10 -0
  59. package/dist/src/harness/hitl/session-limit-input-requests.js +1 -0
  60. package/dist/src/harness/input-requests.d.ts +17 -105
  61. package/dist/src/harness/input-requests.js +1 -1
  62. package/dist/src/harness/pending-input-batches.d.ts +77 -0
  63. package/dist/src/harness/pending-input-batches.js +1 -0
  64. package/dist/src/harness/proxy-input-requests.d.ts +13 -3
  65. package/dist/src/harness/proxy-input-requests.js +1 -1
  66. package/dist/src/harness/session-limit-enforcement.js +1 -1
  67. package/dist/src/harness/tool-loop.js +2 -2
  68. package/dist/src/internal/application/package.js +1 -1
  69. package/dist/src/node_modules/.pnpm/{autoevals@0.0.132_ws@8.21.1_bufferutil@4.1.0_ → autoevals@0.0.132_ws@8.21.3_bufferutil@4.1.0_}/node_modules/autoevals/jsdist/index.js +1 -1
  70. package/dist/src/setup/scaffold/create/project.js +1 -1
  71. package/dist/src/setup/scaffold/create/web-template.d.ts +9 -0
  72. package/dist/src/setup/scaffold/create/web-template.js +291 -1
  73. package/dist/src/setup/scaffold/index.d.ts +1 -1
  74. package/dist/src/setup/scaffold/update/channels.d.ts +4 -13
  75. package/dist/src/setup/scaffold/update/channels.js +2 -2
  76. package/dist/src/setup/scaffold/update/web-options.d.ts +15 -0
  77. package/dist/src/setup/scaffold/update/web-options.js +1 -0
  78. package/dist/src/setup/vercel-project.js +0 -0
  79. package/docs/concepts/sessions-runs-and-streaming.md +4 -4
  80. package/docs/guides/frontend/overview.mdx +31 -10
  81. package/docs/guides/frontend/use-eve-agent-svelte.mdx +37 -15
  82. package/docs/guides/frontend/use-eve-agent-vue.mdx +38 -15
  83. package/docs/tools/human-in-the-loop.md +2 -2
  84. package/package.json +2 -2
  85. package/dist/src/compiled/@workflow/core/correlation-id.d.ts +0 -109
  86. package/dist/src/compiled/@workflow/core/serialization/vm-bundle-entry.d.ts +0 -12
  87. package/dist/src/compiled/_chunks/workflow/dist-CNXUKQCp.js +0 -40
  88. package/dist/src/compiled/_chunks/workflow/env-config-CYoX3muK.js +0 -1
  89. package/dist/src/compiled/_chunks/workflow/private-CiWVdS5v.js +0 -1
  90. package/dist/src/compiled/_chunks/workflow/resume-hook-CT0keOww.js +0 -1
  91. package/dist/src/compiled/_chunks/workflow/run-DBheaFhH.js +0 -1
  92. package/dist/src/compiled/_chunks/workflow/run-id-BdE0MZz9.js +0 -1
  93. package/dist/src/compiled/_chunks/workflow/sleep-BeH4B0Cd.js +0 -1
  94. package/dist/src/compiled/_chunks/workflow/spec-version-C0hBsfu-.js +0 -1
  95. package/dist/src/compiled/_chunks/workflow/undici-CUIybhQ2.js +0 -95
  96. package/dist/src/compiled/_chunks/workflow/wait-until-CMX5LUWJ.js +0 -15
  97. package/dist/src/compiled/_chunks/workflow/wrapper-6mlyNCCb.js +0 -8
  98. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/_vendor/partial-json-parser/parser.js +0 -0
  99. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/auth/workload-identity-auth.js +0 -0
  100. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/azure.js +0 -0
  101. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/client.js +0 -0
  102. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/api-promise.js +0 -0
  103. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/error.js +0 -0
  104. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/pagination.js +0 -0
  105. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/resource.js +0 -0
  106. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/streaming.js +0 -0
  107. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/uploads.js +0 -0
  108. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/error.js +0 -0
  109. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/index.js +0 -0
  110. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/decoders/line.js +0 -0
  111. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/detect-platform.js +0 -0
  112. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/errors.js +0 -0
  113. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/headers.js +0 -0
  114. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/parse.js +0 -0
  115. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/qs/formats.js +0 -0
  116. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/qs/stringify.js +0 -0
  117. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/qs/utils.js +0 -0
  118. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/request-options.js +0 -0
  119. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/shims.js +0 -0
  120. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/to-file.js +0 -0
  121. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/tslib.js +0 -0
  122. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/uploads.js +0 -0
  123. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/base64.js +0 -0
  124. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/bytes.js +0 -0
  125. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/env.js +0 -0
  126. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/log.js +0 -0
  127. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/path.js +0 -0
  128. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/query.js +0 -0
  129. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/sleep.js +0 -0
  130. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/uuid.js +0 -0
  131. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/values.js +0 -0
  132. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils.js +0 -0
  133. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/AbstractChatCompletionRunner.js +0 -0
  134. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/AssistantStream.js +0 -0
  135. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/ChatCompletionRunner.js +0 -0
  136. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/ChatCompletionStream.js +0 -0
  137. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/ChatCompletionStreamingRunner.js +0 -0
  138. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/EventStream.js +0 -0
  139. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/ResponsesParser.js +0 -0
  140. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/RunnableFunction.js +0 -0
  141. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/Util.js +0 -0
  142. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/chatCompletionUtils.js +0 -0
  143. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/parser.js +0 -0
  144. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/responses/ResponseStream.js +0 -0
  145. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/admin.js +0 -0
  146. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/admin-api-keys.js +0 -0
  147. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/audit-logs.js +0 -0
  148. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/certificates.js +0 -0
  149. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/data-retention.js +0 -0
  150. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/groups/groups.js +0 -0
  151. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/groups/roles.js +0 -0
  152. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/groups/users.js +0 -0
  153. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/invites.js +0 -0
  154. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/organization.js +0 -0
  155. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/api-keys.js +0 -0
  156. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/certificates.js +0 -0
  157. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/data-retention.js +0 -0
  158. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/groups/groups.js +0 -0
  159. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/groups/roles.js +0 -0
  160. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.js +0 -0
  161. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/model-permissions.js +0 -0
  162. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/projects.js +0 -0
  163. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/rate-limits.js +0 -0
  164. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/roles.js +0 -0
  165. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/service-accounts.js +0 -0
  166. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/spend-alerts.js +0 -0
  167. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/users/roles.js +0 -0
  168. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/users/users.js +0 -0
  169. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/roles.js +0 -0
  170. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/spend-alerts.js +0 -0
  171. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/usage.js +0 -0
  172. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/users/roles.js +0 -0
  173. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/users/users.js +0 -0
  174. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/audio.js +0 -0
  175. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/speech.js +0 -0
  176. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/transcriptions.js +0 -0
  177. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/translations.js +0 -0
  178. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/batches.js +0 -0
  179. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/assistants.js +0 -0
  180. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/beta.js +0 -0
  181. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/chatkit/chatkit.js +0 -0
  182. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/chatkit/sessions.js +0 -0
  183. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/chatkit/threads.js +0 -0
  184. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/realtime/realtime.js +0 -0
  185. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/realtime/sessions.js +0 -0
  186. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/realtime/transcription-sessions.js +0 -0
  187. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/messages.js +0 -0
  188. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/runs/runs.js +0 -0
  189. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/runs/steps.js +0 -0
  190. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/threads.js +0 -0
  191. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/chat.js +0 -0
  192. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/completions/completions.js +0 -0
  193. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/completions/index.js +0 -0
  194. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/completions/messages.js +0 -0
  195. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/index.js +0 -0
  196. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/completions.js +0 -0
  197. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/containers/containers.js +0 -0
  198. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/containers/files/content.js +0 -0
  199. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/containers/files/files.js +0 -0
  200. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/conversations/conversations.js +0 -0
  201. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/conversations/items.js +0 -0
  202. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/embeddings.js +0 -0
  203. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/evals/evals.js +0 -0
  204. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/evals/runs/output-items.js +0 -0
  205. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/evals/runs/runs.js +0 -0
  206. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/files.js +0 -0
  207. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/alpha/alpha.js +0 -0
  208. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/alpha/graders.js +0 -0
  209. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.js +0 -0
  210. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/checkpoints/permissions.js +0 -0
  211. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/fine-tuning.js +0 -0
  212. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/jobs/checkpoints.js +0 -0
  213. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/jobs/jobs.js +0 -0
  214. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/methods.js +0 -0
  215. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/graders/grader-models.js +0 -0
  216. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/graders/graders.js +0 -0
  217. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/images.js +0 -0
  218. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/index.js +0 -0
  219. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/models.js +0 -0
  220. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/moderations.js +0 -0
  221. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/realtime/calls.js +0 -0
  222. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/realtime/client-secrets.js +0 -0
  223. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/realtime/realtime.js +0 -0
  224. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/responses/input-items.js +0 -0
  225. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/responses/input-tokens.js +0 -0
  226. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/responses/responses.js +0 -0
  227. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/shared.js +0 -0
  228. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/skills/content.js +0 -0
  229. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/skills/skills.js +0 -0
  230. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/skills/versions/content.js +0 -0
  231. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/skills/versions/versions.js +0 -0
  232. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/uploads/parts.js +0 -0
  233. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/uploads/uploads.js +0 -0
  234. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/vector-stores/file-batches.js +0 -0
  235. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/vector-stores/files.js +0 -0
  236. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/vector-stores/vector-stores.js +0 -0
  237. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/videos.js +0 -0
  238. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/webhooks/index.js +0 -0
  239. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/webhooks/webhooks.js +0 -0
  240. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/webhooks.js +0 -0
  241. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/streaming.js +0 -0
  242. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76 → openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/version.js +0 -0
@@ -1,34 +1,34 @@
1
- import{i as e,n as t,o as n,r,t as i}from"../../_chunks/workflow/rolldown-runtime-DaDcL9Zw.js";import{E as a,O as o,_ as s,c,d as l,g as u,o as d,r as f}from"../../_chunks/workflow/dist-CRTn4Sg8.js";import{$ as p,$a as m,$c as h,$i as g,$n as _,$o as v,$r as y,$s as b,$t as ee,Aa as te,Ac as ne,Ai as re,An as ie,Ao as ae,Ar as oe,As as se,At as ce,Ba as le,Bc as ue,Bi as de,Bn as fe,Bo as pe,Br as me,Bs as he,Bt as ge,C as _e,Ca as ve,Cc as ye,Ci as be,Cl as xe,Cn as Se,Co as Ce,Cr as we,Cs as Te,Ct as Ee,D as De,Da as Oe,Dc as ke,Di as Ae,Dn as je,Do as Me,Dr as Ne,Ds as Pe,Dt as Fe,E as Ie,Ea as Le,Ec as Re,Ei as ze,En as Be,Eo as Ve,Er as He,Es as Ue,Et as We,Fa as Ge,Fc as Ke,Fi as qe,Fn as Je,Fo as Ye,Fr as Xe,Fs as Ze,Ft as Qe,Ga as $e,Gc as et,Gi as tt,Gn as nt,Go as rt,Gr as it,Gs as at,Gt as ot,Ha as st,Hc as ct,Hi as lt,Hn as ut,Ho as dt,Hr as ft,Hs as pt,Ht as mt,I as ht,Ia as gt,Ic as _t,Ii as vt,In as yt,Io as bt,Ir as xt,Is as St,It as Ct,Ja as wt,Jc as Tt,Ji as Et,Jn as Dt,Jo as Ot,Jr as kt,Js as At,Jt as jt,K as Mt,Ka as Nt,Kc as Pt,Ki as Ft,Kn as It,Ko as Lt,Kr as Rt,Ks as zt,Kt as Bt,L as Vt,La as Ht,Lc as Ut,Li as Wt,Ln as Gt,Lo as Kt,Lr as qt,Ls as Jt,Lt as Yt,M as Xt,Ma as Zt,Mc as Qt,Mi as $t,Mn as en,Mo as tn,Mr as nn,Ms as rn,Mt as an,N as on,Na as sn,Nc as cn,Ni as ln,Nn as un,No as dn,Nr as fn,Ns as pn,Nt as mn,Oa as hn,Oc as gn,Oi as _n,On as vn,Oo as yn,Or as bn,Os as xn,Ot as Sn,Pa as Cn,Pc as wn,Pi as Tn,Pn as En,Po as Dn,Pr as On,Ps as kn,Pt as An,Qa as jn,Qc as Mn,Qi as Nn,Qn as Pn,Qo as Fn,Qr as In,Qs as Ln,Qt as Rn,R as zn,Ra as Bn,Rc as Vn,Ri as Hn,Rn as Un,Ro as Wn,Rr as Gn,Rs as Kn,Rt as qn,S as Jn,Sa as Yn,Sc as Xn,Si as Zn,Sl as Qn,Sn as $n,So as er,Sr as tr,Ss as nr,St as rr,T as ir,Ta as ar,Tc as or,Ti as sr,Tn as cr,To as lr,Tr as ur,Ts as dr,Tt as fr,Ua as pr,Uc as mr,Ui as hr,Un as gr,Uo as _r,Ur as vr,Us as yr,Ut as br,V as xr,Va as Sr,Vc as Cr,Vi as wr,Vn as Tr,Vo as Er,Vr as Dr,Vs as Or,Vt as kr,Wa as Ar,Wc as jr,Wi as Mr,Wn as Nr,Wo as Pr,Wr as Fr,Ws as Ir,Wt as Lr,Xa as Rr,Xc as zr,Xi as Br,Xn as Vr,Xo as Hr,Xr as Ur,Xs as Wr,Xt as Gr,Ya as Kr,Yc as qr,Yi as Jr,Yn as Yr,Yo as Xr,Yr as Zr,Ys as Qr,Yt as $r,Z as ei,Za as ti,Zc as ni,Zi as ri,Zn as ii,Zo as ai,Zr as oi,Zs as si,Zt as ci,_ as li,_a as ui,_c as di,_i as fi,_l as pi,_n as mi,_o as hi,_r as gi,_s as _i,_t as vi,aa as yi,ac as bi,ai as xi,al as Si,an as Ci,ao as wi,ar as Ti,as as Ei,at as Di,ba as Oi,bc as ki,bi as Ai,bl as ji,bn as Mi,bo as Ni,br as Pi,bs as Fi,bt as Ii,c as Li,ca as Ri,cc as zi,ci as Bi,cl as Vi,cn as Hi,co as Ui,cr as Wi,cs as Gi,ct as Ki,d as qi,da as Ji,dc as Yi,di as Xi,dl as Zi,dn as Qi,do as $i,dr as ea,ds as ta,dt as na,ea as ra,ec as ia,ei as aa,el as oa,en as sa,eo as ca,er as la,es as ua,fa as da,fc as fa,fi as pa,fl as ma,fn as ha,fo as ga,fr as _a,fs as va,ft as ya,g as ba,ga as xa,gc as Sa,gi as Ca,gl as x,gn as wa,go as Ta,gr as Ea,gs as Da,gt as Oa,h as ka,ha as Aa,hc as ja,hi as Ma,hl as S,hn as Na,ho as Pa,hr as Fa,hs as Ia,ht as La,ia as Ra,ic as za,ii as Ba,il as Va,in as Ha,io as Ua,ir as Wa,is as Ga,it as Ka,j as qa,ja as Ja,jc as Ya,ji as Xa,jn as Za,jo as Qa,jr as $a,js as eo,jt as to,k as no,ka as ro,kc as io,ki as ao,kn as oo,ko as so,kr as co,ks as lo,kt as uo,la as fo,lc as po,li as mo,ll as ho,ln as go,lo as _o,lr as vo,ls as yo,lt as bo,ma as xo,mc as So,mi as Co,ml as C,mn as wo,mo as To,mr as Eo,ms as Do,mt as Oo,na as ko,nc as Ao,ni as jo,nl as Mo,nn as No,no as Po,nr as Fo,ns as Io,nt as Lo,oa as Ro,oc as zo,oi as Bo,ol as Vo,on as Ho,oo as Uo,or as Wo,os as Go,ot as Ko,p as qo,pa as Jo,pc as Yo,pi as Xo,pl as Zo,pn as Qo,po as $o,pr as es,ps as ts,pt as ns,q as rs,qa as is,qc as as,qi as os,qn as ss,qo as cs,qr as ls,qs as us,qt as ds,r as fs,ra as ps,rc as ms,ri as hs,rl as gs,rn as _s,ro as vs,rr as ys,rs as bs,rt as xs,sa as Ss,sc as Cs,si as ws,sl as Ts,sn as Es,so as Ds,sr as Os,ss as ks,st as As,ta as js,tc as Ms,ti as Ns,tl as Ps,tn as Fs,to as Is,tr as Ls,ts as Rs,u as zs,ua as Bs,uc as Vs,ui as Hs,ul as Us,un as Ws,uo as Gs,ur as Ks,us as qs,ut as Js,va as Ys,vc as Xs,vi as Zs,vl as Qs,vn as $s,vo as ec,vr as tc,vs as nc,vt as rc,w as ic,wa as ac,wc as oc,wi as sc,wl as cc,wn as lc,wo as uc,wr as dc,ws as fc,wt as pc,xa as mc,xc as hc,xi as gc,xl as _c,xn as vc,xo as yc,xr as bc,xs as xc,xt as Sc,ya as Cc,yc as wc,yi as Tc,yl as Ec,yn as Dc,yo as Oc,yr as kc,ys as Ac,yt as jc,z as Mc,za as Nc,zc as Pc,zi as Fc,zn as Ic,zo as Lc,zr as Rc,zs as zc,zt as Bc}from"../../_chunks/workflow/dist-CNXUKQCp.js";import{t as Vc}from"../../_chunks/workflow/env-config-CYoX3muK.js";import{a as Hc,i as Uc,n as Wc,o as Gc,r as Kc,s as qc,t as Jc}from"../../_chunks/workflow/run-id-BdE0MZz9.js";import{t as Yc}from"../../_chunks/workflow/undici-CUIybhQ2.js";import{n as Xc,r as Zc,t as Qc}from"../../_chunks/workflow/token-util-Ldar52H7.js";import{i as $c,r as el,t as tl}from"../../_chunks/workflow/token-util-DNwIAn_u.js";import{createRequire as nl}from"module";import*as rl from"path";import*as il from"node:crypto";import{KeyObject as al,constants as ol,createCipheriv as sl,createDecipheriv as cl,createHash as ll,createHmac as ul,createPrivateKey as dl,createPublicKey as fl,createSecretKey as pl,diffieHellman as ml,generateKeyPair as hl,getCiphers as gl,pbkdf2 as _l,privateDecrypt as vl,publicEncrypt as yl,randomFillSync as bl,timingSafeEqual as xl,webcrypto as Sl}from"node:crypto";import*as Cl from"node:util";import{deprecate as wl,inspect as Tl,promisify as El}from"node:util";import{AsyncLocalStorage as Dl}from"node:async_hooks";import Ol from"node:os";import*as kl from"node:http";import{once as Al}from"node:events";import{Buffer as jl}from"node:buffer";import*as Ml from"fs";import*as Nl from"net";import*as Pl from"node:https";const Fl=()=>{let e={string:{unit:`حرف`,verb:`أن يحوي`},file:{unit:`بايت`,verb:`أن يحوي`},array:{unit:`عنصر`,verb:`أن يحوي`},set:{unit:`عنصر`,verb:`أن يحوي`}};function t(t){return e[t]??null}let n={regex:`مدخل`,email:`بريد إلكتروني`,url:`رابط`,emoji:`إيموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاريخ ووقت بمعيار ISO`,date:`تاريخ بمعيار ISO`,time:`وقت بمعيار ISO`,duration:`مدة بمعيار ISO`,ipv4:`عنوان IPv4`,ipv6:`عنوان IPv6`,cidrv4:`مدى عناوين بصيغة IPv4`,cidrv6:`مدى عناوين بصيغة IPv6`,base64:`نَص بترميز base64-encoded`,base64url:`نَص بترميز base64url-encoded`,json_string:`نَص على هيئة JSON`,e164:`رقم هاتف بمعيار E.164`,jwt:`JWT`,template_literal:`مدخل`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${e.expected}، ولكن تم إدخال ${i}`:`مدخلات غير مقبولة: يفترض إدخال ${t}، ولكن تم إدخال ${i}`}case`invalid_value`:return e.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${x(e.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?` أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()} ${r.unit??`عنصر`}`:`أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()} ${r.unit}`:`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`نَص غير مقبول: يجب أن يبدأ بـ "${e.prefix}"`:t.format===`ends_with`?`نَص غير مقبول: يجب أن ينتهي بـ "${t.suffix}"`:t.format===`includes`?`نَص غير مقبول: يجب أن يتضمَّن "${t.includes}"`:t.format===`regex`?`نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}`:`${n[t.format]??e.format} غير مقبول`}case`not_multiple_of`:return`رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`;case`unrecognized_keys`:return`معرف${e.keys.length>1?`ات`:``} غريب${e.keys.length>1?`ة`:``}: ${C(e.keys,`، `)}`;case`invalid_key`:return`معرف غير مقبول في ${e.origin}`;case`invalid_union`:return`مدخل غير مقبول`;case`invalid_element`:return`مدخل غير مقبول في ${e.origin}`;default:return`مدخل غير مقبول`}}};function Il(){return{localeError:Fl()}}const Ll=()=>{let e={string:{unit:`simvol`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`element`,verb:`olmalıdır`},set:{unit:`element`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Yanlış dəyər: gözlənilən instanceof ${e.expected}, daxil olan ${i}`:`Yanlış dəyər: gözlənilən ${t}, daxil olan ${i}`}case`invalid_value`:return e.values.length===1?`Yanlış dəyər: gözlənilən ${x(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()} ${r.unit??`element`}`:`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Yanlış mətn: "${t.prefix}" ilə başlamalıdır`:t.format===`ends_with`?`Yanlış mətn: "${t.suffix}" ilə bitməlidir`:t.format===`includes`?`Yanlış mətn: "${t.includes}" daxil olmalıdır`:t.format===`regex`?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${n[t.format]??e.format}`}case`not_multiple_of`:return`Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`;case`unrecognized_keys`:return`Tanınmayan açar${e.keys.length>1?`lar`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} daxilində yanlış açar`;case`invalid_union`:return`Yanlış dəyər`;case`invalid_element`:return`${e.origin} daxilində yanlış dəyər`;default:return`Yanlış dəyər`}}};function Rl(){return{localeError:Ll()}}function zl(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}const Bl=()=>{let e={string:{unit:{one:`сімвал`,few:`сімвалы`,many:`сімвалаў`},verb:`мець`},array:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},set:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},file:{unit:{one:`байт`,few:`байты`,many:`байтаў`},verb:`мець`}};function t(t){return e[t]??null}let n={regex:`увод`,email:`email адрас`,url:`URL`,emoji:`эмодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата і час`,date:`ISO дата`,time:`ISO час`,duration:`ISO працягласць`,ipv4:`IPv4 адрас`,ipv6:`IPv6 адрас`,cidrv4:`IPv4 дыяпазон`,cidrv6:`IPv6 дыяпазон`,base64:`радок у фармаце base64`,base64url:`радок у фармаце base64url`,json_string:`JSON радок`,e164:`нумар E.164`,jwt:`JWT`,template_literal:`увод`},r={nan:`NaN`,number:`лік`,array:`масіў`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Няправільны ўвод: чакаўся instanceof ${e.expected}, атрымана ${i}`:`Няправільны ўвод: чакаўся ${t}, атрымана ${i}`}case`invalid_value`:return e.values.length===1?`Няправільны ўвод: чакалася ${x(e.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=zl(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна ${r.verb} ${n}${e.maximum.toString()} ${t}`}return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна быць ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=zl(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Занадта малы: чакалася, што ${e.origin} павінна ${r.verb} ${n}${e.minimum.toString()} ${t}`}return`Занадта малы: чакалася, што ${e.origin} павінна быць ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Няправільны радок: павінен пачынацца з "${t.prefix}"`:t.format===`ends_with`?`Няправільны радок: павінен заканчвацца на "${t.suffix}"`:t.format===`includes`?`Няправільны радок: павінен змяшчаць "${t.includes}"`:t.format===`regex`?`Няправільны радок: павінен адпавядаць шаблону ${t.pattern}`:`Няправільны ${n[t.format]??e.format}`}case`not_multiple_of`:return`Няправільны лік: павінен быць кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспазнаны ${e.keys.length>1?`ключы`:`ключ`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Няправільны ключ у ${e.origin}`;case`invalid_union`:return`Няправільны ўвод`;case`invalid_element`:return`Няправільнае значэнне ў ${e.origin}`;default:return`Няправільны ўвод`}}};function Vl(){return{localeError:Bl()}}const Hl=()=>{let e={string:{unit:`символа`,verb:`да съдържа`},file:{unit:`байта`,verb:`да съдържа`},array:{unit:`елемента`,verb:`да съдържа`},set:{unit:`елемента`,verb:`да съдържа`}};function t(t){return e[t]??null}let n={regex:`вход`,email:`имейл адрес`,url:`URL`,emoji:`емоджи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO време`,date:`ISO дата`,time:`ISO време`,duration:`ISO продължителност`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`base64-кодиран низ`,base64url:`base64url-кодиран низ`,json_string:`JSON низ`,e164:`E.164 номер`,jwt:`JWT`,template_literal:`вход`},r={nan:`NaN`,number:`число`,array:`масив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Невалиден вход: очакван instanceof ${e.expected}, получен ${i}`:`Невалиден вход: очакван ${t}, получен ${i}`}case`invalid_value`:return e.values.length===1?`Невалиден вход: очакван ${x(e.values[0])}`:`Невалидна опция: очаквано едно от ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Твърде голямо: очаква се ${e.origin??`стойност`} да съдържа ${n}${e.maximum.toString()} ${r.unit??`елемента`}`:`Твърде голямо: очаква се ${e.origin??`стойност`} да бъде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Твърде малко: очаква се ${e.origin} да съдържа ${n}${e.minimum.toString()} ${r.unit}`:`Твърде малко: очаква се ${e.origin} да бъде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;if(t.format===`starts_with`)return`Невалиден низ: трябва да започва с "${t.prefix}"`;if(t.format===`ends_with`)return`Невалиден низ: трябва да завършва с "${t.suffix}"`;if(t.format===`includes`)return`Невалиден низ: трябва да включва "${t.includes}"`;if(t.format===`regex`)return`Невалиден низ: трябва да съвпада с ${t.pattern}`;let r=`Невалиден`;return t.format===`emoji`&&(r=`Невалидно`),t.format===`datetime`&&(r=`Невалидно`),t.format===`date`&&(r=`Невалидна`),t.format===`time`&&(r=`Невалидно`),t.format===`duration`&&(r=`Невалидна`),`${r} ${n[t.format]??e.format}`}case`not_multiple_of`:return`Невалидно число: трябва да бъде кратно на ${e.divisor}`;case`unrecognized_keys`:return`Неразпознат${e.keys.length>1?`и`:``} ключ${e.keys.length>1?`ове`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Невалиден ключ в ${e.origin}`;case`invalid_union`:return`Невалиден вход`;case`invalid_element`:return`Невалидна стойност в ${e.origin}`;default:return`Невалиден вход`}}};function Ul(){return{localeError:Hl()}}const Wl=()=>{let e={string:{unit:`caràcters`,verb:`contenir`},file:{unit:`bytes`,verb:`contenir`},array:{unit:`elements`,verb:`contenir`},set:{unit:`elements`,verb:`contenir`}};function t(t){return e[t]??null}let n={regex:`entrada`,email:`adreça electrònica`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`durada ISO`,ipv4:`adreça IPv4`,ipv6:`adreça IPv6`,cidrv4:`rang IPv4`,cidrv6:`rang IPv6`,base64:`cadena codificada en base64`,base64url:`cadena codificada en base64url`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Tipus invàlid: s'esperava instanceof ${e.expected}, s'ha rebut ${i}`:`Tipus invàlid: s'esperava ${t}, s'ha rebut ${i}`}case`invalid_value`:return e.values.length===1?`Valor invàlid: s'esperava ${x(e.values[0])}`:`Opció invàlida: s'esperava una de ${C(e.values,` o `)}`;case`too_big`:{let n=e.inclusive?`com a màxim`:`menys de`,r=t(e.origin);return r?`Massa gran: s'esperava que ${e.origin??`el valor`} contingués ${n} ${e.maximum.toString()} ${r.unit??`elements`}`:`Massa gran: s'esperava que ${e.origin??`el valor`} fos ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`com a mínim`:`més de`,r=t(e.origin);return r?`Massa petit: s'esperava que ${e.origin} contingués ${n} ${e.minimum.toString()} ${r.unit}`:`Massa petit: s'esperava que ${e.origin} fos ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Format invàlid: ha de començar amb "${t.prefix}"`:t.format===`ends_with`?`Format invàlid: ha d'acabar amb "${t.suffix}"`:t.format===`includes`?`Format invàlid: ha d'incloure "${t.includes}"`:t.format===`regex`?`Format invàlid: ha de coincidir amb el patró ${t.pattern}`:`Format invàlid per a ${n[t.format]??e.format}`}case`not_multiple_of`:return`Número invàlid: ha de ser múltiple de ${e.divisor}`;case`unrecognized_keys`:return`Clau${e.keys.length>1?`s`:``} no reconeguda${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Clau invàlida a ${e.origin}`;case`invalid_union`:return`Entrada invàlida`;case`invalid_element`:return`Element invàlid a ${e.origin}`;default:return`Entrada invàlida`}}};function Gl(){return{localeError:Wl()}}const Kl=()=>{let e={string:{unit:`znaků`,verb:`mít`},file:{unit:`bajtů`,verb:`mít`},array:{unit:`prvků`,verb:`mít`},set:{unit:`prvků`,verb:`mít`}};function t(t){return e[t]??null}let n={regex:`regulární výraz`,email:`e-mailová adresa`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`datum a čas ve formátu ISO`,date:`datum ve formátu ISO`,time:`čas ve formátu ISO`,duration:`doba trvání ISO`,ipv4:`IPv4 adresa`,ipv6:`IPv6 adresa`,cidrv4:`rozsah IPv4`,cidrv6:`rozsah IPv6`,base64:`řetězec zakódovaný ve formátu base64`,base64url:`řetězec zakódovaný ve formátu base64url`,json_string:`řetězec ve formátu JSON`,e164:`číslo E.164`,jwt:`JWT`,template_literal:`vstup`},r={nan:`NaN`,number:`číslo`,string:`řetězec`,function:`funkce`,array:`pole`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neplatný vstup: očekáváno instanceof ${e.expected}, obdrženo ${i}`:`Neplatný vstup: očekáváno ${t}, obdrženo ${i}`}case`invalid_value`:return e.values.length===1?`Neplatný vstup: očekáváno ${x(e.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Hodnota je příliš velká: ${e.origin??`hodnota`} musí mít ${n}${e.maximum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš velká: ${e.origin??`hodnota`} musí být ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Hodnota je příliš malá: ${e.origin??`hodnota`} musí mít ${n}${e.minimum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš malá: ${e.origin??`hodnota`} musí být ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neplatný řetězec: musí začínat na "${t.prefix}"`:t.format===`ends_with`?`Neplatný řetězec: musí končit na "${t.suffix}"`:t.format===`includes`?`Neplatný řetězec: musí obsahovat "${t.includes}"`:t.format===`regex`?`Neplatný řetězec: musí odpovídat vzoru ${t.pattern}`:`Neplatný formát ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neplatné číslo: musí být násobkem ${e.divisor}`;case`unrecognized_keys`:return`Neznámé klíče: ${C(e.keys,`, `)}`;case`invalid_key`:return`Neplatný klíč v ${e.origin}`;case`invalid_union`:return`Neplatný vstup`;case`invalid_element`:return`Neplatná hodnota v ${e.origin}`;default:return`Neplatný vstup`}}};function ql(){return{localeError:Kl()}}const Jl=()=>{let e={string:{unit:`tegn`,verb:`havde`},file:{unit:`bytes`,verb:`havde`},array:{unit:`elementer`,verb:`indeholdt`},set:{unit:`elementer`,verb:`indeholdt`}};function t(t){return e[t]??null}let n={regex:`input`,email:`e-mailadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslæt`,date:`ISO-dato`,time:`ISO-klokkeslæt`,duration:`ISO-varighed`,ipv4:`IPv4-område`,ipv6:`IPv6-område`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodet streng`,base64url:`base64url-kodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,string:`streng`,number:`tal`,boolean:`boolean`,array:`liste`,object:`objekt`,set:`sæt`,file:`fil`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldigt input: forventede instanceof ${e.expected}, fik ${i}`:`Ugyldigt input: forventede ${t}, fik ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig værdi: forventede ${x(e.values[0])}`:`Ugyldigt valg: forventede en af følgende ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`For stor: forventede ${a??`value`} ${i.verb} ${n} ${e.maximum.toString()} ${i.unit??`elementer`}`:`For stor: forventede ${a??`value`} havde ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`For lille: forventede ${a} ${i.verb} ${n} ${e.minimum.toString()} ${i.unit}`:`For lille: forventede ${a} havde ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: skal starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: skal ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: skal indeholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: skal matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldigt tal: skal være deleligt med ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukendte nøgler`:`Ukendt nøgle`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøgle i ${e.origin}`;case`invalid_union`:return`Ugyldigt input: matcher ingen af de tilladte typer`;case`invalid_element`:return`Ugyldig værdi i ${e.origin}`;default:return`Ugyldigt input`}}};function Yl(){return{localeError:Jl()}}const Xl=()=>{let e={string:{unit:`Zeichen`,verb:`zu haben`},file:{unit:`Bytes`,verb:`zu haben`},array:{unit:`Elemente`,verb:`zu haben`},set:{unit:`Elemente`,verb:`zu haben`}};function t(t){return e[t]??null}let n={regex:`Eingabe`,email:`E-Mail-Adresse`,url:`URL`,emoji:`Emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-Datum und -Uhrzeit`,date:`ISO-Datum`,time:`ISO-Uhrzeit`,duration:`ISO-Dauer`,ipv4:`IPv4-Adresse`,ipv6:`IPv6-Adresse`,cidrv4:`IPv4-Bereich`,cidrv6:`IPv6-Bereich`,base64:`Base64-codierter String`,base64url:`Base64-URL-codierter String`,json_string:`JSON-String`,e164:`E.164-Nummer`,jwt:`JWT`,template_literal:`Eingabe`},r={nan:`NaN`,number:`Zahl`,array:`Array`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ungültige Eingabe: erwartet instanceof ${e.expected}, erhalten ${i}`:`Ungültige Eingabe: erwartet ${t}, erhalten ${i}`}case`invalid_value`:return e.values.length===1?`Ungültige Eingabe: erwartet ${x(e.values[0])}`:`Ungültige Option: erwartet eine von ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ${r.unit??`Elemente`} hat`:`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ist`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ${r.unit} hat`:`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ist`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ungültiger String: muss mit "${t.prefix}" beginnen`:t.format===`ends_with`?`Ungültiger String: muss mit "${t.suffix}" enden`:t.format===`includes`?`Ungültiger String: muss "${t.includes}" enthalten`:t.format===`regex`?`Ungültiger String: muss dem Muster ${t.pattern} entsprechen`:`Ungültig: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ungültige Zahl: muss ein Vielfaches von ${e.divisor} sein`;case`unrecognized_keys`:return`${e.keys.length>1?`Unbekannte Schlüssel`:`Unbekannter Schlüssel`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Ungültiger Schlüssel in ${e.origin}`;case`invalid_union`:return`Ungültige Eingabe`;case`invalid_element`:return`Ungültiger Wert in ${e.origin}`;default:return`Ungültige Eingabe`}}};function Zl(){return{localeError:Xl()}}const Ql=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input);return`Invalid input: expected ${t}, received ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`Invalid input: expected ${x(e.values[0])}`:`Invalid option: expected one of ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function $l(){return{localeError:Ql()}}const eu=()=>{let e={string:{unit:`karaktrojn`,verb:`havi`},file:{unit:`bajtojn`,verb:`havi`},array:{unit:`elementojn`,verb:`havi`},set:{unit:`elementojn`,verb:`havi`}};function t(t){return e[t]??null}let n={regex:`enigo`,email:`retadreso`,url:`URL`,emoji:`emoĝio`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datotempo`,date:`ISO-dato`,time:`ISO-tempo`,duration:`ISO-daŭro`,ipv4:`IPv4-adreso`,ipv6:`IPv6-adreso`,cidrv4:`IPv4-rango`,cidrv6:`IPv6-rango`,base64:`64-ume kodita karaktraro`,base64url:`URL-64-ume kodita karaktraro`,json_string:`JSON-karaktraro`,e164:`E.164-nombro`,jwt:`JWT`,template_literal:`enigo`},r={nan:`NaN`,number:`nombro`,array:`tabelo`,null:`senvalora`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Nevalida enigo: atendiĝis instanceof ${e.expected}, riceviĝis ${i}`:`Nevalida enigo: atendiĝis ${t}, riceviĝis ${i}`}case`invalid_value`:return e.values.length===1?`Nevalida enigo: atendiĝis ${x(e.values[0])}`:`Nevalida opcio: atendiĝis unu el ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()} ${r.unit??`elementojn`}`:`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Tro malgranda: atendiĝis ke ${e.origin} havu ${n}${e.minimum.toString()} ${r.unit}`:`Tro malgranda: atendiĝis ke ${e.origin} estu ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nevalida karaktraro: devas komenciĝi per "${t.prefix}"`:t.format===`ends_with`?`Nevalida karaktraro: devas finiĝi per "${t.suffix}"`:t.format===`includes`?`Nevalida karaktraro: devas inkluzivi "${t.includes}"`:t.format===`regex`?`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`:`Nevalida ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nevalida nombro: devas esti oblo de ${e.divisor}`;case`unrecognized_keys`:return`Nekonata${e.keys.length>1?`j`:``} ŝlosilo${e.keys.length>1?`j`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Nevalida ŝlosilo en ${e.origin}`;case`invalid_union`:return`Nevalida enigo`;case`invalid_element`:return`Nevalida valoro en ${e.origin}`;default:return`Nevalida enigo`}}};function tu(){return{localeError:eu()}}const nu=()=>{let e={string:{unit:`caracteres`,verb:`tener`},file:{unit:`bytes`,verb:`tener`},array:{unit:`elementos`,verb:`tener`},set:{unit:`elementos`,verb:`tener`}};function t(t){return e[t]??null}let n={regex:`entrada`,email:`dirección de correo electrónico`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`fecha y hora ISO`,date:`fecha ISO`,time:`hora ISO`,duration:`duración ISO`,ipv4:`dirección IPv4`,ipv6:`dirección IPv6`,cidrv4:`rango IPv4`,cidrv6:`rango IPv6`,base64:`cadena codificada en base64`,base64url:`URL codificada en base64`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`},r={nan:`NaN`,string:`texto`,number:`número`,boolean:`booleano`,array:`arreglo`,object:`objeto`,set:`conjunto`,file:`archivo`,date:`fecha`,bigint:`número grande`,symbol:`símbolo`,undefined:`indefinido`,null:`nulo`,function:`función`,map:`mapa`,record:`registro`,tuple:`tupla`,enum:`enumeración`,union:`unión`,literal:`literal`,promise:`promesa`,void:`vacío`,never:`nunca`,unknown:`desconocido`,any:`cualquiera`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrada inválida: se esperaba instanceof ${e.expected}, recibido ${i}`:`Entrada inválida: se esperaba ${t}, recibido ${i}`}case`invalid_value`:return e.values.length===1?`Entrada inválida: se esperaba ${x(e.values[0])}`:`Opción inválida: se esperaba una de ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Demasiado grande: se esperaba que ${a??`valor`} tuviera ${n}${e.maximum.toString()} ${i.unit??`elementos`}`:`Demasiado grande: se esperaba que ${a??`valor`} fuera ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Demasiado pequeño: se esperaba que ${a} tuviera ${n}${e.minimum.toString()} ${i.unit}`:`Demasiado pequeño: se esperaba que ${a} fuera ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Cadena inválida: debe comenzar con "${t.prefix}"`:t.format===`ends_with`?`Cadena inválida: debe terminar en "${t.suffix}"`:t.format===`includes`?`Cadena inválida: debe incluir "${t.includes}"`:t.format===`regex`?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${n[t.format]??e.format}`}case`not_multiple_of`:return`Número inválido: debe ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Llave${e.keys.length>1?`s`:``} desconocida${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Llave inválida en ${r[e.origin]??e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido en ${r[e.origin]??e.origin}`;default:return`Entrada inválida`}}};function ru(){return{localeError:nu()}}const iu=()=>{let e={string:{unit:`کاراکتر`,verb:`داشته باشد`},file:{unit:`بایت`,verb:`داشته باشد`},array:{unit:`آیتم`,verb:`داشته باشد`},set:{unit:`آیتم`,verb:`داشته باشد`}};function t(t){return e[t]??null}let n={regex:`ورودی`,email:`آدرس ایمیل`,url:`URL`,emoji:`ایموجی`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاریخ و زمان ایزو`,date:`تاریخ ایزو`,time:`زمان ایزو`,duration:`مدت زمان ایزو`,ipv4:`IPv4 آدرس`,ipv6:`IPv6 آدرس`,cidrv4:`IPv4 دامنه`,cidrv6:`IPv6 دامنه`,base64:`base64-encoded رشته`,base64url:`base64url-encoded رشته`,json_string:`JSON رشته`,e164:`E.164 عدد`,jwt:`JWT`,template_literal:`ورودی`},r={nan:`NaN`,number:`عدد`,array:`آرایه`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ورودی نامعتبر: می‌بایست instanceof ${e.expected} می‌بود، ${i} دریافت شد`:`ورودی نامعتبر: می‌بایست ${t} می‌بود، ${i} دریافت شد`}case`invalid_value`:return e.values.length===1?`ورودی نامعتبر: می‌بایست ${x(e.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${C(e.values,`|`)} می‌بود`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصر`} باشد`:`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} باشد`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} باشد`:`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} باشد`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`رشته نامعتبر: باید با "${t.prefix}" شروع شود`:t.format===`ends_with`?`رشته نامعتبر: باید با "${t.suffix}" تمام شود`:t.format===`includes`?`رشته نامعتبر: باید شامل "${t.includes}" باشد`:t.format===`regex`?`رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد`:`${n[t.format]??e.format} نامعتبر`}case`not_multiple_of`:return`عدد نامعتبر: باید مضرب ${e.divisor} باشد`;case`unrecognized_keys`:return`کلید${e.keys.length>1?`های`:``} ناشناس: ${C(e.keys,`, `)}`;case`invalid_key`:return`کلید ناشناس در ${e.origin}`;case`invalid_union`:return`ورودی نامعتبر`;case`invalid_element`:return`مقدار نامعتبر در ${e.origin}`;default:return`ورودی نامعتبر`}}};function au(){return{localeError:iu()}}const ou=()=>{let e={string:{unit:`merkkiä`,subject:`merkkijonon`},file:{unit:`tavua`,subject:`tiedoston`},array:{unit:`alkiota`,subject:`listan`},set:{unit:`alkiota`,subject:`joukon`},number:{unit:``,subject:`luvun`},bigint:{unit:``,subject:`suuren kokonaisluvun`},int:{unit:``,subject:`kokonaisluvun`},date:{unit:``,subject:`päivämäärän`}};function t(t){return e[t]??null}let n={regex:`säännöllinen lauseke`,email:`sähköpostiosoite`,url:`URL-osoite`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-aikaleima`,date:`ISO-päivämäärä`,time:`ISO-aika`,duration:`ISO-kesto`,ipv4:`IPv4-osoite`,ipv6:`IPv6-osoite`,cidrv4:`IPv4-alue`,cidrv6:`IPv6-alue`,base64:`base64-koodattu merkkijono`,base64url:`base64url-koodattu merkkijono`,json_string:`JSON-merkkijono`,e164:`E.164-luku`,jwt:`JWT`,template_literal:`templaattimerkkijono`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Virheellinen tyyppi: odotettiin instanceof ${e.expected}, oli ${i}`:`Virheellinen tyyppi: odotettiin ${t}, oli ${i}`}case`invalid_value`:return e.values.length===1?`Virheellinen syöte: täytyy olla ${x(e.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Liian suuri: ${r.subject} täytyy olla ${n}${e.maximum.toString()} ${r.unit}`.trim():`Liian suuri: arvon täytyy olla ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Liian pieni: ${r.subject} täytyy olla ${n}${e.minimum.toString()} ${r.unit}`.trim():`Liian pieni: arvon täytyy olla ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Virheellinen syöte: täytyy alkaa "${t.prefix}"`:t.format===`ends_with`?`Virheellinen syöte: täytyy loppua "${t.suffix}"`:t.format===`includes`?`Virheellinen syöte: täytyy sisältää "${t.includes}"`:t.format===`regex`?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}`:`Virheellinen ${n[t.format]??e.format}`}case`not_multiple_of`:return`Virheellinen luku: täytyy olla luvun ${e.divisor} monikerta`;case`unrecognized_keys`:return`${e.keys.length>1?`Tuntemattomat avaimet`:`Tuntematon avain`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Virheellinen avain tietueessa`;case`invalid_union`:return`Virheellinen unioni`;case`invalid_element`:return`Virheellinen arvo joukossa`;default:return`Virheellinen syöte`}}};function su(){return{localeError:ou()}}const cu=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n={regex:`entrée`,email:`adresse e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date et heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`},r={nan:`NaN`,number:`nombre`,array:`tableau`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrée invalide : instanceof ${e.expected} attendu, ${i} reçu`:`Entrée invalide : ${t} attendu, ${i} reçu`}case`invalid_value`:return e.values.length===1?`Entrée invalide : ${x(e.values[0])} attendu`:`Option invalide : une valeur parmi ${C(e.values,`|`)} attendue`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Trop grand : ${e.origin??`valeur`} doit ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`élément(s)`}`:`Trop grand : ${e.origin??`valeur`} doit être ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Trop petit : ${e.origin} doit ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : ${e.origin} doit être ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au modèle ${t.pattern}`:`${n[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${C(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function lu(){return{localeError:cu()}}const uu=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n={regex:`entrée`,email:`adresse courriel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date-heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrée invalide : attendu instanceof ${e.expected}, reçu ${i}`:`Entrée invalide : attendu ${t}, reçu ${i}`}case`invalid_value`:return e.values.length===1?`Entrée invalide : attendu ${x(e.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`≤`:`<`,r=t(e.origin);return r?`Trop grand : attendu que ${e.origin??`la valeur`} ait ${n}${e.maximum.toString()} ${r.unit}`:`Trop grand : attendu que ${e.origin??`la valeur`} soit ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`≥`:`>`,r=t(e.origin);return r?`Trop petit : attendu que ${e.origin} ait ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : attendu que ${e.origin} soit ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au motif ${t.pattern}`:`${n[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${C(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function du(){return{localeError:uu()}}const fu=()=>{let e={string:{label:`מחרוזת`,gender:`f`},number:{label:`מספר`,gender:`m`},boolean:{label:`ערך בוליאני`,gender:`m`},bigint:{label:`BigInt`,gender:`m`},date:{label:`תאריך`,gender:`m`},array:{label:`מערך`,gender:`m`},object:{label:`אובייקט`,gender:`m`},null:{label:`ערך ריק (null)`,gender:`m`},undefined:{label:`ערך לא מוגדר (undefined)`,gender:`m`},symbol:{label:`סימבול (Symbol)`,gender:`m`},function:{label:`פונקציה`,gender:`f`},map:{label:`מפה (Map)`,gender:`f`},set:{label:`קבוצה (Set)`,gender:`f`},file:{label:`קובץ`,gender:`m`},promise:{label:`Promise`,gender:`m`},NaN:{label:`NaN`,gender:`m`},unknown:{label:`ערך לא ידוע`,gender:`m`},value:{label:`ערך`,gender:`m`}},t={string:{unit:`תווים`,shortLabel:`קצר`,longLabel:`ארוך`},file:{unit:`בייטים`,shortLabel:`קטן`,longLabel:`גדול`},array:{unit:`פריטים`,shortLabel:`קטן`,longLabel:`גדול`},set:{unit:`פריטים`,shortLabel:`קטן`,longLabel:`גדול`},number:{unit:``,shortLabel:`קטן`,longLabel:`גדול`}},n=t=>t?e[t]:void 0,r=t=>{let r=n(t);return r?r.label:t??e.unknown.label},i=e=>`ה${r(e)}`,a=e=>(n(e)?.gender??`m`)===`f`?`צריכה להיות`:`צריך להיות`,o=e=>e?t[e]??null:null,s={regex:{label:`קלט`,gender:`m`},email:{label:`כתובת אימייל`,gender:`f`},url:{label:`כתובת רשת`,gender:`f`},emoji:{label:`אימוג'י`,gender:`m`},uuid:{label:`UUID`,gender:`m`},nanoid:{label:`nanoid`,gender:`m`},guid:{label:`GUID`,gender:`m`},cuid:{label:`cuid`,gender:`m`},cuid2:{label:`cuid2`,gender:`m`},ulid:{label:`ULID`,gender:`m`},xid:{label:`XID`,gender:`m`},ksuid:{label:`KSUID`,gender:`m`},datetime:{label:`תאריך וזמן ISO`,gender:`m`},date:{label:`תאריך ISO`,gender:`m`},time:{label:`זמן ISO`,gender:`m`},duration:{label:`משך זמן ISO`,gender:`m`},ipv4:{label:`כתובת IPv4`,gender:`f`},ipv6:{label:`כתובת IPv6`,gender:`f`},cidrv4:{label:`טווח IPv4`,gender:`m`},cidrv6:{label:`טווח IPv6`,gender:`m`},base64:{label:`מחרוזת בבסיס 64`,gender:`f`},base64url:{label:`מחרוזת בבסיס 64 לכתובות רשת`,gender:`f`},json_string:{label:`מחרוזת JSON`,gender:`f`},e164:{label:`מספר E.164`,gender:`m`},jwt:{label:`JWT`,gender:`m`},ends_with:{label:`קלט`,gender:`m`},includes:{label:`קלט`,gender:`m`},lowercase:{label:`קלט`,gender:`m`},starts_with:{label:`קלט`,gender:`m`},uppercase:{label:`קלט`,gender:`m`}},c={nan:`NaN`};return t=>{switch(t.code){case`invalid_type`:{let n=t.expected,i=c[n??``]??r(n),a=S(t.input),o=c[a]??e[a]?.label??a;return/^[A-Z]/.test(t.expected)?`קלט לא תקין: צריך להיות instanceof ${t.expected}, התקבל ${o}`:`קלט לא תקין: צריך להיות ${i}, התקבל ${o}`}case`invalid_value`:{if(t.values.length===1)return`ערך לא תקין: הערך חייב להיות ${x(t.values[0])}`;let e=t.values.map(e=>x(e));if(t.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${e[0]} או ${e[1]}`;let n=e[e.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${e.slice(0,-1).join(`, `)} או ${n}`}case`too_big`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.longLabel??`ארוך`} מדי: ${n} צריכה להכיל ${t.maximum.toString()} ${e?.unit??``} ${t.inclusive?`או פחות`:`לכל היותר`}`.trim();if(t.origin===`number`)return`גדול מדי: ${n} צריך להיות ${t.inclusive?`קטן או שווה ל-${t.maximum}`:`קטן מ-${t.maximum}`}`;if(t.origin===`array`||t.origin===`set`)return`גדול מדי: ${n} ${t.origin===`set`?`צריכה`:`צריך`} להכיל ${t.inclusive?`${t.maximum} ${e?.unit??``} או פחות`:`פחות מ-${t.maximum} ${e?.unit??``}`}`.trim();let r=t.inclusive?`<=`:`<`,s=a(t.origin??`value`);return e?.unit?`${e.longLabel} מדי: ${n} ${s} ${r}${t.maximum.toString()} ${e.unit}`:`${e?.longLabel??`גדול`} מדי: ${n} ${s} ${r}${t.maximum.toString()}`}case`too_small`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.shortLabel??`קצר`} מדי: ${n} צריכה להכיל ${t.minimum.toString()} ${e?.unit??``} ${t.inclusive?`או יותר`:`לפחות`}`.trim();if(t.origin===`number`)return`קטן מדי: ${n} צריך להיות ${t.inclusive?`גדול או שווה ל-${t.minimum}`:`גדול מ-${t.minimum}`}`;if(t.origin===`array`||t.origin===`set`){let r=t.origin===`set`?`צריכה`:`צריך`;return t.minimum===1&&t.inclusive?`קטן מדי: ${n} ${r} להכיל ${t.origin,`לפחות פריט אחד`}`:`קטן מדי: ${n} ${r} להכיל ${t.inclusive?`${t.minimum} ${e?.unit??``} או יותר`:`יותר מ-${t.minimum} ${e?.unit??``}`}`.trim()}let r=t.inclusive?`>=`:`>`,s=a(t.origin??`value`);return e?.unit?`${e.shortLabel} מדי: ${n} ${s} ${r}${t.minimum.toString()} ${e.unit}`:`${e?.shortLabel??`קטן`} מדי: ${n} ${s} ${r}${t.minimum.toString()}`}case`invalid_format`:{let e=t;if(e.format===`starts_with`)return`המחרוזת חייבת להתחיל ב "${e.prefix}"`;if(e.format===`ends_with`)return`המחרוזת חייבת להסתיים ב "${e.suffix}"`;if(e.format===`includes`)return`המחרוזת חייבת לכלול "${e.includes}"`;if(e.format===`regex`)return`המחרוזת חייבת להתאים לתבנית ${e.pattern}`;let n=s[e.format];return`${n?.label??e.format} לא ${(n?.gender??`m`)===`f`?`תקינה`:`תקין`}`}case`not_multiple_of`:return`מספר לא תקין: חייב להיות מכפלה של ${t.divisor}`;case`unrecognized_keys`:return`מפתח${t.keys.length>1?`ות`:``} לא מזוה${t.keys.length>1?`ים`:`ה`}: ${C(t.keys,`, `)}`;case`invalid_key`:return`שדה לא תקין באובייקט`;case`invalid_union`:return`קלט לא תקין`;case`invalid_element`:return`ערך לא תקין ב${i(t.origin??`array`)}`;default:return`קלט לא תקין`}}};function pu(){return{localeError:fu()}}const mu=()=>{let e={string:{unit:`karakter`,verb:`legyen`},file:{unit:`byte`,verb:`legyen`},array:{unit:`elem`,verb:`legyen`},set:{unit:`elem`,verb:`legyen`}};function t(t){return e[t]??null}let n={regex:`bemenet`,email:`email cím`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO időbélyeg`,date:`ISO dátum`,time:`ISO idő`,duration:`ISO időintervallum`,ipv4:`IPv4 cím`,ipv6:`IPv6 cím`,cidrv4:`IPv4 tartomány`,cidrv6:`IPv6 tartomány`,base64:`base64-kódolt string`,base64url:`base64url-kódolt string`,json_string:`JSON string`,e164:`E.164 szám`,jwt:`JWT`,template_literal:`bemenet`},r={nan:`NaN`,number:`szám`,array:`tömb`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Érvénytelen bemenet: a várt érték instanceof ${e.expected}, a kapott érték ${i}`:`Érvénytelen bemenet: a várt érték ${t}, a kapott érték ${i}`}case`invalid_value`:return e.values.length===1?`Érvénytelen bemenet: a várt érték ${x(e.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Túl nagy: ${e.origin??`érték`} mérete túl nagy ${n}${e.maximum.toString()} ${r.unit??`elem`}`:`Túl nagy: a bemeneti érték ${e.origin??`érték`} túl nagy: ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Túl kicsi: a bemeneti érték ${e.origin} mérete túl kicsi ${n}${e.minimum.toString()} ${r.unit}`:`Túl kicsi: a bemeneti érték ${e.origin} túl kicsi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Érvénytelen string: "${t.prefix}" értékkel kell kezdődnie`:t.format===`ends_with`?`Érvénytelen string: "${t.suffix}" értékkel kell végződnie`:t.format===`includes`?`Érvénytelen string: "${t.includes}" értéket kell tartalmaznia`:t.format===`regex`?`Érvénytelen string: ${t.pattern} mintának kell megfelelnie`:`Érvénytelen ${n[t.format]??e.format}`}case`not_multiple_of`:return`Érvénytelen szám: ${e.divisor} többszörösének kell lennie`;case`unrecognized_keys`:return`Ismeretlen kulcs${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Érvénytelen kulcs ${e.origin}`;case`invalid_union`:return`Érvénytelen bemenet`;case`invalid_element`:return`Érvénytelen érték: ${e.origin}`;default:return`Érvénytelen bemenet`}}};function hu(){return{localeError:mu()}}function gu(e,t,n){return Math.abs(e)===1?t:n}function _u(e){if(!e)return``;let t=[`ա`,`ե`,`ը`,`ի`,`ո`,`ու`,`օ`],n=e[e.length-1];return e+(t.includes(n)?`ն`:`ը`)}const vu=()=>{let e={string:{unit:{one:`նշան`,many:`նշաններ`},verb:`ունենալ`},file:{unit:{one:`բայթ`,many:`բայթեր`},verb:`ունենալ`},array:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`},set:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`}};function t(t){return e[t]??null}let n={regex:`մուտք`,email:`էլ. հասցե`,url:`URL`,emoji:`էմոջի`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO ամսաթիվ և ժամ`,date:`ISO ամսաթիվ`,time:`ISO ժամ`,duration:`ISO տևողություն`,ipv4:`IPv4 հասցե`,ipv6:`IPv6 հասցե`,cidrv4:`IPv4 միջակայք`,cidrv6:`IPv6 միջակայք`,base64:`base64 ձևաչափով տող`,base64url:`base64url ձևաչափով տող`,json_string:`JSON տող`,e164:`E.164 համար`,jwt:`JWT`,template_literal:`մուտք`},r={nan:`NaN`,number:`թիվ`,array:`զանգված`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${e.expected}, ստացվել է ${i}`:`Սխալ մուտքագրում․ սպասվում էր ${t}, ստացվել է ${i}`}case`invalid_value`:return e.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${x(e.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=gu(Number(e.maximum),r.unit.one,r.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${_u(e.origin??`արժեք`)} կունենա ${n}${e.maximum.toString()} ${t}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${_u(e.origin??`արժեք`)} լինի ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=gu(Number(e.minimum),r.unit.one,r.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${_u(e.origin)} կունենա ${n}${e.minimum.toString()} ${t}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${_u(e.origin)} լինի ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Սխալ տող․ պետք է սկսվի "${t.prefix}"-ով`:t.format===`ends_with`?`Սխալ տող․ պետք է ավարտվի "${t.suffix}"-ով`:t.format===`includes`?`Սխալ տող․ պետք է պարունակի "${t.includes}"`:t.format===`regex`?`Սխալ տող․ պետք է համապատասխանի ${t.pattern} ձևաչափին`:`Սխալ ${n[t.format]??e.format}`}case`not_multiple_of`:return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${e.divisor}-ի`;case`unrecognized_keys`:return`Չճանաչված բանալի${e.keys.length>1?`ներ`:``}. ${C(e.keys,`, `)}`;case`invalid_key`:return`Սխալ բանալի ${_u(e.origin)}-ում`;case`invalid_union`:return`Սխալ մուտքագրում`;case`invalid_element`:return`Սխալ արժեք ${_u(e.origin)}-ում`;default:return`Սխալ մուտքագրում`}}};function yu(){return{localeError:vu()}}const bu=()=>{let e={string:{unit:`karakter`,verb:`memiliki`},file:{unit:`byte`,verb:`memiliki`},array:{unit:`item`,verb:`memiliki`},set:{unit:`item`,verb:`memiliki`}};function t(t){return e[t]??null}let n={regex:`input`,email:`alamat email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tanggal dan waktu format ISO`,date:`tanggal format ISO`,time:`jam format ISO`,duration:`durasi format ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,cidrv4:`rentang alamat IPv4`,cidrv6:`rentang alamat IPv6`,base64:`string dengan enkode base64`,base64url:`string dengan enkode base64url`,json_string:`string JSON`,e164:`angka E.164`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input tidak valid: diharapkan instanceof ${e.expected}, diterima ${i}`:`Input tidak valid: diharapkan ${t}, diterima ${i}`}case`invalid_value`:return e.values.length===1?`Input tidak valid: diharapkan ${x(e.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: diharapkan ${e.origin??`value`} memiliki ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: diharapkan ${e.origin??`value`} menjadi ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: diharapkan ${e.origin} memiliki ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: diharapkan ${e.origin} menjadi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak valid: harus dimulai dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak valid: harus berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak valid: harus menyertakan "${t.includes}"`:t.format===`regex`?`String tidak valid: harus sesuai pola ${t.pattern}`:`${n[t.format]??e.format} tidak valid`}case`not_multiple_of`:return`Angka tidak valid: harus kelipatan dari ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali ${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak valid di ${e.origin}`;case`invalid_union`:return`Input tidak valid`;case`invalid_element`:return`Nilai tidak valid di ${e.origin}`;default:return`Input tidak valid`}}};function xu(){return{localeError:bu()}}const Su=()=>{let e={string:{unit:`stafi`,verb:`að hafa`},file:{unit:`bæti`,verb:`að hafa`},array:{unit:`hluti`,verb:`að hafa`},set:{unit:`hluti`,verb:`að hafa`}};function t(t){return e[t]??null}let n={regex:`gildi`,email:`netfang`,url:`vefslóð`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dagsetning og tími`,date:`ISO dagsetning`,time:`ISO tími`,duration:`ISO tímalengd`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded strengur`,base64url:`base64url-encoded strengur`,json_string:`JSON strengur`,e164:`E.164 tölugildi`,jwt:`JWT`,template_literal:`gildi`},r={nan:`NaN`,number:`númer`,array:`fylki`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Rangt gildi: Þú slóst inn ${i} þar sem á að vera instanceof ${e.expected}`:`Rangt gildi: Þú slóst inn ${i} þar sem á að vera ${t}`}case`invalid_value`:return e.values.length===1?`Rangt gildi: gert ráð fyrir ${x(e.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} hafi ${n}${e.maximum.toString()} ${r.unit??`hluti`}`:`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} sé ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Of lítið: gert er ráð fyrir að ${e.origin} hafi ${n}${e.minimum.toString()} ${r.unit}`:`Of lítið: gert er ráð fyrir að ${e.origin} sé ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ógildur strengur: verður að byrja á "${t.prefix}"`:t.format===`ends_with`?`Ógildur strengur: verður að enda á "${t.suffix}"`:t.format===`includes`?`Ógildur strengur: verður að innihalda "${t.includes}"`:t.format===`regex`?`Ógildur strengur: verður að fylgja mynstri ${t.pattern}`:`Rangt ${n[t.format]??e.format}`}case`not_multiple_of`:return`Röng tala: verður að vera margfeldi af ${e.divisor}`;case`unrecognized_keys`:return`Óþekkt ${e.keys.length>1?`ir lyklar`:`ur lykill`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Rangur lykill í ${e.origin}`;case`invalid_union`:return`Rangt gildi`;case`invalid_element`:return`Rangt gildi í ${e.origin}`;default:return`Rangt gildi`}}};function Cu(){return{localeError:Su()}}const wu=()=>{let e={string:{unit:`caratteri`,verb:`avere`},file:{unit:`byte`,verb:`avere`},array:{unit:`elementi`,verb:`avere`},set:{unit:`elementi`,verb:`avere`}};function t(t){return e[t]??null}let n={regex:`input`,email:`indirizzo email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e ora ISO`,date:`data ISO`,time:`ora ISO`,duration:`durata ISO`,ipv4:`indirizzo IPv4`,ipv6:`indirizzo IPv6`,cidrv4:`intervallo IPv4`,cidrv6:`intervallo IPv6`,base64:`stringa codificata in base64`,base64url:`URL codificata in base64`,json_string:`stringa JSON`,e164:`numero E.164`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`numero`,array:`vettore`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input non valido: atteso instanceof ${e.expected}, ricevuto ${i}`:`Input non valido: atteso ${t}, ricevuto ${i}`}case`invalid_value`:return e.values.length===1?`Input non valido: atteso ${x(e.values[0])}`:`Opzione non valida: atteso uno tra ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Troppo grande: ${e.origin??`valore`} deve avere ${n}${e.maximum.toString()} ${r.unit??`elementi`}`:`Troppo grande: ${e.origin??`valore`} deve essere ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Troppo piccolo: ${e.origin} deve avere ${n}${e.minimum.toString()} ${r.unit}`:`Troppo piccolo: ${e.origin} deve essere ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Stringa non valida: deve iniziare con "${t.prefix}"`:t.format===`ends_with`?`Stringa non valida: deve terminare con "${t.suffix}"`:t.format===`includes`?`Stringa non valida: deve includere "${t.includes}"`:t.format===`regex`?`Stringa non valida: deve corrispondere al pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Numero non valido: deve essere un multiplo di ${e.divisor}`;case`unrecognized_keys`:return`Chiav${e.keys.length>1?`i`:`e`} non riconosciut${e.keys.length>1?`e`:`a`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Chiave non valida in ${e.origin}`;case`invalid_union`:return`Input non valido`;case`invalid_element`:return`Valore non valido in ${e.origin}`;default:return`Input non valido`}}};function Tu(){return{localeError:wu()}}const Eu=()=>{let e={string:{unit:`文字`,verb:`である`},file:{unit:`バイト`,verb:`である`},array:{unit:`要素`,verb:`である`},set:{unit:`要素`,verb:`である`}};function t(t){return e[t]??null}let n={regex:`入力値`,email:`メールアドレス`,url:`URL`,emoji:`絵文字`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日時`,date:`ISO日付`,time:`ISO時刻`,duration:`ISO期間`,ipv4:`IPv4アドレス`,ipv6:`IPv6アドレス`,cidrv4:`IPv4範囲`,cidrv6:`IPv6範囲`,base64:`base64エンコード文字列`,base64url:`base64urlエンコード文字列`,json_string:`JSON文字列`,e164:`E.164番号`,jwt:`JWT`,template_literal:`入力値`},r={nan:`NaN`,number:`数値`,array:`配列`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`無効な入力: instanceof ${e.expected}が期待されましたが、${i}が入力されました`:`無効な入力: ${t}が期待されましたが、${i}が入力されました`}case`invalid_value`:return e.values.length===1?`無効な入力: ${x(e.values[0])}が期待されました`:`無効な選択: ${C(e.values,`、`)}のいずれかである必要があります`;case`too_big`:{let n=e.inclusive?`以下である`:`より小さい`,r=t(e.origin);return r?`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${r.unit??`要素`}${n}必要があります`:`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${n}必要があります`}case`too_small`:{let n=e.inclusive?`以上である`:`より大きい`,r=t(e.origin);return r?`小さすぎる値: ${e.origin}は${e.minimum.toString()}${r.unit}${n}必要があります`:`小さすぎる値: ${e.origin}は${e.minimum.toString()}${n}必要があります`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無効な文字列: "${t.prefix}"で始まる必要があります`:t.format===`ends_with`?`無効な文字列: "${t.suffix}"で終わる必要があります`:t.format===`includes`?`無効な文字列: "${t.includes}"を含む必要があります`:t.format===`regex`?`無効な文字列: パターン${t.pattern}に一致する必要があります`:`無効な${n[t.format]??e.format}`}case`not_multiple_of`:return`無効な数値: ${e.divisor}の倍数である必要があります`;case`unrecognized_keys`:return`認識されていないキー${e.keys.length>1?`群`:``}: ${C(e.keys,`、`)}`;case`invalid_key`:return`${e.origin}内の無効なキー`;case`invalid_union`:return`無効な入力`;case`invalid_element`:return`${e.origin}内の無効な値`;default:return`無効な入力`}}};function Du(){return{localeError:Eu()}}const Ou=()=>{let e={string:{unit:`სიმბოლო`,verb:`უნდა შეიცავდეს`},file:{unit:`ბაიტი`,verb:`უნდა შეიცავდეს`},array:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`},set:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`}};function t(t){return e[t]??null}let n={regex:`შეყვანა`,email:`ელ-ფოსტის მისამართი`,url:`URL`,emoji:`ემოჯი`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`თარიღი-დრო`,date:`თარიღი`,time:`დრო`,duration:`ხანგრძლივობა`,ipv4:`IPv4 მისამართი`,ipv6:`IPv6 მისამართი`,cidrv4:`IPv4 დიაპაზონი`,cidrv6:`IPv6 დიაპაზონი`,base64:`base64-კოდირებული სტრინგი`,base64url:`base64url-კოდირებული სტრინგი`,json_string:`JSON სტრინგი`,e164:`E.164 ნომერი`,jwt:`JWT`,template_literal:`შეყვანა`},r={nan:`NaN`,number:`რიცხვი`,string:`სტრინგი`,boolean:`ბულეანი`,function:`ფუნქცია`,array:`მასივი`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${e.expected}, მიღებული ${i}`:`არასწორი შეყვანა: მოსალოდნელი ${t}, მიღებული ${i}`}case`invalid_value`:return e.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${x(e.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${C(e.values,`|`)}-დან`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} იყოს ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ზედმეტად პატარა: მოსალოდნელი ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${e.origin} იყოს ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`არასწორი სტრინგი: უნდა იწყებოდეს "${t.prefix}"-ით`:t.format===`ends_with`?`არასწორი სტრინგი: უნდა მთავრდებოდეს "${t.suffix}"-ით`:t.format===`includes`?`არასწორი სტრინგი: უნდა შეიცავდეს "${t.includes}"-ს`:t.format===`regex`?`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${t.pattern}`:`არასწორი ${n[t.format]??e.format}`}case`not_multiple_of`:return`არასწორი რიცხვი: უნდა იყოს ${e.divisor}-ის ჯერადი`;case`unrecognized_keys`:return`უცნობი გასაღებ${e.keys.length>1?`ები`:`ი`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`არასწორი გასაღები ${e.origin}-ში`;case`invalid_union`:return`არასწორი შეყვანა`;case`invalid_element`:return`არასწორი მნიშვნელობა ${e.origin}-ში`;default:return`არასწორი შეყვანა`}}};function ku(){return{localeError:Ou()}}const Au=()=>{let e={string:{unit:`តួអក្សរ`,verb:`គួរមាន`},file:{unit:`បៃ`,verb:`គួរមាន`},array:{unit:`ធាតុ`,verb:`គួរមាន`},set:{unit:`ធាតុ`,verb:`គួរមាន`}};function t(t){return e[t]??null}let n={regex:`ទិន្នន័យបញ្ចូល`,email:`អាសយដ្ឋានអ៊ីមែល`,url:`URL`,emoji:`សញ្ញាអារម្មណ៍`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`កាលបរិច្ឆេទ និងម៉ោង ISO`,date:`កាលបរិច្ឆេទ ISO`,time:`ម៉ោង ISO`,duration:`រយៈពេល ISO`,ipv4:`អាសយដ្ឋាន IPv4`,ipv6:`អាសយដ្ឋាន IPv6`,cidrv4:`ដែនអាសយដ្ឋាន IPv4`,cidrv6:`ដែនអាសយដ្ឋាន IPv6`,base64:`ខ្សែអក្សរអ៊ិកូដ base64`,base64url:`ខ្សែអក្សរអ៊ិកូដ base64url`,json_string:`ខ្សែអក្សរ JSON`,e164:`លេខ E.164`,jwt:`JWT`,template_literal:`ទិន្នន័យបញ្ចូល`},r={nan:`NaN`,number:`លេខ`,array:`អារេ (Array)`,null:`គ្មានតម្លៃ (null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${e.expected} ប៉ុន្តែទទួលបាន ${i}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${t} ប៉ុន្តែទទួលបាន ${i}`}case`invalid_value`:return e.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${x(e.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()} ${r.unit??`ធាតុ`}`:`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}`:`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${t.prefix}"`:t.format===`ends_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${t.suffix}"`:t.format===`includes`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${t.includes}"`:t.format===`regex`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}`:`មិនត្រឹមត្រូវ៖ ${n[t.format]??e.format}`}case`not_multiple_of`:return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`;case`unrecognized_keys`:return`រកឃើញសោមិនស្គាល់៖ ${C(e.keys,`, `)}`;case`invalid_key`:return`សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;case`invalid_union`:return`ទិន្នន័យមិនត្រឹមត្រូវ`;case`invalid_element`:return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;default:return`ទិន្នន័យមិនត្រឹមត្រូវ`}}};function ju(){return{localeError:Au()}}function Mu(){return ju()}const Nu=()=>{let e={string:{unit:`문자`,verb:`to have`},file:{unit:`바이트`,verb:`to have`},array:{unit:`개`,verb:`to have`},set:{unit:`개`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`입력`,email:`이메일 주소`,url:`URL`,emoji:`이모지`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 날짜시간`,date:`ISO 날짜`,time:`ISO 시간`,duration:`ISO 기간`,ipv4:`IPv4 주소`,ipv6:`IPv6 주소`,cidrv4:`IPv4 범위`,cidrv6:`IPv6 범위`,base64:`base64 인코딩 문자열`,base64url:`base64url 인코딩 문자열`,json_string:`JSON 문자열`,e164:`E.164 번호`,jwt:`JWT`,template_literal:`입력`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`잘못된 입력: 예상 타입은 instanceof ${e.expected}, 받은 타입은 ${i}입니다`:`잘못된 입력: 예상 타입은 ${t}, 받은 타입은 ${i}입니다`}case`invalid_value`:return e.values.length===1?`잘못된 입력: 값은 ${x(e.values[0])} 이어야 합니다`:`잘못된 옵션: ${C(e.values,`또는 `)} 중 하나여야 합니다`;case`too_big`:{let n=e.inclusive?`이하`:`미만`,r=n===`미만`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()} ${n}${r}`}case`too_small`:{let n=e.inclusive?`이상`:`초과`,r=n===`이상`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()} ${n}${r}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`잘못된 문자열: "${t.prefix}"(으)로 시작해야 합니다`:t.format===`ends_with`?`잘못된 문자열: "${t.suffix}"(으)로 끝나야 합니다`:t.format===`includes`?`잘못된 문자열: "${t.includes}"을(를) 포함해야 합니다`:t.format===`regex`?`잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다`:`잘못된 ${n[t.format]??e.format}`}case`not_multiple_of`:return`잘못된 숫자: ${e.divisor}의 배수여야 합니다`;case`unrecognized_keys`:return`인식할 수 없는 키: ${C(e.keys,`, `)}`;case`invalid_key`:return`잘못된 키: ${e.origin}`;case`invalid_union`:return`잘못된 입력`;case`invalid_element`:return`잘못된 값: ${e.origin}`;default:return`잘못된 입력`}}};function Pu(){return{localeError:Nu()}}const Fu=e=>e.charAt(0).toUpperCase()+e.slice(1);function Iu(e){let t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||n===0?`many`:n===1?`one`:`few`}const Lu=()=>{let e={string:{unit:{one:`simbolis`,few:`simboliai`,many:`simbolių`},verb:{smaller:{inclusive:`turi būti ne ilgesnė kaip`,notInclusive:`turi būti trumpesnė kaip`},bigger:{inclusive:`turi būti ne trumpesnė kaip`,notInclusive:`turi būti ilgesnė kaip`}}},file:{unit:{one:`baitas`,few:`baitai`,many:`baitų`},verb:{smaller:{inclusive:`turi būti ne didesnis kaip`,notInclusive:`turi būti mažesnis kaip`},bigger:{inclusive:`turi būti ne mažesnis kaip`,notInclusive:`turi būti didesnis kaip`}}},array:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}},set:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}}};function t(t,n,r,i){let a=e[t]??null;return a===null?a:{unit:a.unit[n],verb:a.verb[i][r?`inclusive`:`notInclusive`]}}let n={regex:`įvestis`,email:`el. pašto adresas`,url:`URL`,emoji:`jaustukas`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO data ir laikas`,date:`ISO data`,time:`ISO laikas`,duration:`ISO trukmė`,ipv4:`IPv4 adresas`,ipv6:`IPv6 adresas`,cidrv4:`IPv4 tinklo prefiksas (CIDR)`,cidrv6:`IPv6 tinklo prefiksas (CIDR)`,base64:`base64 užkoduota eilutė`,base64url:`base64url užkoduota eilutė`,json_string:`JSON eilutė`,e164:`E.164 numeris`,jwt:`JWT`,template_literal:`įvestis`},r={nan:`NaN`,number:`skaičius`,bigint:`sveikasis skaičius`,string:`eilutė`,boolean:`loginė reikšmė`,undefined:`neapibrėžta reikšmė`,function:`funkcija`,symbol:`simbolis`,array:`masyvas`,object:`objektas`,null:`nulinė reikšmė`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Gautas tipas ${i}, o tikėtasi - instanceof ${e.expected}`:`Gautas tipas ${i}, o tikėtasi - ${t}`}case`invalid_value`:return e.values.length===1?`Privalo būti ${x(e.values[0])}`:`Privalo būti vienas iš ${C(e.values,`|`)} pasirinkimų`;case`too_big`:{let n=r[e.origin]??e.origin,i=t(e.origin,Iu(Number(e.maximum)),e.inclusive??!1,`smaller`);if(i?.verb)return`${Fu(n??e.origin??`reikšmė`)} ${i.verb} ${e.maximum.toString()} ${i.unit??`elementų`}`;let a=e.inclusive?`ne didesnis kaip`:`mažesnis kaip`;return`${Fu(n??e.origin??`reikšmė`)} turi būti ${a} ${e.maximum.toString()} ${i?.unit}`}case`too_small`:{let n=r[e.origin]??e.origin,i=t(e.origin,Iu(Number(e.minimum)),e.inclusive??!1,`bigger`);if(i?.verb)return`${Fu(n??e.origin??`reikšmė`)} ${i.verb} ${e.minimum.toString()} ${i.unit??`elementų`}`;let a=e.inclusive?`ne mažesnis kaip`:`didesnis kaip`;return`${Fu(n??e.origin??`reikšmė`)} turi būti ${a} ${e.minimum.toString()} ${i?.unit}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Eilutė privalo prasidėti "${t.prefix}"`:t.format===`ends_with`?`Eilutė privalo pasibaigti "${t.suffix}"`:t.format===`includes`?`Eilutė privalo įtraukti "${t.includes}"`:t.format===`regex`?`Eilutė privalo atitikti ${t.pattern}`:`Neteisingas ${n[t.format]??e.format}`}case`not_multiple_of`:return`Skaičius privalo būti ${e.divisor} kartotinis.`;case`unrecognized_keys`:return`Neatpažint${e.keys.length>1?`i`:`as`} rakt${e.keys.length>1?`ai`:`as`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Rastas klaidingas raktas`;case`invalid_union`:return`Klaidinga įvestis`;case`invalid_element`:{let t=r[e.origin]??e.origin;return`${Fu(t??e.origin??`reikšmė`)} turi klaidingą įvestį`}default:return`Klaidinga įvestis`}}};function Ru(){return{localeError:Lu()}}const zu=()=>{let e={string:{unit:`знаци`,verb:`да имаат`},file:{unit:`бајти`,verb:`да имаат`},array:{unit:`ставки`,verb:`да имаат`},set:{unit:`ставки`,verb:`да имаат`}};function t(t){return e[t]??null}let n={regex:`внес`,email:`адреса на е-пошта`,url:`URL`,emoji:`емоџи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO датум и време`,date:`ISO датум`,time:`ISO време`,duration:`ISO времетраење`,ipv4:`IPv4 адреса`,ipv6:`IPv6 адреса`,cidrv4:`IPv4 опсег`,cidrv6:`IPv6 опсег`,base64:`base64-енкодирана низа`,base64url:`base64url-енкодирана низа`,json_string:`JSON низа`,e164:`E.164 број`,jwt:`JWT`,template_literal:`внес`},r={nan:`NaN`,number:`број`,array:`низа`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Грешен внес: се очекува instanceof ${e.expected}, примено ${i}`:`Грешен внес: се очекува ${t}, примено ${i}`}case`invalid_value`:return e.values.length===1?`Invalid input: expected ${x(e.values[0])}`:`Грешана опција: се очекува една ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Премногу голем: се очекува ${e.origin??`вредноста`} да има ${n}${e.maximum.toString()} ${r.unit??`елементи`}`:`Премногу голем: се очекува ${e.origin??`вредноста`} да биде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Премногу мал: се очекува ${e.origin} да има ${n}${e.minimum.toString()} ${r.unit}`:`Премногу мал: се очекува ${e.origin} да биде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неважечка низа: мора да започнува со "${t.prefix}"`:t.format===`ends_with`?`Неважечка низа: мора да завршува со "${t.suffix}"`:t.format===`includes`?`Неважечка низа: мора да вклучува "${t.includes}"`:t.format===`regex`?`Неважечка низа: мора да одгоара на патернот ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Грешен број: мора да биде делив со ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Непрепознаени клучеви`:`Непрепознаен клуч`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Грешен клуч во ${e.origin}`;case`invalid_union`:return`Грешен внес`;case`invalid_element`:return`Грешна вредност во ${e.origin}`;default:return`Грешен внес`}}};function Bu(){return{localeError:zu()}}const Vu=()=>{let e={string:{unit:`aksara`,verb:`mempunyai`},file:{unit:`bait`,verb:`mempunyai`},array:{unit:`elemen`,verb:`mempunyai`},set:{unit:`elemen`,verb:`mempunyai`}};function t(t){return e[t]??null}let n={regex:`input`,email:`alamat e-mel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tarikh masa ISO`,date:`tarikh ISO`,time:`masa ISO`,duration:`tempoh ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,cidrv4:`julat IPv4`,cidrv6:`julat IPv6`,base64:`string dikodkan base64`,base64url:`string dikodkan base64url`,json_string:`string JSON`,e164:`nombor E.164`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`nombor`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input tidak sah: dijangka instanceof ${e.expected}, diterima ${i}`:`Input tidak sah: dijangka ${t}, diterima ${i}`}case`invalid_value`:return e.values.length===1?`Input tidak sah: dijangka ${x(e.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: dijangka ${e.origin??`nilai`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: dijangka ${e.origin??`nilai`} adalah ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: dijangka ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: dijangka ${e.origin} adalah ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak sah: mesti bermula dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak sah: mesti berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak sah: mesti mengandungi "${t.includes}"`:t.format===`regex`?`String tidak sah: mesti sepadan dengan corak ${t.pattern}`:`${n[t.format]??e.format} tidak sah`}case`not_multiple_of`:return`Nombor tidak sah: perlu gandaan ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali: ${C(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak sah dalam ${e.origin}`;case`invalid_union`:return`Input tidak sah`;case`invalid_element`:return`Nilai tidak sah dalam ${e.origin}`;default:return`Input tidak sah`}}};function Hu(){return{localeError:Vu()}}const Uu=()=>{let e={string:{unit:`tekens`,verb:`heeft`},file:{unit:`bytes`,verb:`heeft`},array:{unit:`elementen`,verb:`heeft`},set:{unit:`elementen`,verb:`heeft`}};function t(t){return e[t]??null}let n={regex:`invoer`,email:`emailadres`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum en tijd`,date:`ISO datum`,time:`ISO tijd`,duration:`ISO duur`,ipv4:`IPv4-adres`,ipv6:`IPv6-adres`,cidrv4:`IPv4-bereik`,cidrv6:`IPv6-bereik`,base64:`base64-gecodeerde tekst`,base64url:`base64 URL-gecodeerde tekst`,json_string:`JSON string`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`invoer`},r={nan:`NaN`,number:`getal`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ongeldige invoer: verwacht instanceof ${e.expected}, ontving ${i}`:`Ongeldige invoer: verwacht ${t}, ontving ${i}`}case`invalid_value`:return e.values.length===1?`Ongeldige invoer: verwacht ${x(e.values[0])}`:`Ongeldige optie: verwacht één van ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin),i=e.origin===`date`?`laat`:e.origin===`string`?`lang`:`groot`;return r?`Te ${i}: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} ${r.unit??`elementen`} ${r.verb}`:`Te ${i}: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} is`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin),i=e.origin===`date`?`vroeg`:e.origin===`string`?`kort`:`klein`;return r?`Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} is`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ongeldige tekst: moet met "${t.prefix}" beginnen`:t.format===`ends_with`?`Ongeldige tekst: moet op "${t.suffix}" eindigen`:t.format===`includes`?`Ongeldige tekst: moet "${t.includes}" bevatten`:t.format===`regex`?`Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}`:`Ongeldig: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`;case`unrecognized_keys`:return`Onbekende key${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Ongeldige key in ${e.origin}`;case`invalid_union`:return`Ongeldige invoer`;case`invalid_element`:return`Ongeldige waarde in ${e.origin}`;default:return`Ongeldige invoer`}}};function Wu(){return{localeError:Uu()}}const Gu=()=>{let e={string:{unit:`tegn`,verb:`å ha`},file:{unit:`bytes`,verb:`å ha`},array:{unit:`elementer`,verb:`å inneholde`},set:{unit:`elementer`,verb:`å inneholde`}};function t(t){return e[t]??null}let n={regex:`input`,email:`e-postadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslett`,date:`ISO-dato`,time:`ISO-klokkeslett`,duration:`ISO-varighet`,ipv4:`IPv4-område`,ipv6:`IPv6-område`,cidrv4:`IPv4-spekter`,cidrv6:`IPv6-spekter`,base64:`base64-enkodet streng`,base64url:`base64url-enkodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`tall`,array:`liste`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldig input: forventet instanceof ${e.expected}, fikk ${i}`:`Ugyldig input: forventet ${t}, fikk ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventet ${x(e.values[0])}`:`Ugyldig valg: forventet en av ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()} ${r.unit??`elementer`}`:`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}`:`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: må starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: må ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: må inneholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldig tall: må være et multiplum av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukjente nøkler`:`Ukjent nøkkel`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøkkel i ${e.origin}`;case`invalid_union`:return`Ugyldig input`;case`invalid_element`:return`Ugyldig verdi i ${e.origin}`;default:return`Ugyldig input`}}};function Ku(){return{localeError:Gu()}}const qu=()=>{let e={string:{unit:`harf`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`unsur`,verb:`olmalıdır`},set:{unit:`unsur`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n={regex:`giren`,email:`epostagâh`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO hengâmı`,date:`ISO tarihi`,time:`ISO zamanı`,duration:`ISO müddeti`,ipv4:`IPv4 nişânı`,ipv6:`IPv6 nişânı`,cidrv4:`IPv4 menzili`,cidrv6:`IPv6 menzili`,base64:`base64-şifreli metin`,base64url:`base64url-şifreli metin`,json_string:`JSON metin`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`giren`},r={nan:`NaN`,number:`numara`,array:`saf`,null:`gayb`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Fâsit giren: umulan instanceof ${e.expected}, alınan ${i}`:`Fâsit giren: umulan ${t}, alınan ${i}`}case`invalid_value`:return e.values.length===1?`Fâsit giren: umulan ${x(e.values[0])}`:`Fâsit tercih: mûteberler ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} ${r.unit??`elements`} sahip olmalıydı.`:`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} olmalıydı.`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} ${r.unit} sahip olmalıydı.`:`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} olmalıydı.`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Fâsit metin: "${t.prefix}" ile başlamalı.`:t.format===`ends_with`?`Fâsit metin: "${t.suffix}" ile bitmeli.`:t.format===`includes`?`Fâsit metin: "${t.includes}" ihtivâ etmeli.`:t.format===`regex`?`Fâsit metin: ${t.pattern} nakşına uymalı.`:`Fâsit ${n[t.format]??e.format}`}case`not_multiple_of`:return`Fâsit sayı: ${e.divisor} katı olmalıydı.`;case`unrecognized_keys`:return`Tanınmayan anahtar ${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} için tanınmayan anahtar var.`;case`invalid_union`:return`Giren tanınamadı.`;case`invalid_element`:return`${e.origin} için tanınmayan kıymet var.`;default:return`Kıymet tanınamadı.`}}};function Ju(){return{localeError:qu()}}const Yu=()=>{let e={string:{unit:`توکي`,verb:`ولري`},file:{unit:`بایټس`,verb:`ولري`},array:{unit:`توکي`,verb:`ولري`},set:{unit:`توکي`,verb:`ولري`}};function t(t){return e[t]??null}let n={regex:`ورودي`,email:`بریښنالیک`,url:`یو آر ال`,emoji:`ایموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`نیټه او وخت`,date:`نېټه`,time:`وخت`,duration:`موده`,ipv4:`د IPv4 پته`,ipv6:`د IPv6 پته`,cidrv4:`د IPv4 ساحه`,cidrv6:`د IPv6 ساحه`,base64:`base64-encoded متن`,base64url:`base64url-encoded متن`,json_string:`JSON متن`,e164:`د E.164 شمېره`,jwt:`JWT`,template_literal:`ورودي`},r={nan:`NaN`,number:`عدد`,array:`ارې`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ناسم ورودي: باید instanceof ${e.expected} وای, مګر ${i} ترلاسه شو`:`ناسم ورودي: باید ${t} وای, مګر ${i} ترلاسه شو`}case`invalid_value`:return e.values.length===1?`ناسم ورودي: باید ${x(e.values[0])} وای`:`ناسم انتخاب: باید یو له ${C(e.values,`|`)} څخه وای`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصرونه`} ولري`:`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} وي`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} ولري`:`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} وي`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ناسم متن: باید د "${t.prefix}" سره پیل شي`:t.format===`ends_with`?`ناسم متن: باید د "${t.suffix}" سره پای ته ورسيږي`:t.format===`includes`?`ناسم متن: باید "${t.includes}" ولري`:t.format===`regex`?`ناسم متن: باید د ${t.pattern} سره مطابقت ولري`:`${n[t.format]??e.format} ناسم دی`}case`not_multiple_of`:return`ناسم عدد: باید د ${e.divisor} مضرب وي`;case`unrecognized_keys`:return`ناسم ${e.keys.length>1?`کلیډونه`:`کلیډ`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`ناسم کلیډ په ${e.origin} کې`;case`invalid_union`:return`ناسمه ورودي`;case`invalid_element`:return`ناسم عنصر په ${e.origin} کې`;default:return`ناسمه ورودي`}}};function Xu(){return{localeError:Yu()}}const Zu=()=>{let e={string:{unit:`znaków`,verb:`mieć`},file:{unit:`bajtów`,verb:`mieć`},array:{unit:`elementów`,verb:`mieć`},set:{unit:`elementów`,verb:`mieć`}};function t(t){return e[t]??null}let n={regex:`wyrażenie`,email:`adres email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i godzina w formacie ISO`,date:`data w formacie ISO`,time:`godzina w formacie ISO`,duration:`czas trwania ISO`,ipv4:`adres IPv4`,ipv6:`adres IPv6`,cidrv4:`zakres IPv4`,cidrv6:`zakres IPv6`,base64:`ciąg znaków zakodowany w formacie base64`,base64url:`ciąg znaków zakodowany w formacie base64url`,json_string:`ciąg znaków w formacie JSON`,e164:`liczba E.164`,jwt:`JWT`,template_literal:`wejście`},r={nan:`NaN`,number:`liczba`,array:`tablica`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${e.expected}, otrzymano ${i}`:`Nieprawidłowe dane wejściowe: oczekiwano ${t}, otrzymano ${i}`}case`invalid_value`:return e.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${x(e.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Za duża wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.maximum.toString()} ${r.unit??`elementów`}`:`Zbyt duż(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Za mała wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.minimum.toString()} ${r.unit??`elementów`}`:`Zbyt mał(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${t.prefix}"`:t.format===`ends_with`?`Nieprawidłowy ciąg znaków: musi kończyć się na "${t.suffix}"`:t.format===`includes`?`Nieprawidłowy ciąg znaków: musi zawierać "${t.includes}"`:t.format===`regex`?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}`:`Nieprawidłow(y/a/e) ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nieprawidłowa liczba: musi być wielokrotnością ${e.divisor}`;case`unrecognized_keys`:return`Nierozpoznane klucze${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Nieprawidłowy klucz w ${e.origin}`;case`invalid_union`:return`Nieprawidłowe dane wejściowe`;case`invalid_element`:return`Nieprawidłowa wartość w ${e.origin}`;default:return`Nieprawidłowe dane wejściowe`}}};function Qu(){return{localeError:Zu()}}const $u=()=>{let e={string:{unit:`caracteres`,verb:`ter`},file:{unit:`bytes`,verb:`ter`},array:{unit:`itens`,verb:`ter`},set:{unit:`itens`,verb:`ter`}};function t(t){return e[t]??null}let n={regex:`padrão`,email:`endereço de e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`duração ISO`,ipv4:`endereço IPv4`,ipv6:`endereço IPv6`,cidrv4:`faixa de IPv4`,cidrv6:`faixa de IPv6`,base64:`texto codificado em base64`,base64url:`URL codificada em base64`,json_string:`texto JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`},r={nan:`NaN`,number:`número`,null:`nulo`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Tipo inválido: esperado instanceof ${e.expected}, recebido ${i}`:`Tipo inválido: esperado ${t}, recebido ${i}`}case`invalid_value`:return e.values.length===1?`Entrada inválida: esperado ${x(e.values[0])}`:`Opção inválida: esperada uma das ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Muito grande: esperado que ${e.origin??`valor`} tivesse ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Muito grande: esperado que ${e.origin??`valor`} fosse ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Muito pequeno: esperado que ${e.origin} tivesse ${n}${e.minimum.toString()} ${r.unit}`:`Muito pequeno: esperado que ${e.origin} fosse ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Texto inválido: deve começar com "${t.prefix}"`:t.format===`ends_with`?`Texto inválido: deve terminar com "${t.suffix}"`:t.format===`includes`?`Texto inválido: deve incluir "${t.includes}"`:t.format===`regex`?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`${n[t.format]??e.format} inválido`}case`not_multiple_of`:return`Número inválido: deve ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Chave${e.keys.length>1?`s`:``} desconhecida${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Chave inválida em ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido em ${e.origin}`;default:return`Campo inválido`}}};function ed(){return{localeError:$u()}}function td(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}const nd=()=>{let e={string:{unit:{one:`символ`,few:`символа`,many:`символов`},verb:`иметь`},file:{unit:{one:`байт`,few:`байта`,many:`байт`},verb:`иметь`},array:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`},set:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`}};function t(t){return e[t]??null}let n={regex:`ввод`,email:`email адрес`,url:`URL`,emoji:`эмодзи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата и время`,date:`ISO дата`,time:`ISO время`,duration:`ISO длительность`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`строка в формате base64`,base64url:`строка в формате base64url`,json_string:`JSON строка`,e164:`номер E.164`,jwt:`JWT`,template_literal:`ввод`},r={nan:`NaN`,number:`число`,array:`массив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неверный ввод: ожидалось instanceof ${e.expected}, получено ${i}`:`Неверный ввод: ожидалось ${t}, получено ${i}`}case`invalid_value`:return e.values.length===1?`Неверный ввод: ожидалось ${x(e.values[0])}`:`Неверный вариант: ожидалось одно из ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=td(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет иметь ${n}${e.maximum.toString()} ${t}`}return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=td(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`}return`Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неверная строка: должна начинаться с "${t.prefix}"`:t.format===`ends_with`?`Неверная строка: должна заканчиваться на "${t.suffix}"`:t.format===`includes`?`Неверная строка: должна содержать "${t.includes}"`:t.format===`regex`?`Неверная строка: должна соответствовать шаблону ${t.pattern}`:`Неверный ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неверное число: должно быть кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспознанн${e.keys.length>1?`ые`:`ый`} ключ${e.keys.length>1?`и`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Неверный ключ в ${e.origin}`;case`invalid_union`:return`Неверные входные данные`;case`invalid_element`:return`Неверное значение в ${e.origin}`;default:return`Неверные входные данные`}}};function rd(){return{localeError:nd()}}const id=()=>{let e={string:{unit:`znakov`,verb:`imeti`},file:{unit:`bajtov`,verb:`imeti`},array:{unit:`elementov`,verb:`imeti`},set:{unit:`elementov`,verb:`imeti`}};function t(t){return e[t]??null}let n={regex:`vnos`,email:`e-poštni naslov`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum in čas`,date:`ISO datum`,time:`ISO čas`,duration:`ISO trajanje`,ipv4:`IPv4 naslov`,ipv6:`IPv6 naslov`,cidrv4:`obseg IPv4`,cidrv6:`obseg IPv6`,base64:`base64 kodiran niz`,base64url:`base64url kodiran niz`,json_string:`JSON niz`,e164:`E.164 številka`,jwt:`JWT`,template_literal:`vnos`},r={nan:`NaN`,number:`število`,array:`tabela`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neveljaven vnos: pričakovano instanceof ${e.expected}, prejeto ${i}`:`Neveljaven vnos: pričakovano ${t}, prejeto ${i}`}case`invalid_value`:return e.values.length===1?`Neveljaven vnos: pričakovano ${x(e.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} imelo ${n}${e.maximum.toString()} ${r.unit??`elementov`}`:`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Premajhno: pričakovano, da bo ${e.origin} imelo ${n}${e.minimum.toString()} ${r.unit}`:`Premajhno: pričakovano, da bo ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neveljaven niz: mora se začeti z "${t.prefix}"`:t.format===`ends_with`?`Neveljaven niz: mora se končati z "${t.suffix}"`:t.format===`includes`?`Neveljaven niz: mora vsebovati "${t.includes}"`:t.format===`regex`?`Neveljaven niz: mora ustrezati vzorcu ${t.pattern}`:`Neveljaven ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neveljavno število: mora biti večkratnik ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznan${e.keys.length>1?`i ključi`:` ključ`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Neveljaven ključ v ${e.origin}`;case`invalid_union`:return`Neveljaven vnos`;case`invalid_element`:return`Neveljavna vrednost v ${e.origin}`;default:return`Neveljaven vnos`}}};function ad(){return{localeError:id()}}const od=()=>{let e={string:{unit:`tecken`,verb:`att ha`},file:{unit:`bytes`,verb:`att ha`},array:{unit:`objekt`,verb:`att innehålla`},set:{unit:`objekt`,verb:`att innehålla`}};function t(t){return e[t]??null}let n={regex:`reguljärt uttryck`,email:`e-postadress`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datum och tid`,date:`ISO-datum`,time:`ISO-tid`,duration:`ISO-varaktighet`,ipv4:`IPv4-intervall`,ipv6:`IPv6-intervall`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodad sträng`,base64url:`base64url-kodad sträng`,json_string:`JSON-sträng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`mall-literal`},r={nan:`NaN`,number:`antal`,array:`lista`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ogiltig inmatning: förväntat instanceof ${e.expected}, fick ${i}`:`Ogiltig inmatning: förväntat ${t}, fick ${i}`}case`invalid_value`:return e.values.length===1?`Ogiltig inmatning: förväntat ${x(e.values[0])}`:`Ogiltigt val: förväntade en av ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`För stor(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()} ${r.unit??`element`}`:`För stor(t): förväntat ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()} ${r.unit}`:`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ogiltig sträng: måste börja med "${t.prefix}"`:t.format===`ends_with`?`Ogiltig sträng: måste sluta med "${t.suffix}"`:t.format===`includes`?`Ogiltig sträng: måste innehålla "${t.includes}"`:t.format===`regex`?`Ogiltig sträng: måste matcha mönstret "${t.pattern}"`:`Ogiltig(t) ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ogiltigt tal: måste vara en multipel av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Okända nycklar`:`Okänd nyckel`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Ogiltig nyckel i ${e.origin??`värdet`}`;case`invalid_union`:return`Ogiltig input`;case`invalid_element`:return`Ogiltigt värde i ${e.origin??`värdet`}`;default:return`Ogiltig input`}}};function sd(){return{localeError:od()}}const cd=()=>{let e={string:{unit:`எழுத்துக்கள்`,verb:`கொண்டிருக்க வேண்டும்`},file:{unit:`பைட்டுகள்`,verb:`கொண்டிருக்க வேண்டும்`},array:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},set:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`}};function t(t){return e[t]??null}let n={regex:`உள்ளீடு`,email:`மின்னஞ்சல் முகவரி`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO தேதி நேரம்`,date:`ISO தேதி`,time:`ISO நேரம்`,duration:`ISO கால அளவு`,ipv4:`IPv4 முகவரி`,ipv6:`IPv6 முகவரி`,cidrv4:`IPv4 வரம்பு`,cidrv6:`IPv6 வரம்பு`,base64:`base64-encoded சரம்`,base64url:`base64url-encoded சரம்`,json_string:`JSON சரம்`,e164:`E.164 எண்`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`எண்`,array:`அணி`,null:`வெறுமை`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${e.expected}, பெறப்பட்டது ${i}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${t}, பெறப்பட்டது ${i}`}case`invalid_value`:return e.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${x(e.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${C(e.values,`|`)} இல் ஒன்று`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ${r.unit??`உறுப்புகள்`} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ஆக இருக்க வேண்டும்`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ஆக இருக்க வேண்டும்`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`தவறான சரம்: "${t.prefix}" இல் தொடங்க வேண்டும்`:t.format===`ends_with`?`தவறான சரம்: "${t.suffix}" இல் முடிவடைய வேண்டும்`:t.format===`includes`?`தவறான சரம்: "${t.includes}" ஐ உள்ளடக்க வேண்டும்`:t.format===`regex`?`தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${n[t.format]??e.format}`}case`not_multiple_of`:return`தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`;case`unrecognized_keys`:return`அடையாளம் தெரியாத விசை${e.keys.length>1?`கள்`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} இல் தவறான விசை`;case`invalid_union`:return`தவறான உள்ளீடு`;case`invalid_element`:return`${e.origin} இல் தவறான மதிப்பு`;default:return`தவறான உள்ளீடு`}}};function ld(){return{localeError:cd()}}const ud=()=>{let e={string:{unit:`ตัวอักษร`,verb:`ควรมี`},file:{unit:`ไบต์`,verb:`ควรมี`},array:{unit:`รายการ`,verb:`ควรมี`},set:{unit:`รายการ`,verb:`ควรมี`}};function t(t){return e[t]??null}let n={regex:`ข้อมูลที่ป้อน`,email:`ที่อยู่อีเมล`,url:`URL`,emoji:`อิโมจิ`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`วันที่เวลาแบบ ISO`,date:`วันที่แบบ ISO`,time:`เวลาแบบ ISO`,duration:`ช่วงเวลาแบบ ISO`,ipv4:`ที่อยู่ IPv4`,ipv6:`ที่อยู่ IPv6`,cidrv4:`ช่วง IP แบบ IPv4`,cidrv6:`ช่วง IP แบบ IPv6`,base64:`ข้อความแบบ Base64`,base64url:`ข้อความแบบ Base64 สำหรับ URL`,json_string:`ข้อความแบบ JSON`,e164:`เบอร์โทรศัพท์ระหว่างประเทศ (E.164)`,jwt:`โทเคน JWT`,template_literal:`ข้อมูลที่ป้อน`},r={nan:`NaN`,number:`ตัวเลข`,array:`อาร์เรย์ (Array)`,null:`ไม่มีค่า (null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${e.expected} แต่ได้รับ ${i}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${t} แต่ได้รับ ${i}`}case`invalid_value`:return e.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${x(e.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`ไม่เกิน`:`น้อยกว่า`,r=t(e.origin);return r?`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()} ${r.unit??`รายการ`}`:`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`อย่างน้อย`:`มากกว่า`,r=t(e.origin);return r?`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()} ${r.unit}`:`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${t.prefix}"`:t.format===`ends_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${t.suffix}"`:t.format===`includes`?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${t.includes}" อยู่ในข้อความ`:t.format===`regex`?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}`:`รูปแบบไม่ถูกต้อง: ${n[t.format]??e.format}`}case`not_multiple_of`:return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`;case`unrecognized_keys`:return`พบคีย์ที่ไม่รู้จัก: ${C(e.keys,`, `)}`;case`invalid_key`:return`คีย์ไม่ถูกต้องใน ${e.origin}`;case`invalid_union`:return`ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`;case`invalid_element`:return`ข้อมูลไม่ถูกต้องใน ${e.origin}`;default:return`ข้อมูลไม่ถูกต้อง`}}};function dd(){return{localeError:ud()}}const fd=()=>{let e={string:{unit:`karakter`,verb:`olmalı`},file:{unit:`bayt`,verb:`olmalı`},array:{unit:`öğe`,verb:`olmalı`},set:{unit:`öğe`,verb:`olmalı`}};function t(t){return e[t]??null}let n={regex:`girdi`,email:`e-posta adresi`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO tarih ve saat`,date:`ISO tarih`,time:`ISO saat`,duration:`ISO süre`,ipv4:`IPv4 adresi`,ipv6:`IPv6 adresi`,cidrv4:`IPv4 aralığı`,cidrv6:`IPv6 aralığı`,base64:`base64 ile şifrelenmiş metin`,base64url:`base64url ile şifrelenmiş metin`,json_string:`JSON dizesi`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`Şablon dizesi`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Geçersiz değer: beklenen instanceof ${e.expected}, alınan ${i}`:`Geçersiz değer: beklenen ${t}, alınan ${i}`}case`invalid_value`:return e.values.length===1?`Geçersiz değer: beklenen ${x(e.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()} ${r.unit??`öğe`}`:`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Geçersiz metin: "${t.prefix}" ile başlamalı`:t.format===`ends_with`?`Geçersiz metin: "${t.suffix}" ile bitmeli`:t.format===`includes`?`Geçersiz metin: "${t.includes}" içermeli`:t.format===`regex`?`Geçersiz metin: ${t.pattern} desenine uymalı`:`Geçersiz ${n[t.format]??e.format}`}case`not_multiple_of`:return`Geçersiz sayı: ${e.divisor} ile tam bölünebilmeli`;case`unrecognized_keys`:return`Tanınmayan anahtar${e.keys.length>1?`lar`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} içinde geçersiz anahtar`;case`invalid_union`:return`Geçersiz değer`;case`invalid_element`:return`${e.origin} içinde geçersiz değer`;default:return`Geçersiz değer`}}};function pd(){return{localeError:fd()}}const md=()=>{let e={string:{unit:`символів`,verb:`матиме`},file:{unit:`байтів`,verb:`матиме`},array:{unit:`елементів`,verb:`матиме`},set:{unit:`елементів`,verb:`матиме`}};function t(t){return e[t]??null}let n={regex:`вхідні дані`,email:`адреса електронної пошти`,url:`URL`,emoji:`емодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`дата та час ISO`,date:`дата ISO`,time:`час ISO`,duration:`тривалість ISO`,ipv4:`адреса IPv4`,ipv6:`адреса IPv6`,cidrv4:`діапазон IPv4`,cidrv6:`діапазон IPv6`,base64:`рядок у кодуванні base64`,base64url:`рядок у кодуванні base64url`,json_string:`рядок JSON`,e164:`номер E.164`,jwt:`JWT`,template_literal:`вхідні дані`},r={nan:`NaN`,number:`число`,array:`масив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неправильні вхідні дані: очікується instanceof ${e.expected}, отримано ${i}`:`Неправильні вхідні дані: очікується ${t}, отримано ${i}`}case`invalid_value`:return e.values.length===1?`Неправильні вхідні дані: очікується ${x(e.values[0])}`:`Неправильна опція: очікується одне з ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Занадто велике: очікується, що ${e.origin??`значення`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`елементів`}`:`Занадто велике: очікується, що ${e.origin??`значення`} буде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Занадто мале: очікується, що ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Занадто мале: очікується, що ${e.origin} буде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неправильний рядок: повинен починатися з "${t.prefix}"`:t.format===`ends_with`?`Неправильний рядок: повинен закінчуватися на "${t.suffix}"`:t.format===`includes`?`Неправильний рядок: повинен містити "${t.includes}"`:t.format===`regex`?`Неправильний рядок: повинен відповідати шаблону ${t.pattern}`:`Неправильний ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неправильне число: повинно бути кратним ${e.divisor}`;case`unrecognized_keys`:return`Нерозпізнаний ключ${e.keys.length>1?`і`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Неправильний ключ у ${e.origin}`;case`invalid_union`:return`Неправильні вхідні дані`;case`invalid_element`:return`Неправильне значення у ${e.origin}`;default:return`Неправильні вхідні дані`}}};function hd(){return{localeError:md()}}function gd(){return hd()}const _d=()=>{let e={string:{unit:`حروف`,verb:`ہونا`},file:{unit:`بائٹس`,verb:`ہونا`},array:{unit:`آئٹمز`,verb:`ہونا`},set:{unit:`آئٹمز`,verb:`ہونا`}};function t(t){return e[t]??null}let n={regex:`ان پٹ`,email:`ای میل ایڈریس`,url:`یو آر ایل`,emoji:`ایموجی`,uuid:`یو یو آئی ڈی`,uuidv4:`یو یو آئی ڈی وی 4`,uuidv6:`یو یو آئی ڈی وی 6`,nanoid:`نینو آئی ڈی`,guid:`جی یو آئی ڈی`,cuid:`سی یو آئی ڈی`,cuid2:`سی یو آئی ڈی 2`,ulid:`یو ایل آئی ڈی`,xid:`ایکس آئی ڈی`,ksuid:`کے ایس یو آئی ڈی`,datetime:`آئی ایس او ڈیٹ ٹائم`,date:`آئی ایس او تاریخ`,time:`آئی ایس او وقت`,duration:`آئی ایس او مدت`,ipv4:`آئی پی وی 4 ایڈریس`,ipv6:`آئی پی وی 6 ایڈریس`,cidrv4:`آئی پی وی 4 رینج`,cidrv6:`آئی پی وی 6 رینج`,base64:`بیس 64 ان کوڈڈ سٹرنگ`,base64url:`بیس 64 یو آر ایل ان کوڈڈ سٹرنگ`,json_string:`جے ایس او این سٹرنگ`,e164:`ای 164 نمبر`,jwt:`جے ڈبلیو ٹی`,template_literal:`ان پٹ`},r={nan:`NaN`,number:`نمبر`,array:`آرے`,null:`نل`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`غلط ان پٹ: instanceof ${e.expected} متوقع تھا، ${i} موصول ہوا`:`غلط ان پٹ: ${t} متوقع تھا، ${i} موصول ہوا`}case`invalid_value`:return e.values.length===1?`غلط ان پٹ: ${x(e.values[0])} متوقع تھا`:`غلط آپشن: ${C(e.values,`|`)} میں سے ایک متوقع تھا`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`بہت بڑا: ${e.origin??`ویلیو`} کے ${n}${e.maximum.toString()} ${r.unit??`عناصر`} ہونے متوقع تھے`:`بہت بڑا: ${e.origin??`ویلیو`} کا ${n}${e.maximum.toString()} ہونا متوقع تھا`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`بہت چھوٹا: ${e.origin} کے ${n}${e.minimum.toString()} ${r.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${e.origin} کا ${n}${e.minimum.toString()} ہونا متوقع تھا`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`غلط سٹرنگ: "${t.prefix}" سے شروع ہونا چاہیے`:t.format===`ends_with`?`غلط سٹرنگ: "${t.suffix}" پر ختم ہونا چاہیے`:t.format===`includes`?`غلط سٹرنگ: "${t.includes}" شامل ہونا چاہیے`:t.format===`regex`?`غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے`:`غلط ${n[t.format]??e.format}`}case`not_multiple_of`:return`غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`;case`unrecognized_keys`:return`غیر تسلیم شدہ کی${e.keys.length>1?`ز`:``}: ${C(e.keys,`، `)}`;case`invalid_key`:return`${e.origin} میں غلط کی`;case`invalid_union`:return`غلط ان پٹ`;case`invalid_element`:return`${e.origin} میں غلط ویلیو`;default:return`غلط ان پٹ`}}};function vd(){return{localeError:_d()}}const yd=()=>{let e={string:{unit:`belgi`,verb:`bo‘lishi kerak`},file:{unit:`bayt`,verb:`bo‘lishi kerak`},array:{unit:`element`,verb:`bo‘lishi kerak`},set:{unit:`element`,verb:`bo‘lishi kerak`}};function t(t){return e[t]??null}let n={regex:`kirish`,email:`elektron pochta manzili`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO sana va vaqti`,date:`ISO sana`,time:`ISO vaqt`,duration:`ISO davomiylik`,ipv4:`IPv4 manzil`,ipv6:`IPv6 manzil`,mac:`MAC manzil`,cidrv4:`IPv4 diapazon`,cidrv6:`IPv6 diapazon`,base64:`base64 kodlangan satr`,base64url:`base64url kodlangan satr`,json_string:`JSON satr`,e164:`E.164 raqam`,jwt:`JWT`,template_literal:`kirish`},r={nan:`NaN`,number:`raqam`,array:`massiv`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${e.expected}, qabul qilingan ${i}`:`Noto‘g‘ri kirish: kutilgan ${t}, qabul qilingan ${i}`}case`invalid_value`:return e.values.length===1?`Noto‘g‘ri kirish: kutilgan ${x(e.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Juda katta: kutilgan ${e.origin??`qiymat`} ${n}${e.maximum.toString()} ${r.unit} ${r.verb}`:`Juda katta: kutilgan ${e.origin??`qiymat`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Noto‘g‘ri satr: "${t.prefix}" bilan boshlanishi kerak`:t.format===`ends_with`?`Noto‘g‘ri satr: "${t.suffix}" bilan tugashi kerak`:t.format===`includes`?`Noto‘g‘ri satr: "${t.includes}" ni o‘z ichiga olishi kerak`:t.format===`regex`?`Noto‘g‘ri satr: ${t.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${n[t.format]??e.format}`}case`not_multiple_of`:return`Noto‘g‘ri raqam: ${e.divisor} ning karralisi bo‘lishi kerak`;case`unrecognized_keys`:return`Noma’lum kalit${e.keys.length>1?`lar`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} dagi kalit noto‘g‘ri`;case`invalid_union`:return`Noto‘g‘ri kirish`;case`invalid_element`:return`${e.origin} da noto‘g‘ri qiymat`;default:return`Noto‘g‘ri kirish`}}};function bd(){return{localeError:yd()}}const xd=()=>{let e={string:{unit:`ký tự`,verb:`có`},file:{unit:`byte`,verb:`có`},array:{unit:`phần tử`,verb:`có`},set:{unit:`phần tử`,verb:`có`}};function t(t){return e[t]??null}let n={regex:`đầu vào`,email:`địa chỉ email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ngày giờ ISO`,date:`ngày ISO`,time:`giờ ISO`,duration:`khoảng thời gian ISO`,ipv4:`địa chỉ IPv4`,ipv6:`địa chỉ IPv6`,cidrv4:`dải IPv4`,cidrv6:`dải IPv6`,base64:`chuỗi mã hóa base64`,base64url:`chuỗi mã hóa base64url`,json_string:`chuỗi JSON`,e164:`số E.164`,jwt:`JWT`,template_literal:`đầu vào`},r={nan:`NaN`,number:`số`,array:`mảng`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${e.expected}, nhận được ${i}`:`Đầu vào không hợp lệ: mong đợi ${t}, nhận được ${i}`}case`invalid_value`:return e.values.length===1?`Đầu vào không hợp lệ: mong đợi ${x(e.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Quá lớn: mong đợi ${e.origin??`giá trị`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`phần tử`}`:`Quá lớn: mong đợi ${e.origin??`giá trị`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Quá nhỏ: mong đợi ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Quá nhỏ: mong đợi ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chuỗi không hợp lệ: phải bắt đầu bằng "${t.prefix}"`:t.format===`ends_with`?`Chuỗi không hợp lệ: phải kết thúc bằng "${t.suffix}"`:t.format===`includes`?`Chuỗi không hợp lệ: phải bao gồm "${t.includes}"`:t.format===`regex`?`Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}`:`${n[t.format]??e.format} không hợp lệ`}case`not_multiple_of`:return`Số không hợp lệ: phải là bội số của ${e.divisor}`;case`unrecognized_keys`:return`Khóa không được nhận dạng: ${C(e.keys,`, `)}`;case`invalid_key`:return`Khóa không hợp lệ trong ${e.origin}`;case`invalid_union`:return`Đầu vào không hợp lệ`;case`invalid_element`:return`Giá trị không hợp lệ trong ${e.origin}`;default:return`Đầu vào không hợp lệ`}}};function Sd(){return{localeError:xd()}}const Cd=()=>{let e={string:{unit:`字符`,verb:`包含`},file:{unit:`字节`,verb:`包含`},array:{unit:`项`,verb:`包含`},set:{unit:`项`,verb:`包含`}};function t(t){return e[t]??null}let n={regex:`输入`,email:`电子邮件`,url:`URL`,emoji:`表情符号`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日期时间`,date:`ISO日期`,time:`ISO时间`,duration:`ISO时长`,ipv4:`IPv4地址`,ipv6:`IPv6地址`,cidrv4:`IPv4网段`,cidrv6:`IPv6网段`,base64:`base64编码字符串`,base64url:`base64url编码字符串`,json_string:`JSON字符串`,e164:`E.164号码`,jwt:`JWT`,template_literal:`输入`},r={nan:`NaN`,number:`数字`,array:`数组`,null:`空值(null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`无效输入:期望 instanceof ${e.expected},实际接收 ${i}`:`无效输入:期望 ${t},实际接收 ${i}`}case`invalid_value`:return e.values.length===1?`无效输入:期望 ${x(e.values[0])}`:`无效选项:期望以下之一 ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()} ${r.unit??`个元素`}`:`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`无效字符串:必须以 "${t.prefix}" 开头`:t.format===`ends_with`?`无效字符串:必须以 "${t.suffix}" 结尾`:t.format===`includes`?`无效字符串:必须包含 "${t.includes}"`:t.format===`regex`?`无效字符串:必须满足正则表达式 ${t.pattern}`:`无效${n[t.format]??e.format}`}case`not_multiple_of`:return`无效数字:必须是 ${e.divisor} 的倍数`;case`unrecognized_keys`:return`出现未知的键(key): ${C(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} 中的键(key)无效`;case`invalid_union`:return`无效输入`;case`invalid_element`:return`${e.origin} 中包含无效值(value)`;default:return`无效输入`}}};function wd(){return{localeError:Cd()}}const Td=()=>{let e={string:{unit:`字元`,verb:`擁有`},file:{unit:`位元組`,verb:`擁有`},array:{unit:`項目`,verb:`擁有`},set:{unit:`項目`,verb:`擁有`}};function t(t){return e[t]??null}let n={regex:`輸入`,email:`郵件地址`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 日期時間`,date:`ISO 日期`,time:`ISO 時間`,duration:`ISO 期間`,ipv4:`IPv4 位址`,ipv6:`IPv6 位址`,cidrv4:`IPv4 範圍`,cidrv6:`IPv6 範圍`,base64:`base64 編碼字串`,base64url:`base64url 編碼字串`,json_string:`JSON 字串`,e164:`E.164 數值`,jwt:`JWT`,template_literal:`輸入`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`無效的輸入值:預期為 instanceof ${e.expected},但收到 ${i}`:`無效的輸入值:預期為 ${t},但收到 ${i}`}case`invalid_value`:return e.values.length===1?`無效的輸入值:預期為 ${x(e.values[0])}`:`無效的選項:預期為以下其中之一 ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()} ${r.unit??`個元素`}`:`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()} ${r.unit}`:`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無效的字串:必須以 "${t.prefix}" 開頭`:t.format===`ends_with`?`無效的字串:必須以 "${t.suffix}" 結尾`:t.format===`includes`?`無效的字串:必須包含 "${t.includes}"`:t.format===`regex`?`無效的字串:必須符合格式 ${t.pattern}`:`無效的 ${n[t.format]??e.format}`}case`not_multiple_of`:return`無效的數字:必須為 ${e.divisor} 的倍數`;case`unrecognized_keys`:return`無法識別的鍵值${e.keys.length>1?`們`:``}:${C(e.keys,`、`)}`;case`invalid_key`:return`${e.origin} 中有無效的鍵值`;case`invalid_union`:return`無效的輸入值`;case`invalid_element`:return`${e.origin} 中有無效的值`;default:return`無效的輸入值`}}};function Ed(){return{localeError:Td()}}const Dd=()=>{let e={string:{unit:`àmi`,verb:`ní`},file:{unit:`bytes`,verb:`ní`},array:{unit:`nkan`,verb:`ní`},set:{unit:`nkan`,verb:`ní`}};function t(t){return e[t]??null}let n={regex:`ẹ̀rọ ìbáwọlé`,email:`àdírẹ́sì ìmẹ́lì`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`àkókò ISO`,date:`ọjọ́ ISO`,time:`àkókò ISO`,duration:`àkókò tó pé ISO`,ipv4:`àdírẹ́sì IPv4`,ipv6:`àdírẹ́sì IPv6`,cidrv4:`àgbègbè IPv4`,cidrv6:`àgbègbè IPv6`,base64:`ọ̀rọ̀ tí a kọ́ ní base64`,base64url:`ọ̀rọ̀ base64url`,json_string:`ọ̀rọ̀ JSON`,e164:`nọ́mbà E.164`,jwt:`JWT`,template_literal:`ẹ̀rọ ìbáwọlé`},r={nan:`NaN`,number:`nọ́mbà`,array:`akopọ`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${e.expected}, àmọ̀ a rí ${i}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${t}, àmọ̀ a rí ${i}`}case`invalid_value`:return e.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${x(e.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tó pọ̀ jù: a ní láti jẹ́ pé ${e.origin??`iye`} ${r.verb} ${n}${e.maximum} ${r.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${n}${e.maximum}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Kéré ju: a ní láti jẹ́ pé ${e.origin} ${r.verb} ${n}${e.minimum} ${r.unit}`:`Kéré ju: a ní láti jẹ́ ${n}${e.minimum}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${t.prefix}"`:t.format===`ends_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${t.suffix}"`:t.format===`includes`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${t.includes}"`:t.format===`regex`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${t.pattern}`:`Aṣìṣe: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${e.divisor}`;case`unrecognized_keys`:return`Bọtìnì àìmọ̀: ${C(e.keys,`, `)}`;case`invalid_key`:return`Bọtìnì aṣìṣe nínú ${e.origin}`;case`invalid_union`:return`Ìbáwọlé aṣìṣe`;case`invalid_element`:return`Iye aṣìṣe nínú ${e.origin}`;default:return`Ìbáwọlé aṣìṣe`}}};function Od(){return{localeError:Dd()}}var kd=r({ar:()=>Il,az:()=>Rl,be:()=>Vl,bg:()=>Ul,ca:()=>Gl,cs:()=>ql,da:()=>Yl,de:()=>Zl,en:()=>$l,eo:()=>tu,es:()=>ru,fa:()=>au,fi:()=>su,fr:()=>lu,frCA:()=>du,he:()=>pu,hu:()=>hu,hy:()=>yu,id:()=>xu,is:()=>Cu,it:()=>Tu,ja:()=>Du,ka:()=>ku,kh:()=>Mu,km:()=>ju,ko:()=>Pu,lt:()=>Ru,mk:()=>Bu,ms:()=>Hu,nl:()=>Wu,no:()=>Ku,ota:()=>Ju,pl:()=>Qu,ps:()=>Xu,pt:()=>ed,ru:()=>rd,sl:()=>ad,sv:()=>sd,ta:()=>ld,th:()=>dd,tr:()=>pd,ua:()=>gd,uk:()=>hd,ur:()=>vd,uz:()=>bd,vi:()=>Sd,yo:()=>Od,zhCN:()=>wd,zhTW:()=>Ed}),Ad=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??`draft-2020-12`;t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),this.ctx=ao({processors:be,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return re(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),Ae(this.ctx,e);let{"~standard":n,...r}=_n(this.ctx,e);return r}},jd=r({}),Md=r({$ZodAny:()=>_r,$ZodArray:()=>Pr,$ZodAsyncError:()=>Qs,$ZodBase64:()=>rt,$ZodBase64URL:()=>Lt,$ZodBigInt:()=>cs,$ZodBigIntFormat:()=>Ot,$ZodBoolean:()=>Xr,$ZodCIDRv4:()=>Hr,$ZodCIDRv6:()=>ai,$ZodCUID:()=>Fn,$ZodCUID2:()=>v,$ZodCatch:()=>ua,$ZodCheck:()=>Yo,$ZodCheckBigIntFormat:()=>So,$ZodCheckEndsWith:()=>ja,$ZodCheckGreaterThan:()=>Sa,$ZodCheckIncludes:()=>di,$ZodCheckLengthEquals:()=>Xs,$ZodCheckLessThan:()=>wc,$ZodCheckLowerCase:()=>ki,$ZodCheckMaxLength:()=>hc,$ZodCheckMaxSize:()=>Xn,$ZodCheckMimeType:()=>ye,$ZodCheckMinLength:()=>oc,$ZodCheckMinSize:()=>or,$ZodCheckMultipleOf:()=>Re,$ZodCheckNumberFormat:()=>ke,$ZodCheckOverwrite:()=>gn,$ZodCheckProperty:()=>io,$ZodCheckRegex:()=>ne,$ZodCheckSizeEquals:()=>Ya,$ZodCheckStartsWith:()=>Qt,$ZodCheckStringFormat:()=>cn,$ZodCheckUpperCase:()=>wn,$ZodCodec:()=>Rs,$ZodCustom:()=>Io,$ZodCustomStringFormat:()=>bs,$ZodDate:()=>Ga,$ZodDefault:()=>Ei,$ZodDiscriminatedUnion:()=>Go,$ZodE164:()=>ks,$ZodEmail:()=>Gi,$ZodEmoji:()=>yo,$ZodEncodeError:()=>Ec,$ZodEnum:()=>qs,$ZodError:()=>Vo,$ZodExactOptional:()=>ta,$ZodFile:()=>va,$ZodFunction:()=>ts,$ZodGUID:()=>Do,$ZodIPv4:()=>Ia,$ZodIPv6:()=>Da,$ZodISODate:()=>_i,$ZodISODateTime:()=>nc,$ZodISODuration:()=>Ac,$ZodISOTime:()=>Fi,$ZodIntersection:()=>xc,$ZodJWT:()=>nr,$ZodKSUID:()=>Te,$ZodLazy:()=>fc,$ZodLiteral:()=>dr,$ZodMAC:()=>Ue,$ZodMap:()=>Pe,$ZodNaN:()=>xn,$ZodNanoID:()=>lo,$ZodNever:()=>se,$ZodNonOptional:()=>eo,$ZodNull:()=>rn,$ZodNullable:()=>pn,$ZodNumber:()=>kn,$ZodNumberFormat:()=>Ze,$ZodObject:()=>St,$ZodObjectJIT:()=>Jt,$ZodOptional:()=>Kn,$ZodPipe:()=>zc,$ZodPrefault:()=>he,$ZodPromise:()=>Or,$ZodReadonly:()=>pt,$ZodRealError:()=>Ts,$ZodRecord:()=>yr,$ZodRegistry:()=>Wn,$ZodSet:()=>Ir,$ZodString:()=>at,$ZodStringFormat:()=>zt,$ZodSuccess:()=>us,$ZodSymbol:()=>At,$ZodTemplateLiteral:()=>Qr,$ZodTransform:()=>Wr,$ZodTuple:()=>si,$ZodType:()=>Ln,$ZodULID:()=>b,$ZodURL:()=>ia,$ZodUUID:()=>Ms,$ZodUndefined:()=>Ao,$ZodUnion:()=>ms,$ZodUnknown:()=>za,$ZodVoid:()=>bi,$ZodXID:()=>zo,$ZodXor:()=>Cs,$brand:()=>ji,$constructor:()=>_c,$input:()=>Lc,$output:()=>pe,Doc:()=>fa,JSONSchema:()=>jd,JSONSchemaGenerator:()=>Ad,NEVER:()=>Qn,TimePrecision:()=>Xa,_any:()=>$t,_array:()=>ln,_base64:()=>Tn,_base64url:()=>qe,_bigint:()=>vt,_boolean:()=>Wt,_catch:()=>Hn,_check:()=>Fc,_cidrv4:()=>de,_cidrv6:()=>wr,_coercedBigint:()=>lt,_coercedBoolean:()=>hr,_coercedDate:()=>Mr,_coercedNumber:()=>tt,_coercedString:()=>Ft,_cuid:()=>os,_cuid2:()=>Et,_custom:()=>Jr,_date:()=>Br,_decode:()=>_t,_decodeAsync:()=>Ut,_default:()=>ri,_discriminatedUnion:()=>Nn,_e164:()=>g,_email:()=>ra,_emoji:()=>js,_encode:()=>Vn,_encodeAsync:()=>Pc,_endsWith:()=>ko,_enum:()=>ps,_file:()=>Ra,_float32:()=>yi,_float64:()=>Ro,_gt:()=>Ss,_gte:()=>Ri,_guid:()=>fo,_includes:()=>Bs,_int:()=>Ji,_int32:()=>da,_int64:()=>Jo,_intersection:()=>xo,_ipv4:()=>Aa,_ipv6:()=>xa,_isoDate:()=>ui,_isoDateTime:()=>Ys,_isoDuration:()=>Cc,_isoTime:()=>Oi,_jwt:()=>mc,_ksuid:()=>Yn,_lazy:()=>ve,_length:()=>ac,_literal:()=>ar,_lowercase:()=>Le,_lt:()=>Oe,_lte:()=>hn,_mac:()=>ro,_map:()=>te,_max:()=>hn,_maxLength:()=>Ja,_maxSize:()=>Zt,_mime:()=>sn,_min:()=>Ri,_minLength:()=>Cn,_minSize:()=>Ge,_multipleOf:()=>gt,_nan:()=>Ht,_nanoid:()=>Bn,_nativeEnum:()=>Nc,_negative:()=>le,_never:()=>Sr,_nonnegative:()=>st,_nonoptional:()=>pr,_nonpositive:()=>Ar,_normalize:()=>$e,_null:()=>Nt,_nullable:()=>is,_number:()=>wt,_optional:()=>Kr,_overwrite:()=>Rr,_parse:()=>ue,_parseAsync:()=>Cr,_pipe:()=>ti,_positive:()=>jn,_promise:()=>m,_property:()=>ca,_readonly:()=>Is,_record:()=>Po,_refine:()=>vs,_regex:()=>Ua,_safeDecode:()=>ct,_safeDecodeAsync:()=>mr,_safeEncode:()=>jr,_safeEncodeAsync:()=>et,_safeParse:()=>Pt,_safeParseAsync:()=>as,_set:()=>wi,_size:()=>Uo,_slugify:()=>Ds,_startsWith:()=>Ui,_string:()=>_o,_stringFormat:()=>Gs,_stringbool:()=>$i,_success:()=>ga,_superRefine:()=>$o,_symbol:()=>To,_templateLiteral:()=>Pa,_toLowerCase:()=>Ta,_toUpperCase:()=>hi,_transform:()=>ec,_trim:()=>Oc,_tuple:()=>Ni,_uint32:()=>yc,_uint64:()=>er,_ulid:()=>Ce,_undefined:()=>uc,_union:()=>lr,_unknown:()=>Ve,_uppercase:()=>Me,_url:()=>yn,_uuid:()=>so,_uuidv4:()=>ae,_uuidv6:()=>Qa,_uuidv7:()=>tn,_void:()=>dn,_xid:()=>Dn,_xor:()=>Ye,clone:()=>Zo,config:()=>xe,createStandardJSONSchemaMethod:()=>sr,createToJSONSchemaMethod:()=>ze,decode:()=>Tt,decodeAsync:()=>qr,describe:()=>bt,encode:()=>zr,encodeAsync:()=>ni,extractDefs:()=>Ae,finalize:()=>_n,flattenError:()=>Vi,formatError:()=>ho,globalConfig:()=>cc,globalRegistry:()=>Er,initializeContext:()=>ao,isValidBase64:()=>zi,isValidBase64URL:()=>po,isValidJWT:()=>Vs,locales:()=>kd,meta:()=>Kt,parse:()=>Mn,parseAsync:()=>h,prettifyError:()=>Us,process:()=>re,regexes:()=>Ke,registry:()=>dt,safeDecode:()=>oa,safeDecodeAsync:()=>Ps,safeEncode:()=>Mo,safeEncodeAsync:()=>gs,safeParse:()=>Va,safeParseAsync:()=>Si,toDotPath:()=>Zi,toJSONSchema:()=>sc,treeifyError:()=>ma,util:()=>pi,version:()=>Yi}),Nd=r({endsWith:()=>ko,gt:()=>Ss,gte:()=>Ri,includes:()=>Bs,length:()=>ac,lowercase:()=>Le,lt:()=>Oe,lte:()=>hn,maxLength:()=>Ja,maxSize:()=>Zt,mime:()=>sn,minLength:()=>Cn,minSize:()=>Ge,multipleOf:()=>gt,negative:()=>le,nonnegative:()=>st,nonpositive:()=>Ar,normalize:()=>$e,overwrite:()=>Rr,positive:()=>jn,property:()=>ca,regex:()=>Ua,size:()=>Uo,slugify:()=>Ds,startsWith:()=>Ui,toLowerCase:()=>Ta,toUpperCase:()=>hi,trim:()=>Oc,uppercase:()=>Me});const Pd={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`};function Fd(e){xe({customError:e})}function Id(){return xe().customError}var Ld;Ld||={};const w={...On,...Nd,iso:Zn},Rd=new Set(`$schema.$ref.$defs.definitions.$id.id.$comment.$anchor.$vocabulary.$dynamicRef.$dynamicAnchor.type.enum.const.anyOf.oneOf.allOf.not.properties.required.additionalProperties.patternProperties.propertyNames.minProperties.maxProperties.items.prefixItems.additionalItems.minItems.maxItems.uniqueItems.contains.minContains.maxContains.minLength.maxLength.pattern.format.minimum.maximum.exclusiveMinimum.exclusiveMaximum.multipleOf.description.default.contentEncoding.contentMediaType.contentSchema.unevaluatedItems.unevaluatedProperties.if.then.else.dependentSchemas.dependentRequired.nullable.readOnly`.split(`.`));function zd(e,t){let n=e.$schema;return n===`https://json-schema.org/draft/2020-12/schema`?`draft-2020-12`:n===`http://json-schema.org/draft-07/schema#`?`draft-7`:n===`http://json-schema.org/draft-04/schema#`?`draft-4`:t??`draft-2020-12`}function Bd(e,t){if(!e.startsWith(`#`))throw Error(`External $ref is not supported, only local refs (#/...) are allowed`);let n=e.slice(1).split(`/`).filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version===`draft-2020-12`?`$defs`:`definitions`;if(n[0]===r){let r=n[1];if(!r||!t.defs[r])throw Error(`Reference not found: ${e}`);return t.defs[r]}throw Error(`Reference not found: ${e}`)}function Vd(e,t){if(e.not!==void 0){if(typeof e.not==`object`&&Object.keys(e.not).length===0)return w.never();throw Error(`not is not supported in Zod (except { not: {} } for never)`)}if(e.unevaluatedItems!==void 0)throw Error(`unevaluatedItems is not supported`);if(e.unevaluatedProperties!==void 0)throw Error(`unevaluatedProperties is not supported`);if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error(`Conditional schemas (if/then/else) are not supported`);if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error(`dependentSchemas and dependentRequired are not supported`);if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return w.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let r=Hd(Bd(n,t),t);return t.refs.set(n,r),t.processing.delete(n),r}if(e.enum!==void 0){let n=e.enum;if(t.version===`openapi-3.0`&&e.nullable===!0&&n.length===1&&n[0]===null)return w.null();if(n.length===0)return w.never();if(n.length===1)return w.literal(n[0]);if(n.every(e=>typeof e==`string`))return w.enum(n);let r=n.map(e=>w.literal(e));return r.length<2?r[0]:w.union([r[0],r[1],...r.slice(2)])}if(e.const!==void 0)return w.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(n=>Vd({...e,type:n},t));return r.length===0?w.never():r.length===1?r[0]:w.union(r)}if(!n)return w.any();let r;switch(n){case`string`:{let t=w.string();if(e.format){let n=e.format;n===`email`?t=t.check(w.email()):n===`uri`||n===`uri-reference`?t=t.check(w.url()):n===`uuid`||n===`guid`?t=t.check(w.uuid()):n===`date-time`?t=t.check(w.iso.datetime()):n===`date`?t=t.check(w.iso.date()):n===`time`?t=t.check(w.iso.time()):n===`duration`?t=t.check(w.iso.duration()):n===`ipv4`?t=t.check(w.ipv4()):n===`ipv6`?t=t.check(w.ipv6()):n===`mac`?t=t.check(w.mac()):n===`cidr`?t=t.check(w.cidrv4()):n===`cidr-v6`?t=t.check(w.cidrv6()):n===`base64`?t=t.check(w.base64()):n===`base64url`?t=t.check(w.base64url()):n===`e164`?t=t.check(w.e164()):n===`jwt`?t=t.check(w.jwt()):n===`emoji`?t=t.check(w.emoji()):n===`nanoid`?t=t.check(w.nanoid()):n===`cuid`?t=t.check(w.cuid()):n===`cuid2`?t=t.check(w.cuid2()):n===`ulid`?t=t.check(w.ulid()):n===`xid`?t=t.check(w.xid()):n===`ksuid`&&(t=t.check(w.ksuid()))}typeof e.minLength==`number`&&(t=t.min(e.minLength)),typeof e.maxLength==`number`&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),r=t;break}case`number`:case`integer`:{let t=n===`integer`?w.number().int():w.number();typeof e.minimum==`number`&&(t=t.min(e.minimum)),typeof e.maximum==`number`&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum==`number`?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum==`number`&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum==`number`?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum==`number`&&(t=t.lt(e.maximum)),typeof e.multipleOf==`number`&&(t=t.multipleOf(e.multipleOf)),r=t;break}case`boolean`:r=w.boolean();break;case`null`:r=w.null();break;case`object`:{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[e,r]of Object.entries(i)){let i=Hd(r,t);n[e]=a.has(e)?i:i.optional()}if(e.propertyNames){let i=Hd(e.propertyNames,t),a=e.additionalProperties&&typeof e.additionalProperties==`object`?Hd(e.additionalProperties,t):w.any();if(Object.keys(n).length===0){r=w.record(i,a);break}let o=w.object(n).passthrough(),s=w.looseRecord(i,a);r=w.intersection(o,s);break}if(e.patternProperties){let i=e.patternProperties,a=Object.keys(i),o=[];for(let e of a){let n=Hd(i[e],t),r=w.string().regex(new RegExp(e));o.push(w.looseRecord(r,n))}let s=[];if(Object.keys(n).length>0&&s.push(w.object(n).passthrough()),s.push(...o),s.length===0)r=w.object({}).passthrough();else if(s.length===1)r=s[0];else{let e=w.intersection(s[0],s[1]);for(let t=2;t<s.length;t++)e=w.intersection(e,s[t]);r=e}break}let o=w.object(n);r=e.additionalProperties===!1?o.strict():typeof e.additionalProperties==`object`?o.catchall(Hd(e.additionalProperties,t)):o.passthrough();break}case`array`:{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(e=>Hd(e,t)),o=i&&typeof i==`object`&&!Array.isArray(i)?Hd(i,t):void 0;r=o?w.tuple(a).rest(o):w.tuple(a),typeof e.minItems==`number`&&(r=r.check(w.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(w.maxLength(e.maxItems)))}else if(Array.isArray(i)){let n=i.map(e=>Hd(e,t)),a=e.additionalItems&&typeof e.additionalItems==`object`?Hd(e.additionalItems,t):void 0;r=a?w.tuple(n).rest(a):w.tuple(n),typeof e.minItems==`number`&&(r=r.check(w.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(w.maxLength(e.maxItems)))}else if(i!==void 0){let n=Hd(i,t),a=w.array(n);typeof e.minItems==`number`&&(a=a.min(e.minItems)),typeof e.maxItems==`number`&&(a=a.max(e.maxItems)),r=a}else r=w.array(w.any());break}default:throw Error(`Unsupported type: ${n}`)}return e.description&&(r=r.describe(e.description)),e.default!==void 0&&(r=r.default(e.default)),r}function Hd(e,t){if(typeof e==`boolean`)return e?w.any():w.never();let n=Vd(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let i=e.anyOf.map(e=>Hd(e,t)),a=w.union(i);n=r?w.intersection(n,a):a}if(e.oneOf&&Array.isArray(e.oneOf)){let i=e.oneOf.map(e=>Hd(e,t)),a=w.xor(i);n=r?w.intersection(n,a):a}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:w.any();else{let i=r?n:Hd(e.allOf[0],t),a=+!r;for(let n=a;n<e.allOf.length;n++)i=w.intersection(i,Hd(e.allOf[n],t));n=i}e.nullable===!0&&t.version===`openapi-3.0`&&(n=w.nullable(n)),e.readOnly===!0&&(n=w.readonly(n));let i={};for(let t of[`$id`,`id`,`$comment`,`$anchor`,`$vocabulary`,`$dynamicRef`,`$dynamicAnchor`])t in e&&(i[t]=e[t]);for(let t of[`contentEncoding`,`contentMediaType`,`contentSchema`])t in e&&(i[t]=e[t]);for(let t of Object.keys(e))Rd.has(t)||(i[t]=e[t]);return Object.keys(i).length>0&&t.registry.add(n,i),n}function Ud(e,t){return typeof e==`boolean`?e?w.any():w.never():Hd(e,{version:zd(e,t?.defaultTarget),defs:e.$defs||e.definitions||{},refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??Er})}var Wd=r({$brand:()=>ji,$input:()=>Lc,$output:()=>pe,NEVER:()=>Qn,TimePrecision:()=>Xa,ZodAny:()=>Lo,ZodArray:()=>xs,ZodBase64:()=>Ka,ZodBase64URL:()=>Di,ZodBigInt:()=>Ko,ZodBigIntFormat:()=>As,ZodBoolean:()=>Ki,ZodCIDRv4:()=>bo,ZodCIDRv6:()=>Js,ZodCUID:()=>na,ZodCUID2:()=>ya,ZodCatch:()=>ns,ZodCodec:()=>Oo,ZodCustom:()=>La,ZodCustomStringFormat:()=>Oa,ZodDate:()=>vi,ZodDefault:()=>rc,ZodDiscriminatedUnion:()=>jc,ZodE164:()=>Ii,ZodEmail:()=>Sc,ZodEmoji:()=>rr,ZodEnum:()=>Ee,ZodError:()=>Ca,ZodExactOptional:()=>pc,ZodFile:()=>fr,ZodFirstPartyTypeKind:()=>Ld,ZodFunction:()=>We,ZodGUID:()=>Fe,ZodIPv4:()=>Sn,ZodIPv6:()=>uo,ZodISODate:()=>Zs,ZodISODateTime:()=>Tc,ZodISODuration:()=>Ai,ZodISOTime:()=>gc,ZodIntersection:()=>ce,ZodIssueCode:()=>Pd,ZodJWT:()=>to,ZodKSUID:()=>an,ZodLazy:()=>mn,ZodLiteral:()=>An,ZodMAC:()=>Qe,ZodMap:()=>Ct,ZodNaN:()=>Yt,ZodNanoID:()=>qn,ZodNever:()=>Bc,ZodNonOptional:()=>ge,ZodNull:()=>kr,ZodNullable:()=>mt,ZodNumber:()=>br,ZodNumberFormat:()=>Lr,ZodObject:()=>ot,ZodOptional:()=>Bt,ZodPipe:()=>ds,ZodPrefault:()=>jt,ZodPromise:()=>$r,ZodReadonly:()=>Gr,ZodRealError:()=>fi,ZodRecord:()=>ci,ZodSet:()=>Rn,ZodString:()=>ee,ZodStringFormat:()=>sa,ZodSuccess:()=>Fs,ZodSymbol:()=>No,ZodTemplateLiteral:()=>_s,ZodTransform:()=>Ha,ZodTuple:()=>Ci,ZodType:()=>Ho,ZodULID:()=>Es,ZodURL:()=>Hi,ZodUUID:()=>go,ZodUndefined:()=>Ws,ZodUnion:()=>Qi,ZodUnknown:()=>ha,ZodVoid:()=>Qo,ZodXID:()=>wo,ZodXor:()=>Na,_ZodString:()=>wa,_default:()=>$s,_function:()=>Mi,any:()=>cr,array:()=>Be,base64:()=>je,base64url:()=>vn,bigint:()=>oo,boolean:()=>ie,catch:()=>mi,check:()=>Za,cidrv4:()=>en,cidrv6:()=>un,clone:()=>Zo,codec:()=>En,coerce:()=>p,config:()=>xe,core:()=>Md,cuid:()=>Je,cuid2:()=>yt,custom:()=>Gt,date:()=>Un,decode:()=>Ba,decodeAsync:()=>xi,describe:()=>Ic,discriminatedUnion:()=>fe,e164:()=>Tr,email:()=>ut,emoji:()=>gr,encode:()=>Bo,encodeAsync:()=>ws,endsWith:()=>ko,enum:()=>Dc,exactOptional:()=>Nr,file:()=>nt,flattenError:()=>Vi,float32:()=>It,float64:()=>ss,formatError:()=>ho,fromJSONSchema:()=>Ud,function:()=>Mi,getErrorMap:()=>Id,globalRegistry:()=>Er,gt:()=>Ss,gte:()=>Ri,guid:()=>Dt,hash:()=>Yr,hex:()=>Vr,hostname:()=>ii,httpUrl:()=>Pn,includes:()=>Bs,instanceof:()=>vc,int:()=>_,int32:()=>la,int64:()=>Ls,intersection:()=>Fo,ipv4:()=>ys,ipv6:()=>Wa,iso:()=>Zn,json:()=>Ti,jwt:()=>Wo,keyof:()=>Os,ksuid:()=>Wi,lazy:()=>vo,length:()=>ac,literal:()=>Ks,locales:()=>kd,looseObject:()=>ea,looseRecord:()=>_a,lowercase:()=>Le,lt:()=>Oe,lte:()=>hn,mac:()=>es,map:()=>Eo,maxLength:()=>Ja,maxSize:()=>Zt,meta:()=>Fa,mime:()=>sn,minLength:()=>Cn,minSize:()=>Ge,multipleOf:()=>gt,nan:()=>Ea,nanoid:()=>gi,nativeEnum:()=>tc,negative:()=>le,never:()=>kc,nonnegative:()=>st,nonoptional:()=>Pi,nonpositive:()=>Ar,normalize:()=>$e,null:()=>$n,nullable:()=>bc,nullish:()=>tr,number:()=>we,object:()=>dc,optional:()=>ur,overwrite:()=>Rr,parse:()=>Bi,parseAsync:()=>mo,partialRecord:()=>He,pipe:()=>Ne,positive:()=>jn,prefault:()=>bn,preprocess:()=>co,prettifyError:()=>Us,promise:()=>oe,property:()=>ca,readonly:()=>$a,record:()=>nn,refine:()=>fn,regex:()=>Ua,regexes:()=>Ke,registry:()=>dt,safeDecode:()=>Hs,safeDecodeAsync:()=>Xi,safeEncode:()=>pa,safeEncodeAsync:()=>Xo,safeParse:()=>Co,safeParseAsync:()=>Ma,set:()=>Xe,setErrorMap:()=>Fd,size:()=>Uo,slugify:()=>Ds,startsWith:()=>Ui,strictObject:()=>xt,string:()=>qt,stringFormat:()=>Gn,stringbool:()=>Rc,success:()=>me,superRefine:()=>Dr,symbol:()=>ft,templateLiteral:()=>vr,toJSONSchema:()=>sc,toLowerCase:()=>Ta,toUpperCase:()=>hi,transform:()=>Fr,treeifyError:()=>ma,trim:()=>Oc,tuple:()=>it,uint32:()=>Rt,uint64:()=>ls,ulid:()=>kt,undefined:()=>Se,union:()=>Zr,unknown:()=>Ur,uppercase:()=>Me,url:()=>oi,util:()=>pi,uuid:()=>In,uuidv4:()=>y,uuidv6:()=>aa,uuidv7:()=>Ns,void:()=>lc,xid:()=>jo,xor:()=>hs});xe($l());var Gd=Wd,Kd=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{SYMBOL_FOR_REQ_CONTEXT:()=>u,getContext:()=>d}),t.exports=c(l);let u=Symbol.for(`@vercel/request-context`);function d(){return globalThis[u]?.get?.()??{}}0&&(t.exports={SYMBOL_FOR_REQ_CONTEXT:u,getContext:d})})),qd=i(((e,t)=>{var r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},c=(e,t,n,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(r({},`__esModule`,{value:!0}),e),u={};s(u,{getVercelOidcToken:()=>p,getVercelOidcTokenSync:()=>m}),t.exports=l(u);var d=Kd(),f=Zc();async function p(e){let t=``,r;try{t=m()}catch(e){r=e}try{let[{getTokenPayload:r,isExpired:i},{refreshToken:a}]=await Promise.all([await import(`../../_chunks/workflow/token-util-Ldar52H7.js`).then(e=>n(e.t())),await import(`../../_chunks/workflow/token-DHD-q-fS.js`).then(e=>n(e.default))]);(!t||i(r(t),e?.expirationBufferMs))&&(await a(e),t=m())}catch(e){let t=r instanceof Error?r.message:``;throw e instanceof Error&&(t=`${t}
2
- ${e.message}`),t?new f.VercelOidcTokenError(t):e}return t}function m(){let e=(0,d.getContext)().headers?.[`x-vercel-oidc-token`]??process.env.VERCEL_OIDC_TOKEN;if(!e)throw Error(`The 'x-vercel-oidc-token' header is missing from the request. Do you have the OIDC option enabled in the Vercel project settings?`);return e}0&&(t.exports={getVercelOidcToken:p,getVercelOidcTokenSync:m})})),Jd=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{AccessTokenMissingError:()=>f.AccessTokenMissingError,RefreshAccessTokenFailedError:()=>f.RefreshAccessTokenFailedError,getContext:()=>d.getContext,getVercelOidcToken:()=>u.getVercelOidcToken,getVercelOidcTokenSync:()=>u.getVercelOidcTokenSync,getVercelToken:()=>p.getVercelToken}),t.exports=c(l);var u=qd(),d=Kd(),f=Xc(),p=Qc();0&&(t.exports={AccessTokenMissingError,RefreshAccessTokenFailedError,getContext,getVercelOidcToken,getVercelOidcTokenSync,getVercelToken})}))();let Yd;try{Yd=new TextDecoder}catch{}let T,Xd,E=0;const Zd=[],Qd=57337,$d={};let ef=11281e4,tf=1681e4,nf=Zd,rf=0,D={},O,af,of=0,sf=0,k,cf,A=[],lf=[],uf,df,ff,pf={useRecords:!1,mapsAsObjects:!0},mf=!1,hf=2;try{Function(``)}catch{hf=1/0}var gf=class e{constructor(e){if(e&&((e.keyMap||e._keyMap)&&!e.useRecords&&(e.useRecords=!1,e.mapsAsObjects=!0),e.useRecords===!1&&e.mapsAsObjects===void 0&&(e.mapsAsObjects=!0),e.getStructures&&(e.getShared=e.getStructures),e.getShared&&!e.structures&&((e.structures=[]).uninitialized=!0),e.keyMap)){this.mapKey=new Map;for(let[t,n]of Object.entries(e.keyMap))this.mapKey.set(n,t)}Object.assign(this,e)}decodeKey(e){return this.keyMap&&this.mapKey.get(e)||e}encodeKey(e){return this.keyMap&&this.keyMap.hasOwnProperty(e)?this.keyMap[e]:e}encodeKeys(e){if(!this._keyMap)return e;let t=new Map;for(let[n,r]of Object.entries(e))t.set(this._keyMap.hasOwnProperty(n)?this._keyMap[n]:n,r);return t}decodeKeys(e){if(!this._keyMap||e.constructor.name!=`Map`)return e;if(!this._mapKey){this._mapKey=new Map;for(let[e,t]of Object.entries(this._keyMap))this._mapKey.set(t,e)}let t={};return e.forEach((e,n)=>t[bf(this._mapKey.has(n)?this._mapKey.get(n):n)]=e),t}mapDecode(e,t){let n=this.decode(e);if(this._keyMap)switch(n.constructor.name){case`Array`:return n.map(e=>this.decodeKeys(e))}return n}decode(t,n){if(T)return Uf(()=>(Wf(),this?this.decode(t,n):e.prototype.decode.call(pf,t,n)));Xd=n>-1?n:t.length,E=0,rf=0,sf=0,af=null,nf=Zd,k=null,T=t;try{df=t.dataView||=new DataView(t.buffer,t.byteOffset,t.byteLength)}catch(e){throw T=null,t instanceof Uint8Array?e:Error(`Source must be a Uint8Array or Buffer but was a `+(t&&typeof t==`object`?t.constructor.name:typeof t))}if(this instanceof e){if(D=this,uf=this.sharedValues&&(this.pack?Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this.structures)return O=this.structures,_f();(!O||O.length>0)&&(O=[])}else D=pf,(!O||O.length>0)&&(O=[]),uf=null;return _f()}decodeMultiple(e,t){let n,r=0;try{let i=e.length;mf=!0;let a=this?this.decode(e,i):Kf.decode(e,i);if(t){if(t(a)===!1)return;for(;E<i;)if(r=E,t(_f())===!1)return}else{for(n=[a];E<i;)r=E,n.push(_f());return n}}catch(e){throw e.lastPosition=r,e.values=n,e}finally{mf=!1,Wf()}}};function _f(){try{let e=j();if(k){if(E>=k.postBundlePosition){let e=Error(`Unexpected bundle position`);throw e.incomplete=!0,e}E=k.postBundlePosition,k=null}if(E==Xd)O=null,T=null,cf&&=null;else if(E>Xd){let e=Error(`Unexpected end of CBOR data`);throw e.incomplete=!0,e}else if(!mf)throw Error(`Data read, but end of buffer not reached`);return e}catch(e){throw Wf(),(e instanceof RangeError||e.message.startsWith(`Unexpected end of buffer`))&&(e.incomplete=!0),e}}function j(){let e=T[E++],t=e>>5;if(e&=31,e>23)switch(e){case 24:e=T[E++];break;case 25:if(t==7)return kf();e=df.getUint16(E),E+=2;break;case 26:if(t==7){let e=df.getFloat32(E);if(D.useFloat32>2){let t=Gf[(T[E]&127)<<1|T[E+1]>>7];return E+=4,(t*e+(e>0?.5:-.5)>>0)/t}return E+=4,e}e=df.getUint32(E),E+=4;break;case 27:if(t==7){let e=df.getFloat64(E);return E+=8,e}if(t>1){if(df.getUint32(E)>0)throw Error(`JavaScript does not support arrays, maps, or strings with length over 4294967295`);e=df.getUint32(E+4)}else D.int64AsNumber?(e=df.getUint32(E)*4294967296,e+=df.getUint32(E+4)):e=df.getBigUint64(E);E+=8;break;case 31:switch(t){case 2:case 3:throw Error(`Indefinite length not supported for byte or text strings`);case 4:let e=[],n,r=0;for(;(n=j())!=$d;){if(r>=ef)throw Error(`Array length exceeds ${ef}`);e[r++]=n}return t==4?e:t==3?e.join(``):Buffer.concat(e);case 5:let i;if(D.mapsAsObjects){let e={},t=0;if(D.keyMap)for(;(i=j())!=$d;){if(t++>=tf)throw Error(`Property count exceeds ${tf}`);e[bf(D.decodeKey(i))]=j()}else for(;(i=j())!=$d;){if(t++>=tf)throw Error(`Property count exceeds ${tf}`);e[bf(i)]=j()}return e}else{ff&&=(D.mapsAsObjects=!0,!1);let e=new Map;if(D.keyMap){let t=0;for(;(i=j())!=$d;){if(t++>=tf)throw Error(`Map size exceeds ${tf}`);e.set(D.decodeKey(i),j())}}else{let t=0;for(;(i=j())!=$d;){if(t++>=tf)throw Error(`Map size exceeds ${tf}`);e.set(i,j())}}return e}case 7:return $d;default:throw Error(`Invalid major type for indefinite length `+t)}default:throw Error(`Unknown token `+e)}switch(t){case 0:return e;case 1:return~e;case 2:return Ef(e);case 3:if(sf>=E)return af.slice(E-of,(E+=e)-of);if(sf==0&&Xd<140&&e<32){let t=e<16?Tf(e):wf(e);if(t!=null)return t}return xf(e);case 4:if(e>=ef)throw Error(`Array length exceeds ${ef}`);let t=Array(e);for(let n=0;n<e;n++)t[n]=j();return t;case 5:if(e>=tf)throw Error(`Map size exceeds ${ef}`);if(D.mapsAsObjects){let t={};if(D.keyMap)for(let n=0;n<e;n++)t[bf(D.decodeKey(j()))]=j();else for(let n=0;n<e;n++)t[bf(j())]=j();return t}else{ff&&=(D.mapsAsObjects=!0,!1);let t=new Map;if(D.keyMap)for(let n=0;n<e;n++)t.set(D.decodeKey(j()),j());else for(let n=0;n<e;n++)t.set(j(),j());return t}case 6:if(e>=Qd){let t=O[e&8191];if(t)return t.read||=yf(t),t.read();if(e<65536){if(e==57343){let e=Vf(),t=j(),n=j();jf(t,n);let r={};if(D.keyMap)for(let t=2;t<e;t++){let e=D.decodeKey(n[t-2]);r[bf(e)]=j()}else for(let t=2;t<e;t++){let e=n[t-2];r[bf(e)]=j()}return r}else if(e==57342){let e=Vf(),t=j();for(let n=2;n<e;n++)jf(t++,j());return j()}else if(e==Qd)return Bf();if(D.getShared&&(Hf(),t=O[e&8191],t))return t.read||=yf(t),t.read()}}let n=A[e];if(n)return n.handlesRead?n(j):n(j());{let t=j();for(let n=0;n<lf.length;n++){let r=lf[n](e,t);if(r!==void 0)return r}return new Af(t,e)}case 7:switch(e){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;default:let t=(uf||Ff())[e];if(t!==void 0)return t;throw Error(`Unknown token `+e)}default:if(isNaN(e)){let e=Error(`Unexpected end of CBOR data`);throw e.incomplete=!0,e}throw Error(`Unknown CBOR token `+e)}}const vf=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function yf(e){if(!e)throw Error(`Structure is required in record definition`);function t(){let e=T[E++];if(e&=31,e>23)switch(e){case 24:e=T[E++];break;case 25:e=df.getUint16(E),E+=2;break;case 26:e=df.getUint32(E),E+=4;break;default:throw Error(`Expected array header, but got `+T[E-1])}let t=this.compiledReader;for(;t;){if(t.propertyCount===e)return t(j);t=t.next}if(this.slowReads++>=hf){let n=this.length==e?this:this.slice(0,e);return t=D.keyMap?Function(`r`,`return {`+n.map(e=>D.decodeKey(e)).map(e=>vf.test(e)?bf(e)+`:r()`:`[`+JSON.stringify(e)+`]:r()`).join(`,`)+`}`):Function(`r`,`return {`+n.map(e=>vf.test(e)?bf(e)+`:r()`:`[`+JSON.stringify(e)+`]:r()`).join(`,`)+`}`),this.compiledReader&&(t.next=this.compiledReader),t.propertyCount=e,this.compiledReader=t,t(j)}let n={};if(D.keyMap)for(let t=0;t<e;t++)n[bf(D.decodeKey(this[t]))]=j();else for(let t=0;t<e;t++)n[bf(this[t])]=j();return n}return e.slowReads=0,t}function bf(e){if(typeof e==`string`)return e===`__proto__`?`__proto_`:e;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return e.toString();if(e==null)return e+``;throw Error(`Invalid property name type `+typeof e)}let xf=Cf;function Sf(e){xf=t(1);function t(t){return function(t){let n=nf[rf++];if(n==null){if(k)return Cf(t);let r=e(E,Xd,t,T);if(typeof r==`string`)n=r,nf=Zd;else if(nf=r,rf=1,sf=1,n=nf[0],n===void 0)throw Error(`Unexpected end of buffer`)}let r=n.length;return r<=t?(E+=t,n):(af=n,of=E,sf=E+r,E+=t,n.slice(0,t))}}}function Cf(e){let t;if(e<16&&(t=Tf(e)))return t;if(e>64&&Yd)return Yd.decode(T.subarray(E,E+=e));let n=E+e,r=[];for(t=``;E<n;){let e=T[E++];if(!(e&128))r.push(e);else if((e&224)==192){let t=T[E++]&63;r.push((e&31)<<6|t)}else if((e&240)==224){let t=T[E++]&63,n=T[E++]&63;r.push((e&31)<<12|t<<6|n)}else if((e&248)==240){let t=T[E++]&63,n=T[E++]&63,i=T[E++]&63,a=(e&7)<<18|t<<12|n<<6|i;a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a)}else r.push(e);r.length>=4096&&(t+=M.apply(String,r),r.length=0)}return r.length>0&&(t+=M.apply(String,r)),t}let M=String.fromCharCode;function wf(e){let t=E,n=Array(e);for(let r=0;r<e;r++){let e=T[E++];if((e&128)>0){E=t;return}n[r]=e}return M.apply(String,n)}function Tf(e){if(e<4)if(e<2){if(e===0)return``;{let e=T[E++];if((e&128)>1){--E;return}return M(e)}}else{let t=T[E++],n=T[E++];if((t&128)>0||(n&128)>0){E-=2;return}if(e<3)return M(t,n);let r=T[E++];if((r&128)>0){E-=3;return}return M(t,n,r)}else{let t=T[E++],n=T[E++],r=T[E++],i=T[E++];if((t&128)>0||(n&128)>0||(r&128)>0||(i&128)>0){E-=4;return}if(e<6){if(e===4)return M(t,n,r,i);{let e=T[E++];if((e&128)>0){E-=5;return}return M(t,n,r,i,e)}}else if(e<8){let a=T[E++],o=T[E++];if((a&128)>0||(o&128)>0){E-=6;return}if(e<7)return M(t,n,r,i,a,o);let s=T[E++];if((s&128)>0){E-=7;return}return M(t,n,r,i,a,o,s)}else{let a=T[E++],o=T[E++],s=T[E++],c=T[E++];if((a&128)>0||(o&128)>0||(s&128)>0||(c&128)>0){E-=8;return}if(e<10){if(e===8)return M(t,n,r,i,a,o,s,c);{let e=T[E++];if((e&128)>0){E-=9;return}return M(t,n,r,i,a,o,s,c,e)}}else if(e<12){let l=T[E++],u=T[E++];if((l&128)>0||(u&128)>0){E-=10;return}if(e<11)return M(t,n,r,i,a,o,s,c,l,u);let d=T[E++];if((d&128)>0){E-=11;return}return M(t,n,r,i,a,o,s,c,l,u,d)}else{let l=T[E++],u=T[E++],d=T[E++],f=T[E++];if((l&128)>0||(u&128)>0||(d&128)>0||(f&128)>0){E-=12;return}if(e<14){if(e===12)return M(t,n,r,i,a,o,s,c,l,u,d,f);{let e=T[E++];if((e&128)>0){E-=13;return}return M(t,n,r,i,a,o,s,c,l,u,d,f,e)}}else{let p=T[E++],m=T[E++];if((p&128)>0||(m&128)>0){E-=14;return}if(e<15)return M(t,n,r,i,a,o,s,c,l,u,d,f,p,m);let h=T[E++];if((h&128)>0){E-=15;return}return M(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}}}}}function Ef(e){return D.copyBuffers?Uint8Array.prototype.slice.call(T,E,E+=e):T.subarray(E,E+=e)}let Df=new Float32Array(1),Of=new Uint8Array(Df.buffer,0,4);function kf(){let e=T[E++],t=T[E++],n=(e&127)>>2;if(n===31)return t||e&3?NaN:e&128?-1/0:1/0;if(n===0){let n=((e&3)<<8|t)/(1<<24);return e&128?-n:n}return Of[3]=e&128|(n>>1)+56,Of[2]=(e&7)<<5|t>>3,Of[1]=t<<5,Of[0]=0,Df[0]}Array(4096);var Af=class{constructor(e,t){this.value=e,this.tag=t}};A[0]=e=>new Date(e),A[1]=e=>new Date(Math.round(e*1e3)),A[2]=e=>{let t=BigInt(0);for(let n=0,r=e.byteLength;n<r;n++)t=BigInt(e[n])+(t<<BigInt(8));return t},A[3]=e=>BigInt(-1)-A[2](e),A[4]=e=>+(e[1]+`e`+e[0]),A[5]=e=>e[1]*Math.exp(e[0]*Math.log(2));const jf=(e,t)=>{e-=57344;let n=O[e];n&&n.isShared&&((O.restoreStructures||=[])[e]=n),O[e]=t,t.read=yf(t)};A[105]=e=>{let t=e.length,n=e[1];jf(e[0],n);let r={};for(let i=2;i<t;i++){let t=n[i-2];r[bf(t)]=e[i]}return r},A[14]=e=>k?k[0].slice(k.position0,k.position0+=e):new Af(e,14),A[15]=e=>k?k[1].slice(k.position1,k.position1+=e):new Af(e,15);let Mf={Error,RegExp};A[27]=e=>(Mf[e[0]]||Error)(e[1],e[2]);const Nf=e=>{if(T[E++]!=132){let e=Error(`Packed values structure must be followed by a 4 element array`);throw T.length<E&&(e.incomplete=!0),e}let t=e();if(!t||!t.length){let e=Error(`Packed values structure must be followed by a 4 element array`);throw e.incomplete=!0,e}return uf=uf?t.concat(uf.slice(t.length)):t,uf.prefixes=e(),uf.suffixes=e(),e()};Nf.handlesRead=!0,A[51]=Nf,A[6]=e=>{if(!uf)if(D.getShared)Hf();else return new Af(e,6);if(typeof e==`number`)return uf[16+(e>=0?2*e:-2*e-1)];let t=Error(`No support for non-integer packed references yet`);throw e===void 0&&(t.incomplete=!0),t},A[28]=e=>{cf||(cf=new Map,cf.id=0);let t=cf.id++,n=E,r=T[E],i;i=r>>5==4?[]:{};let a={target:i};cf.set(t,a);let o=e();return a.used?(Object.getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(E=n,i=o,cf.set(t,{target:i}),o=e()),Object.assign(i,o)):(a.target=o,o)},A[28].handlesRead=!0,A[29]=e=>{let t=cf.get(e);return t.used=!0,t.target},A[258]=e=>new Set(e),(A[259]=e=>(D.mapsAsObjects&&(D.mapsAsObjects=!1,ff=!0),e())).handlesRead=!0;function Pf(e,t){return typeof e==`string`?e+t:e instanceof Array?e.concat(t):Object.assign({},e,t)}function Ff(){if(!uf)if(D.getShared)Hf();else throw Error(`No packed values available`);return uf}lf.push((e,t)=>{if(e>=225&&e<=255)return Pf(Ff().prefixes[e-224],t);if(e>=28704&&e<=32767)return Pf(Ff().prefixes[e-28672],t);if(e>=1879052288&&e<=2147483647)return Pf(Ff().prefixes[e-1879048192],t);if(e>=216&&e<=223)return Pf(t,Ff().suffixes[e-216]);if(e>=27647&&e<=28671)return Pf(t,Ff().suffixes[e-27639]);if(e>=1811940352&&e<=1879048191)return Pf(t,Ff().suffixes[e-1811939328]);if(e==1399353956)return{packedValues:uf,structures:O.slice(0),version:t};if(e==55799)return t});const If=new Uint8Array(new Uint16Array([1]).buffer)[0]==1,Lf=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array>`u`?{name:`BigUint64Array`}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>`u`?{name:`BigInt64Array`}:BigInt64Array,Float32Array,Float64Array],Rf=[64,68,69,70,71,72,77,78,79,85,86];for(let e=0;e<Lf.length;e++)zf(Lf[e],Rf[e]);function zf(e,t){let n=`get`+e.name.slice(0,-5),r;typeof e==`function`?r=e.BYTES_PER_ELEMENT:e=null;for(let i=0;i<2;i++){if(!i&&r==1)continue;let a=r==2?1:r==4?2:r==8?3:0;A[i?t:t-4]=r==1||i==If?n=>{if(!e)throw Error(`Could not find typed array for code `+t);return!D.copyBuffers&&(r===1||r===2&&!(n.byteOffset&1)||r===4&&!(n.byteOffset&3)||r===8&&!(n.byteOffset&7))?new e(n.buffer,n.byteOffset,n.byteLength>>a):new e(Uint8Array.prototype.slice.call(n,0).buffer)}:r=>{if(!e)throw Error(`Could not find typed array for code `+t);let o=new DataView(r.buffer,r.byteOffset,r.byteLength),s=r.length>>a,c=new e(s),l=o[n];for(let e=0;e<s;e++)c[e]=l.call(o,e<<a,i);return c}}}function Bf(){let e=Vf(),t=E+j();for(let t=2;t<e;t++){let e=Vf();E+=e}let n=E;return E=t,k=[Cf(Vf()),Cf(Vf())],k.position0=0,k.position1=0,k.postBundlePosition=E,E=n,j()}function Vf(){let e=T[E++]&31;if(e>23)switch(e){case 24:e=T[E++];break;case 25:e=df.getUint16(E),E+=2;break;case 26:e=df.getUint32(E),E+=4;break}return e}function Hf(){if(D.getShared){let e=Uf(()=>(T=null,D.getShared()))||{},t=e.structures||[];D.sharedVersion=e.version,uf=D.sharedValues=e.packedValues,O===!0?D.structures=O=t:O.splice.apply(O,[0,t.length].concat(t))}}function Uf(e){let t=Xd,n=E,r=rf,i=of,a=sf,o=af,s=nf,c=cf,l=k,u=new Uint8Array(T.slice(0,Xd)),d=O,f=D,p=mf,m=e();return Xd=t,E=n,rf=r,of=i,sf=a,af=o,nf=s,cf=c,k=l,T=u,mf=p,O=d,D=f,df=new DataView(T.buffer,T.byteOffset,T.byteLength),m}function Wf(){T=null,cf=null,O=null}const Gf=Array(147);for(let e=0;e<256;e++)Gf[e]=+(`1e`+Math.floor(45.15-e*.30103));let Kf=new gf({useRecords:!1});const qf=Kf.decode;Kf.decodeMultiple;const Jf={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};let Yf;try{Yf=new TextEncoder}catch{}let Xf,Zf;const Qf=typeof globalThis==`object`&&globalThis.Buffer,$f=Qf!==void 0,ep=$f?Qf.allocUnsafeSlow:Uint8Array,tp=$f?Qf:Uint8Array,np=$f?4294967296:2144337920;let rp,N,P,F=0,ip,I=null;const ap=/[\u0080-\uFFFF]/,op=Symbol(`record-id`);var sp=class extends gf{constructor(e){super(e),this.offset=0;let t,n,r,i,a;e||={};let o=tp.prototype.utf8Write?function(e,t,n){return N.utf8Write(e,t,n)}:Yf&&Yf.encodeInto?function(e,t){return Yf.encodeInto(e,N.subarray(t)).written}:!1,s=this,c=e.structures||e.saveStructures,l=e.maxSharedStructures;if(l??=c?128:0,l>8190)throw Error(`Maximum maxSharedStructure is 8190`);let u=e.sequential;u&&(l=0),this.structures||=[],this.saveStructures&&(this.saveShared=this.saveStructures);let d,f,p=e.sharedValues,m;if(p){m=Object.create(null);for(let e=0,t=p.length;e<t;e++)m[p[e]]=e}let h=[],g=0,_=0;this.mapEncode=function(e,t){if(this._keyMap&&!this._mapped)switch(e.constructor.name){case`Array`:e=e.map(e=>this.encodeKeys(e));break}return this.encode(e,t)},this.encode=function(o,c){if(N||(N=new ep(8192),P=new DataView(N.buffer,0,8192),F=0),ip=N.length-10,ip-F<2048?(N=new ep(N.length),P=new DataView(N.buffer,0,N.length),ip=N.length-10,F=0):c===512&&(F=F+7&2147483640),t=F,s.useSelfDescribedHeader&&(P.setUint32(F,3654940416),F+=3),a=s.structuredClone?new Map:null,s.bundleStrings&&typeof o!=`string`?(I=[],I.size=1/0):I=null,n=s.structures,n){if(n.uninitialized){let e=s.getShared()||{};s.structures=n=e.structures||[],s.sharedVersion=e.version;let t=s.sharedValues=e.packedValues;if(t){m={};for(let e=0,n=t.length;e<n;e++)m[t[e]]=e}}let e=n.length;if(e>l&&!u&&(e=l),!n.transitions){n.transitions=Object.create(null);for(let t=0;t<e;t++){let e=n[t];if(!e)continue;let r,i=n.transitions;for(let n=0,a=e.length;n<a;n++){i[op]===void 0&&(i[op]=t);let a=e[n];r=i[a],r||=i[a]=Object.create(null),i=r}i[op]=t|1048576}}u||(n.nextId=e)}if(r&&=!1,i=n||[],f=m,e.pack){let t=new Map;if(t.values=[],t.encoder=s,t.maxValues=e.maxPrivatePackedValues||(m?16:1/0),t.objectMap=m||!1,t.samplingPackedValues=d,pp(o,t),t.values.length>0){N[F++]=216,N[F++]=51,up(4);let e=t.values;v(e),up(0),up(0),f=Object.create(m||null);for(let t=0,n=e.length;t<n;t++)f[e[t]]=t}}rp=c&Tp;try{if(rp)return;if(v(o),I&&vp(t,v),s.offset=F,a&&a.idsToInsert){F+=a.idsToInsert.length*2,F>ip&&b(F),s.offset=F;let e=_p(N.subarray(t,F),a.idsToInsert);return a=null,e}return c&512?(N.start=t,N.end=F,N):N.subarray(t,F)}finally{if(n){if(_<10&&_++,n.length>l&&(n.length=l),g>1e4)n.transitions=null,_=0,g=0,h.length>0&&(h=[]);else if(h.length>0&&!u){for(let e=0,t=h.length;e<t;e++)h[e][op]=void 0;h=[]}}if(r&&s.saveShared){s.structures.length>l&&(s.structures=s.structures.slice(0,l));let e=N.subarray(t,F);return s.updateSharedData()===!1?s.encode(o):e}c&1024&&(F=t)}},this.findCommonStringsToPack=()=>(d=new Map,m||=Object.create(null),e=>{let t=e&&e.threshold||4,n=this.pack?e.maxPrivatePackedValues||16:0;p||=this.sharedValues=[];for(let[e,i]of d)i.count>t&&(m[e]=n++,p.push(e),r=!0);for(;this.saveShared&&this.updateSharedData()===!1;);d=null});let v=n=>{F>ip&&(N=b(F));var r=typeof n,i;if(r===`string`){if(f){let t=f[n];if(t>=0){t<16?N[F++]=t+224:(N[F++]=198,t&1?v(15-t>>1):v(t-16>>1));return}else if(d&&!e.pack){let e=d.get(n);e?e.count++:d.set(n,{count:1})}}let r=n.length;if(I&&r>=4&&r<1024){if((I.size+=r)>61440){let e,n=(I[0]?I[0].length*3+I[1].length:0)+10;F+n>ip&&(N=b(F+n)),N[F++]=217,N[F++]=223,N[F++]=249,N[F++]=I.position?132:130,N[F++]=26,e=F-t,F+=4,I.position&&vp(t,v),I=[``,``],I.size=0,I.position=e}let e=ap.test(n);I[+!e]+=n,N[F++]=e?206:207,v(r);return}let a;a=r<32?1:r<256?2:r<65536?3:5;let s=r*3;if(F+s>ip&&(N=b(F+s)),r<64||!o){let e,t,o,s=F+a;for(e=0;e<r;e++)t=n.charCodeAt(e),t<128?N[s++]=t:t<2048?(N[s++]=t>>6|192,N[s++]=t&63|128):(t&64512)==55296&&((o=n.charCodeAt(e+1))&64512)==56320?(t=65536+((t&1023)<<10)+(o&1023),e++,N[s++]=t>>18|240,N[s++]=t>>12&63|128,N[s++]=t>>6&63|128,N[s++]=t&63|128):(N[s++]=t>>12|224,N[s++]=t>>6&63|128,N[s++]=t&63|128);i=s-F-a}else i=o(n,F+a,s);i<24?N[F++]=96|i:i<256?(a<2&&N.copyWithin(F+2,F+1,F+1+i),N[F++]=120,N[F++]=i):i<65536?(a<3&&N.copyWithin(F+3,F+2,F+2+i),N[F++]=121,N[F++]=i>>8,N[F++]=i&255):(a<5&&N.copyWithin(F+5,F+3,F+3+i),N[F++]=122,P.setUint32(F,i),F+=4),F+=i}else if(r===`number`)if(!this.alwaysUseFloat&&n>>>0===n)n<24?N[F++]=n:n<256?(N[F++]=24,N[F++]=n):n<65536?(N[F++]=25,N[F++]=n>>8,N[F++]=n&255):(N[F++]=26,P.setUint32(F,n),F+=4);else if(!this.alwaysUseFloat&&n>>0===n)n>=-24?N[F++]=31-n:n>=-256?(N[F++]=56,N[F++]=~n):n>=-65536?(N[F++]=57,P.setUint16(F,~n),F+=2):(N[F++]=58,P.setUint32(F,~n),F+=4);else{let e;if((e=this.useFloat32)>0&&n<4294967296&&n>=-2147483648){N[F++]=250,P.setFloat32(F,n);let t;if(e<4||(t=n*Gf[(N[F]&127)<<1|N[F+1]>>7])>>0===t){F+=4;return}else F--}N[F++]=251,P.setFloat64(F,n),F+=8}else if(r===`object`)if(!n)N[F++]=246;else{if(a){let e=a.get(n);if(e){if(N[F++]=216,N[F++]=29,N[F++]=25,!e.references){let t=a.idsToInsert||=[];e.references=[],t.push(e)}e.references.push(F-t),F+=2;return}else a.set(n,{offset:F-t})}let e=n.constructor;if(e===Object)y(n);else if(e===Array){i=n.length,i<24?N[F++]=128|i:up(i);for(let e=0;e<i;e++)v(n[e])}else if(e===Map)if((this.mapsAsObjects?this.useTag259ForMaps!==!1:this.useTag259ForMaps)&&(N[F++]=217,N[F++]=1,N[F++]=3),i=n.size,i<24?N[F++]=160|i:i<256?(N[F++]=184,N[F++]=i):i<65536?(N[F++]=185,N[F++]=i>>8,N[F++]=i&255):(N[F++]=186,P.setUint32(F,i),F+=4),s.keyMap)for(let[e,t]of n)v(s.encodeKey(e)),v(t);else for(let[e,t]of n)v(e),v(t);else{for(let e=0,t=Xf.length;e<t;e++){let t=Zf[e];if(n instanceof t){let t=Xf[e],r=t.tag;r??=t.getTag&&t.getTag.call(this,n),r<24?N[F++]=192|r:r<256?(N[F++]=216,N[F++]=r):r<65536?(N[F++]=217,N[F++]=r>>8,N[F++]=r&255):r>-1&&(N[F++]=218,P.setUint32(F,r),F+=4),t.encode.call(this,n,v,b);return}}if(n[Symbol.iterator]){if(rp){let e=Error(`Iterable should be serialized as iterator`);throw e.iteratorNotHandled=!0,e}N[F++]=159;for(let e of n)v(e);N[F++]=255;return}if(n[Symbol.asyncIterator]||fp(n)){let e=Error(`Iterable/blob should be serialized as iterator`);throw e.iteratorNotHandled=!0,e}if(this.useToJSON&&n.toJSON){let e=n.toJSON();if(e!==n)return v(e)}y(n)}}else if(r===`boolean`)N[F++]=n?245:244;else if(r===`bigint`){if(n<BigInt(1)<<BigInt(64)&&n>=0)N[F++]=27,P.setBigUint64(F,n);else if(n>-(BigInt(1)<<BigInt(64))&&n<0)N[F++]=59,P.setBigUint64(F,-n-BigInt(1));else if(this.largeBigIntToFloat)N[F++]=251,P.setFloat64(F,Number(n));else{n>=BigInt(0)?N[F++]=194:(N[F++]=195,n=BigInt(-1)-n);let e=[];for(;n;)e.push(Number(n&BigInt(255))),n>>=BigInt(8);gp(new Uint8Array(e.reverse()),b);return}F+=8}else if(r===`undefined`)N[F++]=247;else throw Error(`Unknown type: `+r)},y=this.useRecords===!1?this.variableMapSize?e=>{let t=Object.keys(e),n=Object.values(e),r=t.length;if(r<24?N[F++]=160|r:r<256?(N[F++]=184,N[F++]=r):r<65536?(N[F++]=185,N[F++]=r>>8,N[F++]=r&255):(N[F++]=186,P.setUint32(F,r),F+=4),s.keyMap)for(let e=0;e<r;e++)v(s.encodeKey(t[e])),v(n[e]);else for(let e=0;e<r;e++)v(t[e]),v(n[e])}:e=>{N[F++]=185;let n=F-t;F+=2;let r=0;if(s.keyMap)for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&(v(s.encodeKey(t)),v(e[t]),r++);else for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&(v(t),v(e[t]),r++);N[n+++t]=r>>8,N[n+t]=r&255}:(e,t)=>{let n,a=i.transitions||=Object.create(null),o=0,s=0,c,u;if(this.keyMap){u=Object.keys(e).map(e=>this.encodeKey(e)),s=u.length;for(let e=0;e<s;e++){let t=u[e];n=a[t],n||(n=a[t]=Object.create(null),o++),a=n}}else for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&(n=a[t],n||(a[op]&1048576&&(c=a[op]&65535),n=a[t]=Object.create(null),o++),a=n,s++);let d=a[op];if(d!==void 0)d&=65535,N[F++]=217,N[F++]=d>>8|224,N[F++]=d&255;else if(u||=a.__keys__||=Object.keys(e),c===void 0?(d=i.nextId++,d||(d=0,i.nextId=1),d>=256&&(i.nextId=(d=l)+1)):d=c,i[d]=u,d<l){N[F++]=217,N[F++]=d>>8|224,N[F++]=d&255,a=i.transitions;for(let e=0;e<s;e++)(a[op]===void 0||a[op]&1048576)&&(a[op]=d),a=a[u[e]];a[op]=d|1048576,r=!0}else{if(a[op]=d,P.setUint32(F,3655335680),F+=3,o&&(g+=_*o),h.length>=256-l&&(h.shift()[op]=void 0),h.push(a),up(s+2),v(57344+d),v(u),t)return;for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&v(e[t]);return}if(s<24?N[F++]=128|s:up(s),!t)for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&v(e[t])},b=e=>{let n;if(e>16777216){if(e-t>np)throw Error(`Encoded buffer would be larger than maximum buffer size`);n=Math.min(np,Math.round(Math.max((e-t)*(e>67108864?1.25:2),4194304)/4096)*4096)}else n=(Math.max(e-t<<2,N.length-1)>>12)+1<<12;let r=new ep(n);return P=new DataView(r.buffer,0,n),N.copy?N.copy(r,0,t,e):r.set(N.slice(t,e)),F-=t,t=0,ip=r.length-10,N=r},ee=100,te=1e3;this.encodeAsIterable=function(e,t){return ae(e,t,ne)},this.encodeAsAsyncIterable=function(e,t){return ae(e,t,oe)};function*ne(e,n,r){let i=e.constructor;if(i===Object){let t=s.useRecords!==!1;t?y(e,!0):cp(Object.keys(e).length,160);for(let r in e){let i=e[r];t||v(r),i&&typeof i==`object`?n[r]?yield*ne(i,n[r]):yield*re(i,n,r):v(i)}}else if(i===Array){let r=e.length;up(r);for(let i=0;i<r;i++){let r=e[i];r&&(typeof r==`object`||F-t>ee)?n.element?yield*ne(r,n.element):yield*re(r,n,`element`):v(r)}}else if(e[Symbol.iterator]&&!e.buffer){N[F++]=159;for(let r of e)r&&(typeof r==`object`||F-t>ee)?n.element?yield*ne(r,n.element):yield*re(r,n,`element`):v(r);N[F++]=255}else fp(e)?(cp(e.size,64),yield N.subarray(t,F),yield e,ie()):e[Symbol.asyncIterator]?(N[F++]=159,yield N.subarray(t,F),yield e,ie(),N[F++]=255):v(e);r&&F>t?yield N.subarray(t,F):F-t>ee&&(yield N.subarray(t,F),ie())}function*re(e,n,r){let i=F-t;try{v(e),F-t>ee&&(yield N.subarray(t,F),ie())}catch(a){if(a.iteratorNotHandled)n[r]={},F=t+i,yield*ne.call(this,e,n[r]);else throw a}}function ie(){ee=te,s.encode(null,Tp)}function ae(e,t,n){return ee=t&&t.chunkThreshold?te=t.chunkThreshold:100,e&&typeof e==`object`?(s.encode(null,Tp),n(e,s.iterateProperties||={},!0)):[s.encode(e)]}async function*oe(e,t){for(let n of ne(e,t,!0)){let e=n.constructor;if(e===tp||e===Uint8Array)yield n;else if(fp(n)){let e=n.stream().getReader(),t;for(;!(t=await e.read()).done;)yield t.value}else if(n[Symbol.asyncIterator])for await(let e of n)ie(),e?yield*oe(e,t.async||={}):yield s.encode(e);else yield n}}}useBuffer(e){N=e,P=new DataView(N.buffer,N.byteOffset,N.byteLength),F=0}clearSharedData(){this.structures&&=[],this.sharedValues&&=void 0}updateSharedData(){let e=this.sharedVersion||0;this.sharedVersion=e+1;let t=this.structures.slice(0),n=new lp(t,this.sharedValues,this.sharedVersion),r=this.saveShared(n,t=>(t&&t.version||0)==e);return r===!1?(n=this.getShared()||{},this.structures=n.structures||[],this.sharedValues=n.packedValues,this.sharedVersion=n.version,this.structures.nextId=this.structures.length):t.forEach((e,t)=>this.structures[t]=e),r}};function cp(e,t){e<24?N[F++]=t|e:e<256?(N[F++]=t|24,N[F++]=e):e<65536?(N[F++]=t|25,N[F++]=e>>8,N[F++]=e&255):(N[F++]=t|26,P.setUint32(F,e),F+=4)}var lp=class{constructor(e,t,n){this.structures=e,this.packedValues=t,this.version=n}};function up(e){e<24?N[F++]=128|e:e<256?(N[F++]=152,N[F++]=e):e<65536?(N[F++]=153,N[F++]=e>>8,N[F++]=e&255):(N[F++]=154,P.setUint32(F,e),F+=4)}const dp=typeof Blob>`u`?function(){}:Blob;function fp(e){if(e instanceof dp)return!0;let t=e[Symbol.toStringTag];return t===`Blob`||t===`File`}function pp(e,t){switch(typeof e){case`string`:if(e.length>3){if(t.objectMap[e]>-1||t.values.length>=t.maxValues)return;let n=t.get(e);if(n)++n.count==2&&t.values.push(e);else if(t.set(e,{count:1}),t.samplingPackedValues){let n=t.samplingPackedValues.get(e);n?n.count++:t.samplingPackedValues.set(e,{count:1})}}break;case`object`:if(e)if(e instanceof Array)for(let n=0,r=e.length;n<r;n++)pp(e[n],t);else{let r=!t.encoder.useRecords;for(var n in e)e.hasOwnProperty(n)&&(r&&pp(n,t),pp(e[n],t))}break;case`function`:console.log(e)}}const mp=new Uint8Array(new Uint16Array([1]).buffer)[0]==1;Zf=[Date,Set,Error,RegExp,Af,ArrayBuffer,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array>`u`?function(){}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>`u`?function(){}:BigInt64Array,Float32Array,Float64Array,lp],Xf=[{tag:1,encode(e,t){let n=e.getTime()/1e3;(this.useTimestamp32||e.getMilliseconds()===0)&&n>=0&&n<4294967296?(N[F++]=26,P.setUint32(F,n),F+=4):(N[F++]=251,P.setFloat64(F,n),F+=8)}},{tag:258,encode(e,t){t(Array.from(e))}},{tag:27,encode(e,t){t([e.name,e.message])}},{tag:27,encode(e,t){t([`RegExp`,e.source,e.flags])}},{getTag(e){return e.tag},encode(e,t){t(e.value)}},{encode(e,t,n){gp(e,n)}},{getTag(e){if(e.constructor===Uint8Array&&(this.tagUint8Array||$f&&this.tagUint8Array!==!1))return 64},encode(e,t,n){gp(e,n)}},hp(68,1),hp(69,2),hp(70,4),hp(71,8),hp(72,1),hp(77,2),hp(78,4),hp(79,8),hp(85,4),hp(86,8),{encode(e,t){let n=e.packedValues||[],r=e.structures||[];if(n.values.length>0){N[F++]=216,N[F++]=51,up(4);let e=n.values;t(e),up(0),up(0),packedObjectMap=Object.create(sharedPackedObjectMap||null);for(let t=0,n=e.length;t<n;t++)packedObjectMap[e[t]]=t}if(r){P.setUint32(F,3655335424),F+=3;let n=r.slice(0);n.unshift(57344),n.push(new Af(e.version,1399353956)),t(n)}else t(new Af(e.version,1399353956))}}];function hp(e,t){return!mp&&t>1&&(e-=4),{tag:e,encode:function(e,t){let n=e.byteLength,r=e.byteOffset||0,i=e.buffer||e;t($f?Qf.from(i,r,n):new Uint8Array(i,r,n))}}}function gp(e,t){let n=e.byteLength;n<24?N[F++]=64+n:n<256?(N[F++]=88,N[F++]=n):n<65536?(N[F++]=89,N[F++]=n>>8,N[F++]=n&255):(N[F++]=90,P.setUint32(F,n),F+=4),F+n>=N.length&&t(F+n),N.set(e.buffer?e:new Uint8Array(e),F),F+=n}function _p(e,t){let n,r=t.length*2,i=e.length-r;t.sort((e,t)=>e.offset>t.offset?1:-1);for(let n=0;n<t.length;n++){let r=t[n];r.id=n;for(let t of r.references)e[t++]=n>>8,e[t]=n&255}for(;n=t.pop();){let t=n.offset;e.copyWithin(t+r,t,i),r-=2;let a=t+r;e[a++]=216,e[a++]=28,i=t}return e}function vp(e,t){P.setUint32(I.position+e,F-I.position-e+1);let n=I;I=null,t(n[0]),t(n[1])}let yp=new sp({useRecords:!1});const bp=yp.encode;yp.encodeAsIterable,yp.encodeAsAsyncIterable;const{NEVER:xp,ALWAYS:Sp,DECIMAL_ROUND:Cp,DECIMAL_FIT:wp}=Jf,Tp=2048;var Ep=i(((e,t)=>{let n=()=>process.platform===`linux`,r=null;t.exports={isLinux:n,getReport:()=>{if(!r)if(n()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,r=process.report.getReport(),process.report.excludeNetwork=e}else r={};return r}}})),Dp=i(((t,n)=>{let r=e(`fs`),i=2048;n.exports={LDD_PATH:`/usr/bin/ldd`,SELF_PATH:`/proc/self/exe`,readFileSync:e=>{let t=r.openSync(e,`r`),n=Buffer.alloc(i),a=r.readSync(t,n,0,i,0);return r.close(t,()=>{}),n.subarray(0,a)},readFile:e=>new Promise((t,n)=>{r.open(e,`r`,(e,a)=>{if(e)n(e);else{let e=Buffer.alloc(i);r.read(a,e,0,i,0,(n,i)=>{t(e.subarray(0,i)),r.close(a,()=>{})})}})})}})),Op=i(((e,t)=>{t.exports={interpreterPath:e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),n=e.readUInt16LE(54),r=e.readUInt16LE(56);for(let i=0;i<r;i++){let r=t+i*n;if(e.readUInt32LE(r)===3){let t=e.readUInt32LE(r+8),n=e.readUInt32LE(r+32);return e.subarray(t,t+n).toString().replace(/\0.*$/g,``)}}return null}}})),kp=i(((t,n)=>{let r=e(`child_process`),{isLinux:i,getReport:a}=Ep(),{LDD_PATH:o,SELF_PATH:s,readFile:c,readFileSync:l}=Dp(),{interpreterPath:u}=Op(),d,f,p,m=`getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true`,h=``,g=()=>h||new Promise(e=>{r.exec(m,(t,n)=>{h=t?` `:n,e(h)})}),_=()=>{if(!h)try{h=r.execSync(m,{encoding:`utf8`})}catch{h=` `}return h},v=`glibc`,y=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,b=`musl`,ee=e=>e.includes(`libc.musl-`)||e.includes(`ld-musl-`),te=()=>{let e=a();return e.header&&e.header.glibcVersionRuntime?v:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(ee)?b:null},ne=e=>{let[t,n]=e.split(/[\r\n]+/);return t&&t.includes(v)?v:n&&n.includes(b)?b:null},re=e=>{if(e){if(e.includes(`/ld-musl-`))return b;if(e.includes(`/ld-linux-`))return v}return null},ie=e=>(e=e.toString(),e.includes(`musl`)?b:e.includes(`GNU C Library`)?v:null),ae=async()=>{if(f!==void 0)return f;f=null;try{let e=await c(o);f=ie(e)}catch{}return f},oe=()=>{if(f!==void 0)return f;f=null;try{let e=l(o);f=ie(e)}catch{}return f},se=async()=>{if(d!==void 0)return d;d=null;try{let e=await c(s),t=u(e);d=re(t)}catch{}return d},ce=()=>{if(d!==void 0)return d;d=null;try{let e=l(s),t=u(e);d=re(t)}catch{}return d},le=async()=>{let e=null;if(i()&&(e=await se(),!e&&(e=await ae(),e||=te(),!e))){let t=await g();e=ne(t)}return e},ue=()=>{let e=null;if(i()&&(e=ce(),!e&&(e=oe(),e||=te(),!e))){let t=_();e=ne(t)}return e},de=async()=>i()&&await le()!==v,fe=()=>i()&&ue()!==v,pe=async()=>{if(p!==void 0)return p;p=null;try{let e=(await c(o)).match(y);e&&(p=e[1])}catch{}return p},me=()=>{if(p!==void 0)return p;p=null;try{let e=l(o).match(y);e&&(p=e[1])}catch{}return p},he=()=>{let e=a();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},ge=e=>e.trim().split(/\s+/)[1],_e=e=>{let[t,n,r]=e.split(/[\r\n]+/);return t&&t.includes(v)?ge(t):n&&r&&n.includes(b)?ge(r):null};n.exports={GLIBC:v,MUSL:b,family:le,familySync:ue,isNonGlibcLinux:de,isNonGlibcLinuxSync:fe,version:async()=>{let e=null;if(i()&&(e=await pe(),e||=he(),!e)){let t=await g();e=_e(t)}return e},versionSync:()=>{let e=null;if(i()&&(e=me(),e||=he(),!e)){let t=_();e=_e(t)}return e}}})),Ap=i(((t,n)=>{var r=e(`fs`),i=e(`path`),a=e(`url`),o=process.config&&process.config.variables||{},s=!!process.env.PREBUILDS_ONLY,c=process.versions,l=c.modules;(c.deno||process.isBun)&&(l=`unsupported`);var u=oe()?`electron`:`node`,d=process.arch,f=process.platform,p=process.env.LIBC||(se(f)?`musl`:`glibc`),m=process.env.ARM_VERSION||(d===`arm64`?`8`:o.arm_version)||``,h=(c.uv||``).split(`.`)[0];n.exports=g;function g(t){return typeof __webpack_require__==`function`?__non_webpack_require__(g.path(t)):e(g.path(t))}g.path=function(t){t=i.resolve(t||`.`);var n=``;try{n=typeof __webpack_require__==`function`?__non_webpack_require__(i.join(t,`package.json`)).name:e(i.join(t,`package.json`)).name;var r=n.toUpperCase().replace(/-/g,`_`)+`_PREBUILD`;process.env[r]&&(t=process.env[r])}catch{}if(!s){var o=v(i.join(t,`build/Release`),y);if(o)return o;var c=v(i.join(t,`build/Debug`),y);if(c)return c}var g=ce(t);if(g)return g;var ie=ce(i.dirname(process.execPath));if(ie)return ie;var oe=(n[0]==`@`?``:`@`+n+`/`)+n+`-`+f+`-`+d;try{return le(i.dirname(e(`module`).createRequire(a.pathToFileURL(i.join(t,`package.json`))).resolve(oe)))}catch{}var se=[`platform=`+f,`arch=`+d,`runtime=`+u,`abi=`+l,`uv=`+h,m?`armv=`+m:``,`libc=`+p,`node=`+process.versions.node,process.versions.electron?`electron=`+process.versions.electron:``,typeof __webpack_require__==`function`?`webpack=true`:``].filter(Boolean).join(` `);throw Error(`No native build was found for `+se+`
1
+ import{i as e,n as t,o as n,r,t as i}from"../../_chunks/workflow/rolldown-runtime-DaDcL9Zw.js";import{E as a,O as o,_ as s,c,d as l,g as u,o as d,r as f}from"../../_chunks/workflow/dist-CRTn4Sg8.js";import{$ as p,$a as m,$i as h,$n as g,$o as _,$r as v,$s as y,$t as b,A as ee,Aa as te,Ai as ne,An as re,Ao as ie,Ar as ae,As as oe,At as se,B as ce,Ba as le,Bi as ue,Bn as de,Bo as fe,Br as pe,Bs as me,Bt as he,C as ge,Ca as _e,Cc as ve,Ci as ye,Cn as be,Co as xe,Cr as Se,Cs as Ce,Ct as we,D as Te,Da as Ee,Dc as De,Di as Oe,Dn as ke,Do as Ae,Dr as je,Ds as Me,Dt as Ne,E as Pe,Ea as Fe,Ec as Ie,Ei as Le,En as Re,Eo as ze,Er as Be,Es as Ve,Et as He,F as Ue,Fa as We,Fi as Ge,Fn as Ke,Fo as qe,Fr as Je,Fs as Ye,Ft as Xe,G as Ze,Ga as Qe,Gi as $e,Gn as et,Go as tt,Gr as nt,Gs as rt,Gt as it,H as at,Ha as ot,Hi as st,Hn as ct,Ho as lt,Hr as ut,Hs as dt,Ht as ft,I as pt,Ia as mt,Ii as ht,In as gt,Io as _t,Ir as vt,Is as yt,It as bt,J as xt,Ja as St,Ji as Ct,Jn as wt,Jo as Tt,Jr as Et,Js as Dt,Jt as Ot,K as kt,Ka as At,Ki as jt,Kn as Mt,Ko as Nt,Kr as Pt,Ks as Ft,Kt as It,L as Lt,La as Rt,Li as zt,Ln as Bt,Lo as Vt,Lr as Ht,Ls as Ut,Lt as Wt,M as Gt,Ma as Kt,Mi as qt,Mn as Jt,Mo as Yt,Mr as Xt,Ms as Zt,Mt as Qt,N as $t,Na as en,Ni as tn,Nn as nn,No as rn,Nr as an,Ns as on,Nt as sn,O as cn,Oa as ln,Oc as un,Oi as dn,On as fn,Oo as pn,Or as mn,Os as hn,Ot as gn,P as _n,Pa as vn,Pi as yn,Pn as bn,Po as xn,Pr as Sn,Ps as Cn,Pt as wn,Q as Tn,Qa as En,Qi as Dn,Qn as On,Qo as kn,Qr as An,Qs as jn,Qt as Mn,R as Nn,Ra as Pn,Ri as Fn,Rn as In,Ro as Ln,Rr as Rn,Rs as zn,Rt as Bn,S as Vn,Sa as Hn,Sc as Un,Si as Wn,Sn as Gn,So as Kn,Sr as qn,Ss as Jn,St as Yn,T as Xn,Ta as Zn,Tc as Qn,Ti as $n,Tn as er,To as tr,Tr as nr,Ts as rr,Tt as ir,U as ar,Ua as or,Ui as sr,Un as cr,Uo as lr,Ur as ur,Us as dr,Ut as fr,V as pr,Va as mr,Vi as hr,Vn as gr,Vo as _r,Vr as vr,Vs as yr,Vt as br,W as xr,Wa as Sr,Wi as Cr,Wn as wr,Wo as Tr,Wr as Er,Ws as Dr,Wt as Or,X as kr,Xa as Ar,Xi as jr,Xn as Mr,Xo as Nr,Xr as Pr,Xs as Fr,Xt as Ir,Y as Lr,Ya as Rr,Yi as zr,Yn as Br,Yo as Vr,Yr as Hr,Ys as Ur,Yt as Wr,Z as Gr,Za as Kr,Zi as qr,Zn as Jr,Zo as Yr,Zr as Xr,Zs as Zr,Zt as Qr,_ as $r,_a as ei,_c as ti,_i as ni,_n as ri,_o as ii,_r as ai,_s as oi,_t as si,aa as ci,ac as li,ai as ui,an as di,ao as fi,ar as pi,as as mi,at as hi,b as gi,ba as _i,bc as x,bi as vi,bn as yi,bo as bi,br as xi,bs as Si,bt as Ci,c as wi,ca as Ti,cc as Ei,ci as Di,cn as Oi,co as ki,cr as Ai,cs as ji,ct as Mi,d as Ni,da as Pi,dc as Fi,di as Ii,dn as Li,do as Ri,dr as zi,ds as Bi,dt as Vi,ea as Hi,ec as Ui,ei as Wi,en as Gi,eo as Ki,er as qi,es as Ji,et as Yi,f as Xi,fa as Zi,fc as Qi,fi as $i,fn as ea,fo as ta,fr as na,fs as ra,ft as ia,g as aa,ga as oa,gc as sa,gi as ca,gn as la,go as ua,gr as da,gs as fa,gt as pa,h as ma,ha,hc as ga,hi as _a,hn as va,ho as ya,hr as ba,hs as xa,ht as Sa,i as Ca,ia as wa,ic as Ta,ii as Ea,in as Da,io as Oa,ir as ka,is as Aa,it as ja,j as Ma,ja as Na,ji as Pa,jn as Fa,jo as Ia,jr as La,js as Ra,jt as za,k as Ba,ka as Va,kc as Ha,ki as Ua,kn as Wa,ko as Ga,kr as Ka,ks as qa,kt as Ja,l as Ya,la as Xa,lc as Za,li as Qa,ln as $a,lo as eo,lr as to,ls as no,lt as ro,m as io,ma as ao,mc as oo,mi as so,mn as co,mo as lo,mr as uo,ms as fo,mt as po,n as mo,na as ho,nc as go,ni as _o,nn as vo,no as yo,nr as bo,ns as xo,nt as So,oa as Co,oc as wo,oi as To,on as Eo,oo as Do,or as Oo,os as ko,ot as Ao,p as jo,pa as Mo,pc as No,pi as Po,pn as Fo,po as Io,pr as Lo,ps as Ro,pt as zo,q as Bo,qa as Vo,qi as Ho,qn as Uo,qo as Wo,qr as Go,qs as Ko,qt as qo,ra as Jo,rc as Yo,ri as Xo,rn as Zo,ro as Qo,rr as $o,rs as es,rt as ts,s as ns,sa as rs,sc as is,si as as,sn as os,so as ss,sr as cs,ss as ls,st as us,ta as ds,tc as fs,ti as ps,tn as ms,to as hs,tr as gs,ts as _s,tt as vs,u as ys,ua as bs,uc as xs,ui as Ss,un as Cs,uo as ws,ur as Ts,us as Es,ut as Ds,v as Os,va as ks,vc as As,vi as js,vn as Ms,vo as Ns,vr as Ps,vs as Fs,vt as Is,w as Ls,wa as Rs,wc as zs,wi as Bs,wn as Vs,wo as Hs,wr as Us,ws as Ws,wt as Gs,x as Ks,xa as qs,xc as S,xi as Js,xn as Ys,xo as Xs,xr as Zs,xs as Qs,xt as $s,y as ec,ya as tc,yc as C,yi as nc,yn as rc,yo as ic,yr as ac,ys as oc,yt as sc,z as cc,za as lc,zi as uc,zn as dc,zo as fc,zr as pc,zs as mc,zt as hc}from"../../_chunks/workflow/node-Smb57EnG.js";import{C as gc,D as _c,E as vc,I as yc,L as bc,O as xc,S as Sc,_ as Cc,a as wc,c as Tc,f as Ec,g as Dc,h as Oc,i as kc,j as Ac,k as jc,l as Mc,m as Nc,p as Pc,r as Fc,s as Ic,u as Lc,x as Rc,y as zc,z as Bc}from"../../_chunks/workflow/dist-C8PhDW9B.js";import{t as Vc}from"../../_chunks/workflow/undici-BNc_0O4m.js";import{n as Hc,r as Uc,t as Wc}from"../../_chunks/workflow/token-util-Ldar52H7.js";import{i as Gc,r as Kc,t as qc}from"../../_chunks/workflow/token-util-DNwIAn_u.js";import{createRequire as Jc}from"module";import*as Yc from"path";import*as Xc from"node:crypto";import{KeyObject as Zc,constants as Qc,createCipheriv as $c,createDecipheriv as el,createHash as tl,createHmac as nl,createPrivateKey as rl,createPublicKey as il,createSecretKey as al,diffieHellman as ol,generateKeyPair as sl,getCiphers as cl,pbkdf2 as ll,privateDecrypt as ul,publicEncrypt as dl,randomFillSync as fl,timingSafeEqual as pl,webcrypto as ml}from"node:crypto";import*as hl from"node:util";import{deprecate as gl,inspect as _l,promisify as vl}from"node:util";import{AsyncLocalStorage as yl}from"node:async_hooks";import bl from"node:os";import*as xl from"node:http";import{once as Sl}from"node:events";import{Buffer as Cl}from"node:buffer";import*as wl from"fs";import*as Tl from"net";import*as El from"node:https";const Dl=()=>{let e={string:{unit:`حرف`,verb:`أن يحوي`},file:{unit:`بايت`,verb:`أن يحوي`},array:{unit:`عنصر`,verb:`أن يحوي`},set:{unit:`عنصر`,verb:`أن يحوي`}};function t(t){return e[t]??null}let n={regex:`مدخل`,email:`بريد إلكتروني`,url:`رابط`,emoji:`إيموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاريخ ووقت بمعيار ISO`,date:`تاريخ بمعيار ISO`,time:`وقت بمعيار ISO`,duration:`مدة بمعيار ISO`,ipv4:`عنوان IPv4`,ipv6:`عنوان IPv6`,cidrv4:`مدى عناوين بصيغة IPv4`,cidrv6:`مدى عناوين بصيغة IPv6`,base64:`نَص بترميز base64-encoded`,base64url:`نَص بترميز base64url-encoded`,json_string:`نَص على هيئة JSON`,e164:`رقم هاتف بمعيار E.164`,jwt:`JWT`,template_literal:`مدخل`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${e.expected}، ولكن تم إدخال ${i}`:`مدخلات غير مقبولة: يفترض إدخال ${t}، ولكن تم إدخال ${i}`}case`invalid_value`:return e.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${S(e.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?` أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()} ${r.unit??`عنصر`}`:`أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()} ${r.unit}`:`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`نَص غير مقبول: يجب أن يبدأ بـ "${e.prefix}"`:t.format===`ends_with`?`نَص غير مقبول: يجب أن ينتهي بـ "${t.suffix}"`:t.format===`includes`?`نَص غير مقبول: يجب أن يتضمَّن "${t.includes}"`:t.format===`regex`?`نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}`:`${n[t.format]??e.format} غير مقبول`}case`not_multiple_of`:return`رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`;case`unrecognized_keys`:return`معرف${e.keys.length>1?`ات`:``} غريب${e.keys.length>1?`ة`:``}: ${C(e.keys,`، `)}`;case`invalid_key`:return`معرف غير مقبول في ${e.origin}`;case`invalid_union`:return`مدخل غير مقبول`;case`invalid_element`:return`مدخل غير مقبول في ${e.origin}`;default:return`مدخل غير مقبول`}}};function Ol(){return{localeError:Dl()}}const kl=()=>{let e={string:{unit:`simvol`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`element`,verb:`olmalıdır`},set:{unit:`element`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Yanlış dəyər: gözlənilən instanceof ${e.expected}, daxil olan ${i}`:`Yanlış dəyər: gözlənilən ${t}, daxil olan ${i}`}case`invalid_value`:return e.values.length===1?`Yanlış dəyər: gözlənilən ${S(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()} ${r.unit??`element`}`:`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Yanlış mətn: "${t.prefix}" ilə başlamalıdır`:t.format===`ends_with`?`Yanlış mətn: "${t.suffix}" ilə bitməlidir`:t.format===`includes`?`Yanlış mətn: "${t.includes}" daxil olmalıdır`:t.format===`regex`?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${n[t.format]??e.format}`}case`not_multiple_of`:return`Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`;case`unrecognized_keys`:return`Tanınmayan açar${e.keys.length>1?`lar`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} daxilində yanlış açar`;case`invalid_union`:return`Yanlış dəyər`;case`invalid_element`:return`${e.origin} daxilində yanlış dəyər`;default:return`Yanlış dəyər`}}};function Al(){return{localeError:kl()}}function jl(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}const Ml=()=>{let e={string:{unit:{one:`сімвал`,few:`сімвалы`,many:`сімвалаў`},verb:`мець`},array:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},set:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},file:{unit:{one:`байт`,few:`байты`,many:`байтаў`},verb:`мець`}};function t(t){return e[t]??null}let n={regex:`увод`,email:`email адрас`,url:`URL`,emoji:`эмодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата і час`,date:`ISO дата`,time:`ISO час`,duration:`ISO працягласць`,ipv4:`IPv4 адрас`,ipv6:`IPv6 адрас`,cidrv4:`IPv4 дыяпазон`,cidrv6:`IPv6 дыяпазон`,base64:`радок у фармаце base64`,base64url:`радок у фармаце base64url`,json_string:`JSON радок`,e164:`нумар E.164`,jwt:`JWT`,template_literal:`увод`},r={nan:`NaN`,number:`лік`,array:`масіў`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Няправільны ўвод: чакаўся instanceof ${e.expected}, атрымана ${i}`:`Няправільны ўвод: чакаўся ${t}, атрымана ${i}`}case`invalid_value`:return e.values.length===1?`Няправільны ўвод: чакалася ${S(e.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=jl(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна ${r.verb} ${n}${e.maximum.toString()} ${t}`}return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна быць ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=jl(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Занадта малы: чакалася, што ${e.origin} павінна ${r.verb} ${n}${e.minimum.toString()} ${t}`}return`Занадта малы: чакалася, што ${e.origin} павінна быць ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Няправільны радок: павінен пачынацца з "${t.prefix}"`:t.format===`ends_with`?`Няправільны радок: павінен заканчвацца на "${t.suffix}"`:t.format===`includes`?`Няправільны радок: павінен змяшчаць "${t.includes}"`:t.format===`regex`?`Няправільны радок: павінен адпавядаць шаблону ${t.pattern}`:`Няправільны ${n[t.format]??e.format}`}case`not_multiple_of`:return`Няправільны лік: павінен быць кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспазнаны ${e.keys.length>1?`ключы`:`ключ`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Няправільны ключ у ${e.origin}`;case`invalid_union`:return`Няправільны ўвод`;case`invalid_element`:return`Няправільнае значэнне ў ${e.origin}`;default:return`Няправільны ўвод`}}};function Nl(){return{localeError:Ml()}}const Pl=()=>{let e={string:{unit:`символа`,verb:`да съдържа`},file:{unit:`байта`,verb:`да съдържа`},array:{unit:`елемента`,verb:`да съдържа`},set:{unit:`елемента`,verb:`да съдържа`}};function t(t){return e[t]??null}let n={regex:`вход`,email:`имейл адрес`,url:`URL`,emoji:`емоджи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO време`,date:`ISO дата`,time:`ISO време`,duration:`ISO продължителност`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`base64-кодиран низ`,base64url:`base64url-кодиран низ`,json_string:`JSON низ`,e164:`E.164 номер`,jwt:`JWT`,template_literal:`вход`},r={nan:`NaN`,number:`число`,array:`масив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Невалиден вход: очакван instanceof ${e.expected}, получен ${i}`:`Невалиден вход: очакван ${t}, получен ${i}`}case`invalid_value`:return e.values.length===1?`Невалиден вход: очакван ${S(e.values[0])}`:`Невалидна опция: очаквано едно от ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Твърде голямо: очаква се ${e.origin??`стойност`} да съдържа ${n}${e.maximum.toString()} ${r.unit??`елемента`}`:`Твърде голямо: очаква се ${e.origin??`стойност`} да бъде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Твърде малко: очаква се ${e.origin} да съдържа ${n}${e.minimum.toString()} ${r.unit}`:`Твърде малко: очаква се ${e.origin} да бъде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;if(t.format===`starts_with`)return`Невалиден низ: трябва да започва с "${t.prefix}"`;if(t.format===`ends_with`)return`Невалиден низ: трябва да завършва с "${t.suffix}"`;if(t.format===`includes`)return`Невалиден низ: трябва да включва "${t.includes}"`;if(t.format===`regex`)return`Невалиден низ: трябва да съвпада с ${t.pattern}`;let r=`Невалиден`;return t.format===`emoji`&&(r=`Невалидно`),t.format===`datetime`&&(r=`Невалидно`),t.format===`date`&&(r=`Невалидна`),t.format===`time`&&(r=`Невалидно`),t.format===`duration`&&(r=`Невалидна`),`${r} ${n[t.format]??e.format}`}case`not_multiple_of`:return`Невалидно число: трябва да бъде кратно на ${e.divisor}`;case`unrecognized_keys`:return`Неразпознат${e.keys.length>1?`и`:``} ключ${e.keys.length>1?`ове`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Невалиден ключ в ${e.origin}`;case`invalid_union`:return`Невалиден вход`;case`invalid_element`:return`Невалидна стойност в ${e.origin}`;default:return`Невалиден вход`}}};function Fl(){return{localeError:Pl()}}const Il=()=>{let e={string:{unit:`caràcters`,verb:`contenir`},file:{unit:`bytes`,verb:`contenir`},array:{unit:`elements`,verb:`contenir`},set:{unit:`elements`,verb:`contenir`}};function t(t){return e[t]??null}let n={regex:`entrada`,email:`adreça electrònica`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`durada ISO`,ipv4:`adreça IPv4`,ipv6:`adreça IPv6`,cidrv4:`rang IPv4`,cidrv6:`rang IPv6`,base64:`cadena codificada en base64`,base64url:`cadena codificada en base64url`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Tipus invàlid: s'esperava instanceof ${e.expected}, s'ha rebut ${i}`:`Tipus invàlid: s'esperava ${t}, s'ha rebut ${i}`}case`invalid_value`:return e.values.length===1?`Valor invàlid: s'esperava ${S(e.values[0])}`:`Opció invàlida: s'esperava una de ${C(e.values,` o `)}`;case`too_big`:{let n=e.inclusive?`com a màxim`:`menys de`,r=t(e.origin);return r?`Massa gran: s'esperava que ${e.origin??`el valor`} contingués ${n} ${e.maximum.toString()} ${r.unit??`elements`}`:`Massa gran: s'esperava que ${e.origin??`el valor`} fos ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`com a mínim`:`més de`,r=t(e.origin);return r?`Massa petit: s'esperava que ${e.origin} contingués ${n} ${e.minimum.toString()} ${r.unit}`:`Massa petit: s'esperava que ${e.origin} fos ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Format invàlid: ha de començar amb "${t.prefix}"`:t.format===`ends_with`?`Format invàlid: ha d'acabar amb "${t.suffix}"`:t.format===`includes`?`Format invàlid: ha d'incloure "${t.includes}"`:t.format===`regex`?`Format invàlid: ha de coincidir amb el patró ${t.pattern}`:`Format invàlid per a ${n[t.format]??e.format}`}case`not_multiple_of`:return`Número invàlid: ha de ser múltiple de ${e.divisor}`;case`unrecognized_keys`:return`Clau${e.keys.length>1?`s`:``} no reconeguda${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Clau invàlida a ${e.origin}`;case`invalid_union`:return`Entrada invàlida`;case`invalid_element`:return`Element invàlid a ${e.origin}`;default:return`Entrada invàlida`}}};function Ll(){return{localeError:Il()}}const Rl=()=>{let e={string:{unit:`znaků`,verb:`mít`},file:{unit:`bajtů`,verb:`mít`},array:{unit:`prvků`,verb:`mít`},set:{unit:`prvků`,verb:`mít`}};function t(t){return e[t]??null}let n={regex:`regulární výraz`,email:`e-mailová adresa`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`datum a čas ve formátu ISO`,date:`datum ve formátu ISO`,time:`čas ve formátu ISO`,duration:`doba trvání ISO`,ipv4:`IPv4 adresa`,ipv6:`IPv6 adresa`,cidrv4:`rozsah IPv4`,cidrv6:`rozsah IPv6`,base64:`řetězec zakódovaný ve formátu base64`,base64url:`řetězec zakódovaný ve formátu base64url`,json_string:`řetězec ve formátu JSON`,e164:`číslo E.164`,jwt:`JWT`,template_literal:`vstup`},r={nan:`NaN`,number:`číslo`,string:`řetězec`,function:`funkce`,array:`pole`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neplatný vstup: očekáváno instanceof ${e.expected}, obdrženo ${i}`:`Neplatný vstup: očekáváno ${t}, obdrženo ${i}`}case`invalid_value`:return e.values.length===1?`Neplatný vstup: očekáváno ${S(e.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Hodnota je příliš velká: ${e.origin??`hodnota`} musí mít ${n}${e.maximum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš velká: ${e.origin??`hodnota`} musí být ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Hodnota je příliš malá: ${e.origin??`hodnota`} musí mít ${n}${e.minimum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš malá: ${e.origin??`hodnota`} musí být ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neplatný řetězec: musí začínat na "${t.prefix}"`:t.format===`ends_with`?`Neplatný řetězec: musí končit na "${t.suffix}"`:t.format===`includes`?`Neplatný řetězec: musí obsahovat "${t.includes}"`:t.format===`regex`?`Neplatný řetězec: musí odpovídat vzoru ${t.pattern}`:`Neplatný formát ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neplatné číslo: musí být násobkem ${e.divisor}`;case`unrecognized_keys`:return`Neznámé klíče: ${C(e.keys,`, `)}`;case`invalid_key`:return`Neplatný klíč v ${e.origin}`;case`invalid_union`:return`Neplatný vstup`;case`invalid_element`:return`Neplatná hodnota v ${e.origin}`;default:return`Neplatný vstup`}}};function zl(){return{localeError:Rl()}}const Bl=()=>{let e={string:{unit:`tegn`,verb:`havde`},file:{unit:`bytes`,verb:`havde`},array:{unit:`elementer`,verb:`indeholdt`},set:{unit:`elementer`,verb:`indeholdt`}};function t(t){return e[t]??null}let n={regex:`input`,email:`e-mailadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslæt`,date:`ISO-dato`,time:`ISO-klokkeslæt`,duration:`ISO-varighed`,ipv4:`IPv4-område`,ipv6:`IPv6-område`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodet streng`,base64url:`base64url-kodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,string:`streng`,number:`tal`,boolean:`boolean`,array:`liste`,object:`objekt`,set:`sæt`,file:`fil`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldigt input: forventede instanceof ${e.expected}, fik ${i}`:`Ugyldigt input: forventede ${t}, fik ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig værdi: forventede ${S(e.values[0])}`:`Ugyldigt valg: forventede en af følgende ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`For stor: forventede ${a??`value`} ${i.verb} ${n} ${e.maximum.toString()} ${i.unit??`elementer`}`:`For stor: forventede ${a??`value`} havde ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`For lille: forventede ${a} ${i.verb} ${n} ${e.minimum.toString()} ${i.unit}`:`For lille: forventede ${a} havde ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: skal starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: skal ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: skal indeholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: skal matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldigt tal: skal være deleligt med ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukendte nøgler`:`Ukendt nøgle`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøgle i ${e.origin}`;case`invalid_union`:return`Ugyldigt input: matcher ingen af de tilladte typer`;case`invalid_element`:return`Ugyldig værdi i ${e.origin}`;default:return`Ugyldigt input`}}};function Vl(){return{localeError:Bl()}}const Hl=()=>{let e={string:{unit:`Zeichen`,verb:`zu haben`},file:{unit:`Bytes`,verb:`zu haben`},array:{unit:`Elemente`,verb:`zu haben`},set:{unit:`Elemente`,verb:`zu haben`}};function t(t){return e[t]??null}let n={regex:`Eingabe`,email:`E-Mail-Adresse`,url:`URL`,emoji:`Emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-Datum und -Uhrzeit`,date:`ISO-Datum`,time:`ISO-Uhrzeit`,duration:`ISO-Dauer`,ipv4:`IPv4-Adresse`,ipv6:`IPv6-Adresse`,cidrv4:`IPv4-Bereich`,cidrv6:`IPv6-Bereich`,base64:`Base64-codierter String`,base64url:`Base64-URL-codierter String`,json_string:`JSON-String`,e164:`E.164-Nummer`,jwt:`JWT`,template_literal:`Eingabe`},r={nan:`NaN`,number:`Zahl`,array:`Array`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ungültige Eingabe: erwartet instanceof ${e.expected}, erhalten ${i}`:`Ungültige Eingabe: erwartet ${t}, erhalten ${i}`}case`invalid_value`:return e.values.length===1?`Ungültige Eingabe: erwartet ${S(e.values[0])}`:`Ungültige Option: erwartet eine von ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ${r.unit??`Elemente`} hat`:`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ist`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ${r.unit} hat`:`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ist`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ungültiger String: muss mit "${t.prefix}" beginnen`:t.format===`ends_with`?`Ungültiger String: muss mit "${t.suffix}" enden`:t.format===`includes`?`Ungültiger String: muss "${t.includes}" enthalten`:t.format===`regex`?`Ungültiger String: muss dem Muster ${t.pattern} entsprechen`:`Ungültig: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ungültige Zahl: muss ein Vielfaches von ${e.divisor} sein`;case`unrecognized_keys`:return`${e.keys.length>1?`Unbekannte Schlüssel`:`Unbekannter Schlüssel`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Ungültiger Schlüssel in ${e.origin}`;case`invalid_union`:return`Ungültige Eingabe`;case`invalid_element`:return`Ungültiger Wert in ${e.origin}`;default:return`Ungültige Eingabe`}}};function Ul(){return{localeError:Hl()}}const Wl=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input);return`Invalid input: expected ${t}, received ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`Invalid input: expected ${S(e.values[0])}`:`Invalid option: expected one of ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Gl(){return{localeError:Wl()}}const Kl=()=>{let e={string:{unit:`karaktrojn`,verb:`havi`},file:{unit:`bajtojn`,verb:`havi`},array:{unit:`elementojn`,verb:`havi`},set:{unit:`elementojn`,verb:`havi`}};function t(t){return e[t]??null}let n={regex:`enigo`,email:`retadreso`,url:`URL`,emoji:`emoĝio`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datotempo`,date:`ISO-dato`,time:`ISO-tempo`,duration:`ISO-daŭro`,ipv4:`IPv4-adreso`,ipv6:`IPv6-adreso`,cidrv4:`IPv4-rango`,cidrv6:`IPv6-rango`,base64:`64-ume kodita karaktraro`,base64url:`URL-64-ume kodita karaktraro`,json_string:`JSON-karaktraro`,e164:`E.164-nombro`,jwt:`JWT`,template_literal:`enigo`},r={nan:`NaN`,number:`nombro`,array:`tabelo`,null:`senvalora`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Nevalida enigo: atendiĝis instanceof ${e.expected}, riceviĝis ${i}`:`Nevalida enigo: atendiĝis ${t}, riceviĝis ${i}`}case`invalid_value`:return e.values.length===1?`Nevalida enigo: atendiĝis ${S(e.values[0])}`:`Nevalida opcio: atendiĝis unu el ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()} ${r.unit??`elementojn`}`:`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Tro malgranda: atendiĝis ke ${e.origin} havu ${n}${e.minimum.toString()} ${r.unit}`:`Tro malgranda: atendiĝis ke ${e.origin} estu ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nevalida karaktraro: devas komenciĝi per "${t.prefix}"`:t.format===`ends_with`?`Nevalida karaktraro: devas finiĝi per "${t.suffix}"`:t.format===`includes`?`Nevalida karaktraro: devas inkluzivi "${t.includes}"`:t.format===`regex`?`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`:`Nevalida ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nevalida nombro: devas esti oblo de ${e.divisor}`;case`unrecognized_keys`:return`Nekonata${e.keys.length>1?`j`:``} ŝlosilo${e.keys.length>1?`j`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Nevalida ŝlosilo en ${e.origin}`;case`invalid_union`:return`Nevalida enigo`;case`invalid_element`:return`Nevalida valoro en ${e.origin}`;default:return`Nevalida enigo`}}};function ql(){return{localeError:Kl()}}const Jl=()=>{let e={string:{unit:`caracteres`,verb:`tener`},file:{unit:`bytes`,verb:`tener`},array:{unit:`elementos`,verb:`tener`},set:{unit:`elementos`,verb:`tener`}};function t(t){return e[t]??null}let n={regex:`entrada`,email:`dirección de correo electrónico`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`fecha y hora ISO`,date:`fecha ISO`,time:`hora ISO`,duration:`duración ISO`,ipv4:`dirección IPv4`,ipv6:`dirección IPv6`,cidrv4:`rango IPv4`,cidrv6:`rango IPv6`,base64:`cadena codificada en base64`,base64url:`URL codificada en base64`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`},r={nan:`NaN`,string:`texto`,number:`número`,boolean:`booleano`,array:`arreglo`,object:`objeto`,set:`conjunto`,file:`archivo`,date:`fecha`,bigint:`número grande`,symbol:`símbolo`,undefined:`indefinido`,null:`nulo`,function:`función`,map:`mapa`,record:`registro`,tuple:`tupla`,enum:`enumeración`,union:`unión`,literal:`literal`,promise:`promesa`,void:`vacío`,never:`nunca`,unknown:`desconocido`,any:`cualquiera`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrada inválida: se esperaba instanceof ${e.expected}, recibido ${i}`:`Entrada inválida: se esperaba ${t}, recibido ${i}`}case`invalid_value`:return e.values.length===1?`Entrada inválida: se esperaba ${S(e.values[0])}`:`Opción inválida: se esperaba una de ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Demasiado grande: se esperaba que ${a??`valor`} tuviera ${n}${e.maximum.toString()} ${i.unit??`elementos`}`:`Demasiado grande: se esperaba que ${a??`valor`} fuera ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Demasiado pequeño: se esperaba que ${a} tuviera ${n}${e.minimum.toString()} ${i.unit}`:`Demasiado pequeño: se esperaba que ${a} fuera ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Cadena inválida: debe comenzar con "${t.prefix}"`:t.format===`ends_with`?`Cadena inválida: debe terminar en "${t.suffix}"`:t.format===`includes`?`Cadena inválida: debe incluir "${t.includes}"`:t.format===`regex`?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${n[t.format]??e.format}`}case`not_multiple_of`:return`Número inválido: debe ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Llave${e.keys.length>1?`s`:``} desconocida${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Llave inválida en ${r[e.origin]??e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido en ${r[e.origin]??e.origin}`;default:return`Entrada inválida`}}};function Yl(){return{localeError:Jl()}}const Xl=()=>{let e={string:{unit:`کاراکتر`,verb:`داشته باشد`},file:{unit:`بایت`,verb:`داشته باشد`},array:{unit:`آیتم`,verb:`داشته باشد`},set:{unit:`آیتم`,verb:`داشته باشد`}};function t(t){return e[t]??null}let n={regex:`ورودی`,email:`آدرس ایمیل`,url:`URL`,emoji:`ایموجی`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاریخ و زمان ایزو`,date:`تاریخ ایزو`,time:`زمان ایزو`,duration:`مدت زمان ایزو`,ipv4:`IPv4 آدرس`,ipv6:`IPv6 آدرس`,cidrv4:`IPv4 دامنه`,cidrv6:`IPv6 دامنه`,base64:`base64-encoded رشته`,base64url:`base64url-encoded رشته`,json_string:`JSON رشته`,e164:`E.164 عدد`,jwt:`JWT`,template_literal:`ورودی`},r={nan:`NaN`,number:`عدد`,array:`آرایه`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ورودی نامعتبر: می‌بایست instanceof ${e.expected} می‌بود، ${i} دریافت شد`:`ورودی نامعتبر: می‌بایست ${t} می‌بود، ${i} دریافت شد`}case`invalid_value`:return e.values.length===1?`ورودی نامعتبر: می‌بایست ${S(e.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${C(e.values,`|`)} می‌بود`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصر`} باشد`:`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} باشد`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} باشد`:`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} باشد`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`رشته نامعتبر: باید با "${t.prefix}" شروع شود`:t.format===`ends_with`?`رشته نامعتبر: باید با "${t.suffix}" تمام شود`:t.format===`includes`?`رشته نامعتبر: باید شامل "${t.includes}" باشد`:t.format===`regex`?`رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد`:`${n[t.format]??e.format} نامعتبر`}case`not_multiple_of`:return`عدد نامعتبر: باید مضرب ${e.divisor} باشد`;case`unrecognized_keys`:return`کلید${e.keys.length>1?`های`:``} ناشناس: ${C(e.keys,`, `)}`;case`invalid_key`:return`کلید ناشناس در ${e.origin}`;case`invalid_union`:return`ورودی نامعتبر`;case`invalid_element`:return`مقدار نامعتبر در ${e.origin}`;default:return`ورودی نامعتبر`}}};function Zl(){return{localeError:Xl()}}const Ql=()=>{let e={string:{unit:`merkkiä`,subject:`merkkijonon`},file:{unit:`tavua`,subject:`tiedoston`},array:{unit:`alkiota`,subject:`listan`},set:{unit:`alkiota`,subject:`joukon`},number:{unit:``,subject:`luvun`},bigint:{unit:``,subject:`suuren kokonaisluvun`},int:{unit:``,subject:`kokonaisluvun`},date:{unit:``,subject:`päivämäärän`}};function t(t){return e[t]??null}let n={regex:`säännöllinen lauseke`,email:`sähköpostiosoite`,url:`URL-osoite`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-aikaleima`,date:`ISO-päivämäärä`,time:`ISO-aika`,duration:`ISO-kesto`,ipv4:`IPv4-osoite`,ipv6:`IPv6-osoite`,cidrv4:`IPv4-alue`,cidrv6:`IPv6-alue`,base64:`base64-koodattu merkkijono`,base64url:`base64url-koodattu merkkijono`,json_string:`JSON-merkkijono`,e164:`E.164-luku`,jwt:`JWT`,template_literal:`templaattimerkkijono`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Virheellinen tyyppi: odotettiin instanceof ${e.expected}, oli ${i}`:`Virheellinen tyyppi: odotettiin ${t}, oli ${i}`}case`invalid_value`:return e.values.length===1?`Virheellinen syöte: täytyy olla ${S(e.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Liian suuri: ${r.subject} täytyy olla ${n}${e.maximum.toString()} ${r.unit}`.trim():`Liian suuri: arvon täytyy olla ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Liian pieni: ${r.subject} täytyy olla ${n}${e.minimum.toString()} ${r.unit}`.trim():`Liian pieni: arvon täytyy olla ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Virheellinen syöte: täytyy alkaa "${t.prefix}"`:t.format===`ends_with`?`Virheellinen syöte: täytyy loppua "${t.suffix}"`:t.format===`includes`?`Virheellinen syöte: täytyy sisältää "${t.includes}"`:t.format===`regex`?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}`:`Virheellinen ${n[t.format]??e.format}`}case`not_multiple_of`:return`Virheellinen luku: täytyy olla luvun ${e.divisor} monikerta`;case`unrecognized_keys`:return`${e.keys.length>1?`Tuntemattomat avaimet`:`Tuntematon avain`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Virheellinen avain tietueessa`;case`invalid_union`:return`Virheellinen unioni`;case`invalid_element`:return`Virheellinen arvo joukossa`;default:return`Virheellinen syöte`}}};function $l(){return{localeError:Ql()}}const eu=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n={regex:`entrée`,email:`adresse e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date et heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`},r={nan:`NaN`,number:`nombre`,array:`tableau`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrée invalide : instanceof ${e.expected} attendu, ${i} reçu`:`Entrée invalide : ${t} attendu, ${i} reçu`}case`invalid_value`:return e.values.length===1?`Entrée invalide : ${S(e.values[0])} attendu`:`Option invalide : une valeur parmi ${C(e.values,`|`)} attendue`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Trop grand : ${e.origin??`valeur`} doit ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`élément(s)`}`:`Trop grand : ${e.origin??`valeur`} doit être ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Trop petit : ${e.origin} doit ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : ${e.origin} doit être ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au modèle ${t.pattern}`:`${n[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${C(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function tu(){return{localeError:eu()}}const nu=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n={regex:`entrée`,email:`adresse courriel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date-heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrée invalide : attendu instanceof ${e.expected}, reçu ${i}`:`Entrée invalide : attendu ${t}, reçu ${i}`}case`invalid_value`:return e.values.length===1?`Entrée invalide : attendu ${S(e.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`≤`:`<`,r=t(e.origin);return r?`Trop grand : attendu que ${e.origin??`la valeur`} ait ${n}${e.maximum.toString()} ${r.unit}`:`Trop grand : attendu que ${e.origin??`la valeur`} soit ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`≥`:`>`,r=t(e.origin);return r?`Trop petit : attendu que ${e.origin} ait ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : attendu que ${e.origin} soit ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au motif ${t.pattern}`:`${n[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${C(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function ru(){return{localeError:nu()}}const iu=()=>{let e={string:{label:`מחרוזת`,gender:`f`},number:{label:`מספר`,gender:`m`},boolean:{label:`ערך בוליאני`,gender:`m`},bigint:{label:`BigInt`,gender:`m`},date:{label:`תאריך`,gender:`m`},array:{label:`מערך`,gender:`m`},object:{label:`אובייקט`,gender:`m`},null:{label:`ערך ריק (null)`,gender:`m`},undefined:{label:`ערך לא מוגדר (undefined)`,gender:`m`},symbol:{label:`סימבול (Symbol)`,gender:`m`},function:{label:`פונקציה`,gender:`f`},map:{label:`מפה (Map)`,gender:`f`},set:{label:`קבוצה (Set)`,gender:`f`},file:{label:`קובץ`,gender:`m`},promise:{label:`Promise`,gender:`m`},NaN:{label:`NaN`,gender:`m`},unknown:{label:`ערך לא ידוע`,gender:`m`},value:{label:`ערך`,gender:`m`}},t={string:{unit:`תווים`,shortLabel:`קצר`,longLabel:`ארוך`},file:{unit:`בייטים`,shortLabel:`קטן`,longLabel:`גדול`},array:{unit:`פריטים`,shortLabel:`קטן`,longLabel:`גדול`},set:{unit:`פריטים`,shortLabel:`קטן`,longLabel:`גדול`},number:{unit:``,shortLabel:`קטן`,longLabel:`גדול`}},n=t=>t?e[t]:void 0,r=t=>{let r=n(t);return r?r.label:t??e.unknown.label},i=e=>`ה${r(e)}`,a=e=>(n(e)?.gender??`m`)===`f`?`צריכה להיות`:`צריך להיות`,o=e=>e?t[e]??null:null,s={regex:{label:`קלט`,gender:`m`},email:{label:`כתובת אימייל`,gender:`f`},url:{label:`כתובת רשת`,gender:`f`},emoji:{label:`אימוג'י`,gender:`m`},uuid:{label:`UUID`,gender:`m`},nanoid:{label:`nanoid`,gender:`m`},guid:{label:`GUID`,gender:`m`},cuid:{label:`cuid`,gender:`m`},cuid2:{label:`cuid2`,gender:`m`},ulid:{label:`ULID`,gender:`m`},xid:{label:`XID`,gender:`m`},ksuid:{label:`KSUID`,gender:`m`},datetime:{label:`תאריך וזמן ISO`,gender:`m`},date:{label:`תאריך ISO`,gender:`m`},time:{label:`זמן ISO`,gender:`m`},duration:{label:`משך זמן ISO`,gender:`m`},ipv4:{label:`כתובת IPv4`,gender:`f`},ipv6:{label:`כתובת IPv6`,gender:`f`},cidrv4:{label:`טווח IPv4`,gender:`m`},cidrv6:{label:`טווח IPv6`,gender:`m`},base64:{label:`מחרוזת בבסיס 64`,gender:`f`},base64url:{label:`מחרוזת בבסיס 64 לכתובות רשת`,gender:`f`},json_string:{label:`מחרוזת JSON`,gender:`f`},e164:{label:`מספר E.164`,gender:`m`},jwt:{label:`JWT`,gender:`m`},ends_with:{label:`קלט`,gender:`m`},includes:{label:`קלט`,gender:`m`},lowercase:{label:`קלט`,gender:`m`},starts_with:{label:`קלט`,gender:`m`},uppercase:{label:`קלט`,gender:`m`}},c={nan:`NaN`};return t=>{switch(t.code){case`invalid_type`:{let n=t.expected,i=c[n??``]??r(n),a=x(t.input),o=c[a]??e[a]?.label??a;return/^[A-Z]/.test(t.expected)?`קלט לא תקין: צריך להיות instanceof ${t.expected}, התקבל ${o}`:`קלט לא תקין: צריך להיות ${i}, התקבל ${o}`}case`invalid_value`:{if(t.values.length===1)return`ערך לא תקין: הערך חייב להיות ${S(t.values[0])}`;let e=t.values.map(e=>S(e));if(t.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${e[0]} או ${e[1]}`;let n=e[e.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${e.slice(0,-1).join(`, `)} או ${n}`}case`too_big`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.longLabel??`ארוך`} מדי: ${n} צריכה להכיל ${t.maximum.toString()} ${e?.unit??``} ${t.inclusive?`או פחות`:`לכל היותר`}`.trim();if(t.origin===`number`)return`גדול מדי: ${n} צריך להיות ${t.inclusive?`קטן או שווה ל-${t.maximum}`:`קטן מ-${t.maximum}`}`;if(t.origin===`array`||t.origin===`set`)return`גדול מדי: ${n} ${t.origin===`set`?`צריכה`:`צריך`} להכיל ${t.inclusive?`${t.maximum} ${e?.unit??``} או פחות`:`פחות מ-${t.maximum} ${e?.unit??``}`}`.trim();let r=t.inclusive?`<=`:`<`,s=a(t.origin??`value`);return e?.unit?`${e.longLabel} מדי: ${n} ${s} ${r}${t.maximum.toString()} ${e.unit}`:`${e?.longLabel??`גדול`} מדי: ${n} ${s} ${r}${t.maximum.toString()}`}case`too_small`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.shortLabel??`קצר`} מדי: ${n} צריכה להכיל ${t.minimum.toString()} ${e?.unit??``} ${t.inclusive?`או יותר`:`לפחות`}`.trim();if(t.origin===`number`)return`קטן מדי: ${n} צריך להיות ${t.inclusive?`גדול או שווה ל-${t.minimum}`:`גדול מ-${t.minimum}`}`;if(t.origin===`array`||t.origin===`set`){let r=t.origin===`set`?`צריכה`:`צריך`;return t.minimum===1&&t.inclusive?`קטן מדי: ${n} ${r} להכיל ${t.origin,`לפחות פריט אחד`}`:`קטן מדי: ${n} ${r} להכיל ${t.inclusive?`${t.minimum} ${e?.unit??``} או יותר`:`יותר מ-${t.minimum} ${e?.unit??``}`}`.trim()}let r=t.inclusive?`>=`:`>`,s=a(t.origin??`value`);return e?.unit?`${e.shortLabel} מדי: ${n} ${s} ${r}${t.minimum.toString()} ${e.unit}`:`${e?.shortLabel??`קטן`} מדי: ${n} ${s} ${r}${t.minimum.toString()}`}case`invalid_format`:{let e=t;if(e.format===`starts_with`)return`המחרוזת חייבת להתחיל ב "${e.prefix}"`;if(e.format===`ends_with`)return`המחרוזת חייבת להסתיים ב "${e.suffix}"`;if(e.format===`includes`)return`המחרוזת חייבת לכלול "${e.includes}"`;if(e.format===`regex`)return`המחרוזת חייבת להתאים לתבנית ${e.pattern}`;let n=s[e.format];return`${n?.label??e.format} לא ${(n?.gender??`m`)===`f`?`תקינה`:`תקין`}`}case`not_multiple_of`:return`מספר לא תקין: חייב להיות מכפלה של ${t.divisor}`;case`unrecognized_keys`:return`מפתח${t.keys.length>1?`ות`:``} לא מזוה${t.keys.length>1?`ים`:`ה`}: ${C(t.keys,`, `)}`;case`invalid_key`:return`שדה לא תקין באובייקט`;case`invalid_union`:return`קלט לא תקין`;case`invalid_element`:return`ערך לא תקין ב${i(t.origin??`array`)}`;default:return`קלט לא תקין`}}};function au(){return{localeError:iu()}}const ou=()=>{let e={string:{unit:`karakter`,verb:`legyen`},file:{unit:`byte`,verb:`legyen`},array:{unit:`elem`,verb:`legyen`},set:{unit:`elem`,verb:`legyen`}};function t(t){return e[t]??null}let n={regex:`bemenet`,email:`email cím`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO időbélyeg`,date:`ISO dátum`,time:`ISO idő`,duration:`ISO időintervallum`,ipv4:`IPv4 cím`,ipv6:`IPv6 cím`,cidrv4:`IPv4 tartomány`,cidrv6:`IPv6 tartomány`,base64:`base64-kódolt string`,base64url:`base64url-kódolt string`,json_string:`JSON string`,e164:`E.164 szám`,jwt:`JWT`,template_literal:`bemenet`},r={nan:`NaN`,number:`szám`,array:`tömb`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Érvénytelen bemenet: a várt érték instanceof ${e.expected}, a kapott érték ${i}`:`Érvénytelen bemenet: a várt érték ${t}, a kapott érték ${i}`}case`invalid_value`:return e.values.length===1?`Érvénytelen bemenet: a várt érték ${S(e.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Túl nagy: ${e.origin??`érték`} mérete túl nagy ${n}${e.maximum.toString()} ${r.unit??`elem`}`:`Túl nagy: a bemeneti érték ${e.origin??`érték`} túl nagy: ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Túl kicsi: a bemeneti érték ${e.origin} mérete túl kicsi ${n}${e.minimum.toString()} ${r.unit}`:`Túl kicsi: a bemeneti érték ${e.origin} túl kicsi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Érvénytelen string: "${t.prefix}" értékkel kell kezdődnie`:t.format===`ends_with`?`Érvénytelen string: "${t.suffix}" értékkel kell végződnie`:t.format===`includes`?`Érvénytelen string: "${t.includes}" értéket kell tartalmaznia`:t.format===`regex`?`Érvénytelen string: ${t.pattern} mintának kell megfelelnie`:`Érvénytelen ${n[t.format]??e.format}`}case`not_multiple_of`:return`Érvénytelen szám: ${e.divisor} többszörösének kell lennie`;case`unrecognized_keys`:return`Ismeretlen kulcs${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Érvénytelen kulcs ${e.origin}`;case`invalid_union`:return`Érvénytelen bemenet`;case`invalid_element`:return`Érvénytelen érték: ${e.origin}`;default:return`Érvénytelen bemenet`}}};function su(){return{localeError:ou()}}function cu(e,t,n){return Math.abs(e)===1?t:n}function lu(e){if(!e)return``;let t=[`ա`,`ե`,`ը`,`ի`,`ո`,`ու`,`օ`],n=e[e.length-1];return e+(t.includes(n)?`ն`:`ը`)}const uu=()=>{let e={string:{unit:{one:`նշան`,many:`նշաններ`},verb:`ունենալ`},file:{unit:{one:`բայթ`,many:`բայթեր`},verb:`ունենալ`},array:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`},set:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`}};function t(t){return e[t]??null}let n={regex:`մուտք`,email:`էլ. հասցե`,url:`URL`,emoji:`էմոջի`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO ամսաթիվ և ժամ`,date:`ISO ամսաթիվ`,time:`ISO ժամ`,duration:`ISO տևողություն`,ipv4:`IPv4 հասցե`,ipv6:`IPv6 հասցե`,cidrv4:`IPv4 միջակայք`,cidrv6:`IPv6 միջակայք`,base64:`base64 ձևաչափով տող`,base64url:`base64url ձևաչափով տող`,json_string:`JSON տող`,e164:`E.164 համար`,jwt:`JWT`,template_literal:`մուտք`},r={nan:`NaN`,number:`թիվ`,array:`զանգված`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${e.expected}, ստացվել է ${i}`:`Սխալ մուտքագրում․ սպասվում էր ${t}, ստացվել է ${i}`}case`invalid_value`:return e.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${S(e.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=cu(Number(e.maximum),r.unit.one,r.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${lu(e.origin??`արժեք`)} կունենա ${n}${e.maximum.toString()} ${t}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${lu(e.origin??`արժեք`)} լինի ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=cu(Number(e.minimum),r.unit.one,r.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${lu(e.origin)} կունենա ${n}${e.minimum.toString()} ${t}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${lu(e.origin)} լինի ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Սխալ տող․ պետք է սկսվի "${t.prefix}"-ով`:t.format===`ends_with`?`Սխալ տող․ պետք է ավարտվի "${t.suffix}"-ով`:t.format===`includes`?`Սխալ տող․ պետք է պարունակի "${t.includes}"`:t.format===`regex`?`Սխալ տող․ պետք է համապատասխանի ${t.pattern} ձևաչափին`:`Սխալ ${n[t.format]??e.format}`}case`not_multiple_of`:return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${e.divisor}-ի`;case`unrecognized_keys`:return`Չճանաչված բանալի${e.keys.length>1?`ներ`:``}. ${C(e.keys,`, `)}`;case`invalid_key`:return`Սխալ բանալի ${lu(e.origin)}-ում`;case`invalid_union`:return`Սխալ մուտքագրում`;case`invalid_element`:return`Սխալ արժեք ${lu(e.origin)}-ում`;default:return`Սխալ մուտքագրում`}}};function du(){return{localeError:uu()}}const fu=()=>{let e={string:{unit:`karakter`,verb:`memiliki`},file:{unit:`byte`,verb:`memiliki`},array:{unit:`item`,verb:`memiliki`},set:{unit:`item`,verb:`memiliki`}};function t(t){return e[t]??null}let n={regex:`input`,email:`alamat email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tanggal dan waktu format ISO`,date:`tanggal format ISO`,time:`jam format ISO`,duration:`durasi format ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,cidrv4:`rentang alamat IPv4`,cidrv6:`rentang alamat IPv6`,base64:`string dengan enkode base64`,base64url:`string dengan enkode base64url`,json_string:`string JSON`,e164:`angka E.164`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input tidak valid: diharapkan instanceof ${e.expected}, diterima ${i}`:`Input tidak valid: diharapkan ${t}, diterima ${i}`}case`invalid_value`:return e.values.length===1?`Input tidak valid: diharapkan ${S(e.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: diharapkan ${e.origin??`value`} memiliki ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: diharapkan ${e.origin??`value`} menjadi ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: diharapkan ${e.origin} memiliki ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: diharapkan ${e.origin} menjadi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak valid: harus dimulai dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak valid: harus berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak valid: harus menyertakan "${t.includes}"`:t.format===`regex`?`String tidak valid: harus sesuai pola ${t.pattern}`:`${n[t.format]??e.format} tidak valid`}case`not_multiple_of`:return`Angka tidak valid: harus kelipatan dari ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali ${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak valid di ${e.origin}`;case`invalid_union`:return`Input tidak valid`;case`invalid_element`:return`Nilai tidak valid di ${e.origin}`;default:return`Input tidak valid`}}};function pu(){return{localeError:fu()}}const mu=()=>{let e={string:{unit:`stafi`,verb:`að hafa`},file:{unit:`bæti`,verb:`að hafa`},array:{unit:`hluti`,verb:`að hafa`},set:{unit:`hluti`,verb:`að hafa`}};function t(t){return e[t]??null}let n={regex:`gildi`,email:`netfang`,url:`vefslóð`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dagsetning og tími`,date:`ISO dagsetning`,time:`ISO tími`,duration:`ISO tímalengd`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded strengur`,base64url:`base64url-encoded strengur`,json_string:`JSON strengur`,e164:`E.164 tölugildi`,jwt:`JWT`,template_literal:`gildi`},r={nan:`NaN`,number:`númer`,array:`fylki`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Rangt gildi: Þú slóst inn ${i} þar sem á að vera instanceof ${e.expected}`:`Rangt gildi: Þú slóst inn ${i} þar sem á að vera ${t}`}case`invalid_value`:return e.values.length===1?`Rangt gildi: gert ráð fyrir ${S(e.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} hafi ${n}${e.maximum.toString()} ${r.unit??`hluti`}`:`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} sé ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Of lítið: gert er ráð fyrir að ${e.origin} hafi ${n}${e.minimum.toString()} ${r.unit}`:`Of lítið: gert er ráð fyrir að ${e.origin} sé ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ógildur strengur: verður að byrja á "${t.prefix}"`:t.format===`ends_with`?`Ógildur strengur: verður að enda á "${t.suffix}"`:t.format===`includes`?`Ógildur strengur: verður að innihalda "${t.includes}"`:t.format===`regex`?`Ógildur strengur: verður að fylgja mynstri ${t.pattern}`:`Rangt ${n[t.format]??e.format}`}case`not_multiple_of`:return`Röng tala: verður að vera margfeldi af ${e.divisor}`;case`unrecognized_keys`:return`Óþekkt ${e.keys.length>1?`ir lyklar`:`ur lykill`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Rangur lykill í ${e.origin}`;case`invalid_union`:return`Rangt gildi`;case`invalid_element`:return`Rangt gildi í ${e.origin}`;default:return`Rangt gildi`}}};function hu(){return{localeError:mu()}}const gu=()=>{let e={string:{unit:`caratteri`,verb:`avere`},file:{unit:`byte`,verb:`avere`},array:{unit:`elementi`,verb:`avere`},set:{unit:`elementi`,verb:`avere`}};function t(t){return e[t]??null}let n={regex:`input`,email:`indirizzo email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e ora ISO`,date:`data ISO`,time:`ora ISO`,duration:`durata ISO`,ipv4:`indirizzo IPv4`,ipv6:`indirizzo IPv6`,cidrv4:`intervallo IPv4`,cidrv6:`intervallo IPv6`,base64:`stringa codificata in base64`,base64url:`URL codificata in base64`,json_string:`stringa JSON`,e164:`numero E.164`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`numero`,array:`vettore`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input non valido: atteso instanceof ${e.expected}, ricevuto ${i}`:`Input non valido: atteso ${t}, ricevuto ${i}`}case`invalid_value`:return e.values.length===1?`Input non valido: atteso ${S(e.values[0])}`:`Opzione non valida: atteso uno tra ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Troppo grande: ${e.origin??`valore`} deve avere ${n}${e.maximum.toString()} ${r.unit??`elementi`}`:`Troppo grande: ${e.origin??`valore`} deve essere ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Troppo piccolo: ${e.origin} deve avere ${n}${e.minimum.toString()} ${r.unit}`:`Troppo piccolo: ${e.origin} deve essere ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Stringa non valida: deve iniziare con "${t.prefix}"`:t.format===`ends_with`?`Stringa non valida: deve terminare con "${t.suffix}"`:t.format===`includes`?`Stringa non valida: deve includere "${t.includes}"`:t.format===`regex`?`Stringa non valida: deve corrispondere al pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Numero non valido: deve essere un multiplo di ${e.divisor}`;case`unrecognized_keys`:return`Chiav${e.keys.length>1?`i`:`e`} non riconosciut${e.keys.length>1?`e`:`a`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Chiave non valida in ${e.origin}`;case`invalid_union`:return`Input non valido`;case`invalid_element`:return`Valore non valido in ${e.origin}`;default:return`Input non valido`}}};function _u(){return{localeError:gu()}}const vu=()=>{let e={string:{unit:`文字`,verb:`である`},file:{unit:`バイト`,verb:`である`},array:{unit:`要素`,verb:`である`},set:{unit:`要素`,verb:`である`}};function t(t){return e[t]??null}let n={regex:`入力値`,email:`メールアドレス`,url:`URL`,emoji:`絵文字`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日時`,date:`ISO日付`,time:`ISO時刻`,duration:`ISO期間`,ipv4:`IPv4アドレス`,ipv6:`IPv6アドレス`,cidrv4:`IPv4範囲`,cidrv6:`IPv6範囲`,base64:`base64エンコード文字列`,base64url:`base64urlエンコード文字列`,json_string:`JSON文字列`,e164:`E.164番号`,jwt:`JWT`,template_literal:`入力値`},r={nan:`NaN`,number:`数値`,array:`配列`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`無効な入力: instanceof ${e.expected}が期待されましたが、${i}が入力されました`:`無効な入力: ${t}が期待されましたが、${i}が入力されました`}case`invalid_value`:return e.values.length===1?`無効な入力: ${S(e.values[0])}が期待されました`:`無効な選択: ${C(e.values,`、`)}のいずれかである必要があります`;case`too_big`:{let n=e.inclusive?`以下である`:`より小さい`,r=t(e.origin);return r?`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${r.unit??`要素`}${n}必要があります`:`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${n}必要があります`}case`too_small`:{let n=e.inclusive?`以上である`:`より大きい`,r=t(e.origin);return r?`小さすぎる値: ${e.origin}は${e.minimum.toString()}${r.unit}${n}必要があります`:`小さすぎる値: ${e.origin}は${e.minimum.toString()}${n}必要があります`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無効な文字列: "${t.prefix}"で始まる必要があります`:t.format===`ends_with`?`無効な文字列: "${t.suffix}"で終わる必要があります`:t.format===`includes`?`無効な文字列: "${t.includes}"を含む必要があります`:t.format===`regex`?`無効な文字列: パターン${t.pattern}に一致する必要があります`:`無効な${n[t.format]??e.format}`}case`not_multiple_of`:return`無効な数値: ${e.divisor}の倍数である必要があります`;case`unrecognized_keys`:return`認識されていないキー${e.keys.length>1?`群`:``}: ${C(e.keys,`、`)}`;case`invalid_key`:return`${e.origin}内の無効なキー`;case`invalid_union`:return`無効な入力`;case`invalid_element`:return`${e.origin}内の無効な値`;default:return`無効な入力`}}};function yu(){return{localeError:vu()}}const bu=()=>{let e={string:{unit:`სიმბოლო`,verb:`უნდა შეიცავდეს`},file:{unit:`ბაიტი`,verb:`უნდა შეიცავდეს`},array:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`},set:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`}};function t(t){return e[t]??null}let n={regex:`შეყვანა`,email:`ელ-ფოსტის მისამართი`,url:`URL`,emoji:`ემოჯი`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`თარიღი-დრო`,date:`თარიღი`,time:`დრო`,duration:`ხანგრძლივობა`,ipv4:`IPv4 მისამართი`,ipv6:`IPv6 მისამართი`,cidrv4:`IPv4 დიაპაზონი`,cidrv6:`IPv6 დიაპაზონი`,base64:`base64-კოდირებული სტრინგი`,base64url:`base64url-კოდირებული სტრინგი`,json_string:`JSON სტრინგი`,e164:`E.164 ნომერი`,jwt:`JWT`,template_literal:`შეყვანა`},r={nan:`NaN`,number:`რიცხვი`,string:`სტრინგი`,boolean:`ბულეანი`,function:`ფუნქცია`,array:`მასივი`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${e.expected}, მიღებული ${i}`:`არასწორი შეყვანა: მოსალოდნელი ${t}, მიღებული ${i}`}case`invalid_value`:return e.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${S(e.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${C(e.values,`|`)}-დან`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} იყოს ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ზედმეტად პატარა: მოსალოდნელი ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${e.origin} იყოს ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`არასწორი სტრინგი: უნდა იწყებოდეს "${t.prefix}"-ით`:t.format===`ends_with`?`არასწორი სტრინგი: უნდა მთავრდებოდეს "${t.suffix}"-ით`:t.format===`includes`?`არასწორი სტრინგი: უნდა შეიცავდეს "${t.includes}"-ს`:t.format===`regex`?`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${t.pattern}`:`არასწორი ${n[t.format]??e.format}`}case`not_multiple_of`:return`არასწორი რიცხვი: უნდა იყოს ${e.divisor}-ის ჯერადი`;case`unrecognized_keys`:return`უცნობი გასაღებ${e.keys.length>1?`ები`:`ი`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`არასწორი გასაღები ${e.origin}-ში`;case`invalid_union`:return`არასწორი შეყვანა`;case`invalid_element`:return`არასწორი მნიშვნელობა ${e.origin}-ში`;default:return`არასწორი შეყვანა`}}};function xu(){return{localeError:bu()}}const Su=()=>{let e={string:{unit:`តួអក្សរ`,verb:`គួរមាន`},file:{unit:`បៃ`,verb:`គួរមាន`},array:{unit:`ធាតុ`,verb:`គួរមាន`},set:{unit:`ធាតុ`,verb:`គួរមាន`}};function t(t){return e[t]??null}let n={regex:`ទិន្នន័យបញ្ចូល`,email:`អាសយដ្ឋានអ៊ីមែល`,url:`URL`,emoji:`សញ្ញាអារម្មណ៍`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`កាលបរិច្ឆេទ និងម៉ោង ISO`,date:`កាលបរិច្ឆេទ ISO`,time:`ម៉ោង ISO`,duration:`រយៈពេល ISO`,ipv4:`អាសយដ្ឋាន IPv4`,ipv6:`អាសយដ្ឋាន IPv6`,cidrv4:`ដែនអាសយដ្ឋាន IPv4`,cidrv6:`ដែនអាសយដ្ឋាន IPv6`,base64:`ខ្សែអក្សរអ៊ិកូដ base64`,base64url:`ខ្សែអក្សរអ៊ិកូដ base64url`,json_string:`ខ្សែអក្សរ JSON`,e164:`លេខ E.164`,jwt:`JWT`,template_literal:`ទិន្នន័យបញ្ចូល`},r={nan:`NaN`,number:`លេខ`,array:`អារេ (Array)`,null:`គ្មានតម្លៃ (null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${e.expected} ប៉ុន្តែទទួលបាន ${i}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${t} ប៉ុន្តែទទួលបាន ${i}`}case`invalid_value`:return e.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${S(e.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()} ${r.unit??`ធាតុ`}`:`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}`:`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${t.prefix}"`:t.format===`ends_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${t.suffix}"`:t.format===`includes`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${t.includes}"`:t.format===`regex`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}`:`មិនត្រឹមត្រូវ៖ ${n[t.format]??e.format}`}case`not_multiple_of`:return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`;case`unrecognized_keys`:return`រកឃើញសោមិនស្គាល់៖ ${C(e.keys,`, `)}`;case`invalid_key`:return`សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;case`invalid_union`:return`ទិន្នន័យមិនត្រឹមត្រូវ`;case`invalid_element`:return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;default:return`ទិន្នន័យមិនត្រឹមត្រូវ`}}};function Cu(){return{localeError:Su()}}function wu(){return Cu()}const Tu=()=>{let e={string:{unit:`문자`,verb:`to have`},file:{unit:`바이트`,verb:`to have`},array:{unit:`개`,verb:`to have`},set:{unit:`개`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`입력`,email:`이메일 주소`,url:`URL`,emoji:`이모지`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 날짜시간`,date:`ISO 날짜`,time:`ISO 시간`,duration:`ISO 기간`,ipv4:`IPv4 주소`,ipv6:`IPv6 주소`,cidrv4:`IPv4 범위`,cidrv6:`IPv6 범위`,base64:`base64 인코딩 문자열`,base64url:`base64url 인코딩 문자열`,json_string:`JSON 문자열`,e164:`E.164 번호`,jwt:`JWT`,template_literal:`입력`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`잘못된 입력: 예상 타입은 instanceof ${e.expected}, 받은 타입은 ${i}입니다`:`잘못된 입력: 예상 타입은 ${t}, 받은 타입은 ${i}입니다`}case`invalid_value`:return e.values.length===1?`잘못된 입력: 값은 ${S(e.values[0])} 이어야 합니다`:`잘못된 옵션: ${C(e.values,`또는 `)} 중 하나여야 합니다`;case`too_big`:{let n=e.inclusive?`이하`:`미만`,r=n===`미만`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()} ${n}${r}`}case`too_small`:{let n=e.inclusive?`이상`:`초과`,r=n===`이상`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()} ${n}${r}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`잘못된 문자열: "${t.prefix}"(으)로 시작해야 합니다`:t.format===`ends_with`?`잘못된 문자열: "${t.suffix}"(으)로 끝나야 합니다`:t.format===`includes`?`잘못된 문자열: "${t.includes}"을(를) 포함해야 합니다`:t.format===`regex`?`잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다`:`잘못된 ${n[t.format]??e.format}`}case`not_multiple_of`:return`잘못된 숫자: ${e.divisor}의 배수여야 합니다`;case`unrecognized_keys`:return`인식할 수 없는 키: ${C(e.keys,`, `)}`;case`invalid_key`:return`잘못된 키: ${e.origin}`;case`invalid_union`:return`잘못된 입력`;case`invalid_element`:return`잘못된 값: ${e.origin}`;default:return`잘못된 입력`}}};function Eu(){return{localeError:Tu()}}const Du=e=>e.charAt(0).toUpperCase()+e.slice(1);function Ou(e){let t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||n===0?`many`:n===1?`one`:`few`}const ku=()=>{let e={string:{unit:{one:`simbolis`,few:`simboliai`,many:`simbolių`},verb:{smaller:{inclusive:`turi būti ne ilgesnė kaip`,notInclusive:`turi būti trumpesnė kaip`},bigger:{inclusive:`turi būti ne trumpesnė kaip`,notInclusive:`turi būti ilgesnė kaip`}}},file:{unit:{one:`baitas`,few:`baitai`,many:`baitų`},verb:{smaller:{inclusive:`turi būti ne didesnis kaip`,notInclusive:`turi būti mažesnis kaip`},bigger:{inclusive:`turi būti ne mažesnis kaip`,notInclusive:`turi būti didesnis kaip`}}},array:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}},set:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}}};function t(t,n,r,i){let a=e[t]??null;return a===null?a:{unit:a.unit[n],verb:a.verb[i][r?`inclusive`:`notInclusive`]}}let n={regex:`įvestis`,email:`el. pašto adresas`,url:`URL`,emoji:`jaustukas`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO data ir laikas`,date:`ISO data`,time:`ISO laikas`,duration:`ISO trukmė`,ipv4:`IPv4 adresas`,ipv6:`IPv6 adresas`,cidrv4:`IPv4 tinklo prefiksas (CIDR)`,cidrv6:`IPv6 tinklo prefiksas (CIDR)`,base64:`base64 užkoduota eilutė`,base64url:`base64url užkoduota eilutė`,json_string:`JSON eilutė`,e164:`E.164 numeris`,jwt:`JWT`,template_literal:`įvestis`},r={nan:`NaN`,number:`skaičius`,bigint:`sveikasis skaičius`,string:`eilutė`,boolean:`loginė reikšmė`,undefined:`neapibrėžta reikšmė`,function:`funkcija`,symbol:`simbolis`,array:`masyvas`,object:`objektas`,null:`nulinė reikšmė`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Gautas tipas ${i}, o tikėtasi - instanceof ${e.expected}`:`Gautas tipas ${i}, o tikėtasi - ${t}`}case`invalid_value`:return e.values.length===1?`Privalo būti ${S(e.values[0])}`:`Privalo būti vienas iš ${C(e.values,`|`)} pasirinkimų`;case`too_big`:{let n=r[e.origin]??e.origin,i=t(e.origin,Ou(Number(e.maximum)),e.inclusive??!1,`smaller`);if(i?.verb)return`${Du(n??e.origin??`reikšmė`)} ${i.verb} ${e.maximum.toString()} ${i.unit??`elementų`}`;let a=e.inclusive?`ne didesnis kaip`:`mažesnis kaip`;return`${Du(n??e.origin??`reikšmė`)} turi būti ${a} ${e.maximum.toString()} ${i?.unit}`}case`too_small`:{let n=r[e.origin]??e.origin,i=t(e.origin,Ou(Number(e.minimum)),e.inclusive??!1,`bigger`);if(i?.verb)return`${Du(n??e.origin??`reikšmė`)} ${i.verb} ${e.minimum.toString()} ${i.unit??`elementų`}`;let a=e.inclusive?`ne mažesnis kaip`:`didesnis kaip`;return`${Du(n??e.origin??`reikšmė`)} turi būti ${a} ${e.minimum.toString()} ${i?.unit}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Eilutė privalo prasidėti "${t.prefix}"`:t.format===`ends_with`?`Eilutė privalo pasibaigti "${t.suffix}"`:t.format===`includes`?`Eilutė privalo įtraukti "${t.includes}"`:t.format===`regex`?`Eilutė privalo atitikti ${t.pattern}`:`Neteisingas ${n[t.format]??e.format}`}case`not_multiple_of`:return`Skaičius privalo būti ${e.divisor} kartotinis.`;case`unrecognized_keys`:return`Neatpažint${e.keys.length>1?`i`:`as`} rakt${e.keys.length>1?`ai`:`as`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Rastas klaidingas raktas`;case`invalid_union`:return`Klaidinga įvestis`;case`invalid_element`:{let t=r[e.origin]??e.origin;return`${Du(t??e.origin??`reikšmė`)} turi klaidingą įvestį`}default:return`Klaidinga įvestis`}}};function Au(){return{localeError:ku()}}const ju=()=>{let e={string:{unit:`знаци`,verb:`да имаат`},file:{unit:`бајти`,verb:`да имаат`},array:{unit:`ставки`,verb:`да имаат`},set:{unit:`ставки`,verb:`да имаат`}};function t(t){return e[t]??null}let n={regex:`внес`,email:`адреса на е-пошта`,url:`URL`,emoji:`емоџи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO датум и време`,date:`ISO датум`,time:`ISO време`,duration:`ISO времетраење`,ipv4:`IPv4 адреса`,ipv6:`IPv6 адреса`,cidrv4:`IPv4 опсег`,cidrv6:`IPv6 опсег`,base64:`base64-енкодирана низа`,base64url:`base64url-енкодирана низа`,json_string:`JSON низа`,e164:`E.164 број`,jwt:`JWT`,template_literal:`внес`},r={nan:`NaN`,number:`број`,array:`низа`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Грешен внес: се очекува instanceof ${e.expected}, примено ${i}`:`Грешен внес: се очекува ${t}, примено ${i}`}case`invalid_value`:return e.values.length===1?`Invalid input: expected ${S(e.values[0])}`:`Грешана опција: се очекува една ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Премногу голем: се очекува ${e.origin??`вредноста`} да има ${n}${e.maximum.toString()} ${r.unit??`елементи`}`:`Премногу голем: се очекува ${e.origin??`вредноста`} да биде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Премногу мал: се очекува ${e.origin} да има ${n}${e.minimum.toString()} ${r.unit}`:`Премногу мал: се очекува ${e.origin} да биде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неважечка низа: мора да започнува со "${t.prefix}"`:t.format===`ends_with`?`Неважечка низа: мора да завршува со "${t.suffix}"`:t.format===`includes`?`Неважечка низа: мора да вклучува "${t.includes}"`:t.format===`regex`?`Неважечка низа: мора да одгоара на патернот ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Грешен број: мора да биде делив со ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Непрепознаени клучеви`:`Непрепознаен клуч`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Грешен клуч во ${e.origin}`;case`invalid_union`:return`Грешен внес`;case`invalid_element`:return`Грешна вредност во ${e.origin}`;default:return`Грешен внес`}}};function Mu(){return{localeError:ju()}}const Nu=()=>{let e={string:{unit:`aksara`,verb:`mempunyai`},file:{unit:`bait`,verb:`mempunyai`},array:{unit:`elemen`,verb:`mempunyai`},set:{unit:`elemen`,verb:`mempunyai`}};function t(t){return e[t]??null}let n={regex:`input`,email:`alamat e-mel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tarikh masa ISO`,date:`tarikh ISO`,time:`masa ISO`,duration:`tempoh ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,cidrv4:`julat IPv4`,cidrv6:`julat IPv6`,base64:`string dikodkan base64`,base64url:`string dikodkan base64url`,json_string:`string JSON`,e164:`nombor E.164`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`nombor`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input tidak sah: dijangka instanceof ${e.expected}, diterima ${i}`:`Input tidak sah: dijangka ${t}, diterima ${i}`}case`invalid_value`:return e.values.length===1?`Input tidak sah: dijangka ${S(e.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: dijangka ${e.origin??`nilai`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: dijangka ${e.origin??`nilai`} adalah ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: dijangka ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: dijangka ${e.origin} adalah ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak sah: mesti bermula dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak sah: mesti berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak sah: mesti mengandungi "${t.includes}"`:t.format===`regex`?`String tidak sah: mesti sepadan dengan corak ${t.pattern}`:`${n[t.format]??e.format} tidak sah`}case`not_multiple_of`:return`Nombor tidak sah: perlu gandaan ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali: ${C(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak sah dalam ${e.origin}`;case`invalid_union`:return`Input tidak sah`;case`invalid_element`:return`Nilai tidak sah dalam ${e.origin}`;default:return`Input tidak sah`}}};function Pu(){return{localeError:Nu()}}const Fu=()=>{let e={string:{unit:`tekens`,verb:`heeft`},file:{unit:`bytes`,verb:`heeft`},array:{unit:`elementen`,verb:`heeft`},set:{unit:`elementen`,verb:`heeft`}};function t(t){return e[t]??null}let n={regex:`invoer`,email:`emailadres`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum en tijd`,date:`ISO datum`,time:`ISO tijd`,duration:`ISO duur`,ipv4:`IPv4-adres`,ipv6:`IPv6-adres`,cidrv4:`IPv4-bereik`,cidrv6:`IPv6-bereik`,base64:`base64-gecodeerde tekst`,base64url:`base64 URL-gecodeerde tekst`,json_string:`JSON string`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`invoer`},r={nan:`NaN`,number:`getal`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ongeldige invoer: verwacht instanceof ${e.expected}, ontving ${i}`:`Ongeldige invoer: verwacht ${t}, ontving ${i}`}case`invalid_value`:return e.values.length===1?`Ongeldige invoer: verwacht ${S(e.values[0])}`:`Ongeldige optie: verwacht één van ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin),i=e.origin===`date`?`laat`:e.origin===`string`?`lang`:`groot`;return r?`Te ${i}: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} ${r.unit??`elementen`} ${r.verb}`:`Te ${i}: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} is`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin),i=e.origin===`date`?`vroeg`:e.origin===`string`?`kort`:`klein`;return r?`Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} is`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ongeldige tekst: moet met "${t.prefix}" beginnen`:t.format===`ends_with`?`Ongeldige tekst: moet op "${t.suffix}" eindigen`:t.format===`includes`?`Ongeldige tekst: moet "${t.includes}" bevatten`:t.format===`regex`?`Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}`:`Ongeldig: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`;case`unrecognized_keys`:return`Onbekende key${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Ongeldige key in ${e.origin}`;case`invalid_union`:return`Ongeldige invoer`;case`invalid_element`:return`Ongeldige waarde in ${e.origin}`;default:return`Ongeldige invoer`}}};function Iu(){return{localeError:Fu()}}const Lu=()=>{let e={string:{unit:`tegn`,verb:`å ha`},file:{unit:`bytes`,verb:`å ha`},array:{unit:`elementer`,verb:`å inneholde`},set:{unit:`elementer`,verb:`å inneholde`}};function t(t){return e[t]??null}let n={regex:`input`,email:`e-postadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslett`,date:`ISO-dato`,time:`ISO-klokkeslett`,duration:`ISO-varighet`,ipv4:`IPv4-område`,ipv6:`IPv6-område`,cidrv4:`IPv4-spekter`,cidrv6:`IPv6-spekter`,base64:`base64-enkodet streng`,base64url:`base64url-enkodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`tall`,array:`liste`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldig input: forventet instanceof ${e.expected}, fikk ${i}`:`Ugyldig input: forventet ${t}, fikk ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventet ${S(e.values[0])}`:`Ugyldig valg: forventet en av ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()} ${r.unit??`elementer`}`:`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}`:`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: må starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: må ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: må inneholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldig tall: må være et multiplum av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukjente nøkler`:`Ukjent nøkkel`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøkkel i ${e.origin}`;case`invalid_union`:return`Ugyldig input`;case`invalid_element`:return`Ugyldig verdi i ${e.origin}`;default:return`Ugyldig input`}}};function Ru(){return{localeError:Lu()}}const zu=()=>{let e={string:{unit:`harf`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`unsur`,verb:`olmalıdır`},set:{unit:`unsur`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n={regex:`giren`,email:`epostagâh`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO hengâmı`,date:`ISO tarihi`,time:`ISO zamanı`,duration:`ISO müddeti`,ipv4:`IPv4 nişânı`,ipv6:`IPv6 nişânı`,cidrv4:`IPv4 menzili`,cidrv6:`IPv6 menzili`,base64:`base64-şifreli metin`,base64url:`base64url-şifreli metin`,json_string:`JSON metin`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`giren`},r={nan:`NaN`,number:`numara`,array:`saf`,null:`gayb`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Fâsit giren: umulan instanceof ${e.expected}, alınan ${i}`:`Fâsit giren: umulan ${t}, alınan ${i}`}case`invalid_value`:return e.values.length===1?`Fâsit giren: umulan ${S(e.values[0])}`:`Fâsit tercih: mûteberler ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} ${r.unit??`elements`} sahip olmalıydı.`:`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} olmalıydı.`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} ${r.unit} sahip olmalıydı.`:`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} olmalıydı.`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Fâsit metin: "${t.prefix}" ile başlamalı.`:t.format===`ends_with`?`Fâsit metin: "${t.suffix}" ile bitmeli.`:t.format===`includes`?`Fâsit metin: "${t.includes}" ihtivâ etmeli.`:t.format===`regex`?`Fâsit metin: ${t.pattern} nakşına uymalı.`:`Fâsit ${n[t.format]??e.format}`}case`not_multiple_of`:return`Fâsit sayı: ${e.divisor} katı olmalıydı.`;case`unrecognized_keys`:return`Tanınmayan anahtar ${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} için tanınmayan anahtar var.`;case`invalid_union`:return`Giren tanınamadı.`;case`invalid_element`:return`${e.origin} için tanınmayan kıymet var.`;default:return`Kıymet tanınamadı.`}}};function Bu(){return{localeError:zu()}}const Vu=()=>{let e={string:{unit:`توکي`,verb:`ولري`},file:{unit:`بایټس`,verb:`ولري`},array:{unit:`توکي`,verb:`ولري`},set:{unit:`توکي`,verb:`ولري`}};function t(t){return e[t]??null}let n={regex:`ورودي`,email:`بریښنالیک`,url:`یو آر ال`,emoji:`ایموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`نیټه او وخت`,date:`نېټه`,time:`وخت`,duration:`موده`,ipv4:`د IPv4 پته`,ipv6:`د IPv6 پته`,cidrv4:`د IPv4 ساحه`,cidrv6:`د IPv6 ساحه`,base64:`base64-encoded متن`,base64url:`base64url-encoded متن`,json_string:`JSON متن`,e164:`د E.164 شمېره`,jwt:`JWT`,template_literal:`ورودي`},r={nan:`NaN`,number:`عدد`,array:`ارې`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ناسم ورودي: باید instanceof ${e.expected} وای, مګر ${i} ترلاسه شو`:`ناسم ورودي: باید ${t} وای, مګر ${i} ترلاسه شو`}case`invalid_value`:return e.values.length===1?`ناسم ورودي: باید ${S(e.values[0])} وای`:`ناسم انتخاب: باید یو له ${C(e.values,`|`)} څخه وای`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصرونه`} ولري`:`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} وي`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} ولري`:`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} وي`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ناسم متن: باید د "${t.prefix}" سره پیل شي`:t.format===`ends_with`?`ناسم متن: باید د "${t.suffix}" سره پای ته ورسيږي`:t.format===`includes`?`ناسم متن: باید "${t.includes}" ولري`:t.format===`regex`?`ناسم متن: باید د ${t.pattern} سره مطابقت ولري`:`${n[t.format]??e.format} ناسم دی`}case`not_multiple_of`:return`ناسم عدد: باید د ${e.divisor} مضرب وي`;case`unrecognized_keys`:return`ناسم ${e.keys.length>1?`کلیډونه`:`کلیډ`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`ناسم کلیډ په ${e.origin} کې`;case`invalid_union`:return`ناسمه ورودي`;case`invalid_element`:return`ناسم عنصر په ${e.origin} کې`;default:return`ناسمه ورودي`}}};function Hu(){return{localeError:Vu()}}const Uu=()=>{let e={string:{unit:`znaków`,verb:`mieć`},file:{unit:`bajtów`,verb:`mieć`},array:{unit:`elementów`,verb:`mieć`},set:{unit:`elementów`,verb:`mieć`}};function t(t){return e[t]??null}let n={regex:`wyrażenie`,email:`adres email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i godzina w formacie ISO`,date:`data w formacie ISO`,time:`godzina w formacie ISO`,duration:`czas trwania ISO`,ipv4:`adres IPv4`,ipv6:`adres IPv6`,cidrv4:`zakres IPv4`,cidrv6:`zakres IPv6`,base64:`ciąg znaków zakodowany w formacie base64`,base64url:`ciąg znaków zakodowany w formacie base64url`,json_string:`ciąg znaków w formacie JSON`,e164:`liczba E.164`,jwt:`JWT`,template_literal:`wejście`},r={nan:`NaN`,number:`liczba`,array:`tablica`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${e.expected}, otrzymano ${i}`:`Nieprawidłowe dane wejściowe: oczekiwano ${t}, otrzymano ${i}`}case`invalid_value`:return e.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${S(e.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Za duża wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.maximum.toString()} ${r.unit??`elementów`}`:`Zbyt duż(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Za mała wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.minimum.toString()} ${r.unit??`elementów`}`:`Zbyt mał(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${t.prefix}"`:t.format===`ends_with`?`Nieprawidłowy ciąg znaków: musi kończyć się na "${t.suffix}"`:t.format===`includes`?`Nieprawidłowy ciąg znaków: musi zawierać "${t.includes}"`:t.format===`regex`?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}`:`Nieprawidłow(y/a/e) ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nieprawidłowa liczba: musi być wielokrotnością ${e.divisor}`;case`unrecognized_keys`:return`Nierozpoznane klucze${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Nieprawidłowy klucz w ${e.origin}`;case`invalid_union`:return`Nieprawidłowe dane wejściowe`;case`invalid_element`:return`Nieprawidłowa wartość w ${e.origin}`;default:return`Nieprawidłowe dane wejściowe`}}};function Wu(){return{localeError:Uu()}}const Gu=()=>{let e={string:{unit:`caracteres`,verb:`ter`},file:{unit:`bytes`,verb:`ter`},array:{unit:`itens`,verb:`ter`},set:{unit:`itens`,verb:`ter`}};function t(t){return e[t]??null}let n={regex:`padrão`,email:`endereço de e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`duração ISO`,ipv4:`endereço IPv4`,ipv6:`endereço IPv6`,cidrv4:`faixa de IPv4`,cidrv6:`faixa de IPv6`,base64:`texto codificado em base64`,base64url:`URL codificada em base64`,json_string:`texto JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`},r={nan:`NaN`,number:`número`,null:`nulo`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Tipo inválido: esperado instanceof ${e.expected}, recebido ${i}`:`Tipo inválido: esperado ${t}, recebido ${i}`}case`invalid_value`:return e.values.length===1?`Entrada inválida: esperado ${S(e.values[0])}`:`Opção inválida: esperada uma das ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Muito grande: esperado que ${e.origin??`valor`} tivesse ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Muito grande: esperado que ${e.origin??`valor`} fosse ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Muito pequeno: esperado que ${e.origin} tivesse ${n}${e.minimum.toString()} ${r.unit}`:`Muito pequeno: esperado que ${e.origin} fosse ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Texto inválido: deve começar com "${t.prefix}"`:t.format===`ends_with`?`Texto inválido: deve terminar com "${t.suffix}"`:t.format===`includes`?`Texto inválido: deve incluir "${t.includes}"`:t.format===`regex`?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`${n[t.format]??e.format} inválido`}case`not_multiple_of`:return`Número inválido: deve ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Chave${e.keys.length>1?`s`:``} desconhecida${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Chave inválida em ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido em ${e.origin}`;default:return`Campo inválido`}}};function Ku(){return{localeError:Gu()}}function qu(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}const Ju=()=>{let e={string:{unit:{one:`символ`,few:`символа`,many:`символов`},verb:`иметь`},file:{unit:{one:`байт`,few:`байта`,many:`байт`},verb:`иметь`},array:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`},set:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`}};function t(t){return e[t]??null}let n={regex:`ввод`,email:`email адрес`,url:`URL`,emoji:`эмодзи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата и время`,date:`ISO дата`,time:`ISO время`,duration:`ISO длительность`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`строка в формате base64`,base64url:`строка в формате base64url`,json_string:`JSON строка`,e164:`номер E.164`,jwt:`JWT`,template_literal:`ввод`},r={nan:`NaN`,number:`число`,array:`массив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неверный ввод: ожидалось instanceof ${e.expected}, получено ${i}`:`Неверный ввод: ожидалось ${t}, получено ${i}`}case`invalid_value`:return e.values.length===1?`Неверный ввод: ожидалось ${S(e.values[0])}`:`Неверный вариант: ожидалось одно из ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=qu(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет иметь ${n}${e.maximum.toString()} ${t}`}return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=qu(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`}return`Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неверная строка: должна начинаться с "${t.prefix}"`:t.format===`ends_with`?`Неверная строка: должна заканчиваться на "${t.suffix}"`:t.format===`includes`?`Неверная строка: должна содержать "${t.includes}"`:t.format===`regex`?`Неверная строка: должна соответствовать шаблону ${t.pattern}`:`Неверный ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неверное число: должно быть кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспознанн${e.keys.length>1?`ые`:`ый`} ключ${e.keys.length>1?`и`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Неверный ключ в ${e.origin}`;case`invalid_union`:return`Неверные входные данные`;case`invalid_element`:return`Неверное значение в ${e.origin}`;default:return`Неверные входные данные`}}};function Yu(){return{localeError:Ju()}}const Xu=()=>{let e={string:{unit:`znakov`,verb:`imeti`},file:{unit:`bajtov`,verb:`imeti`},array:{unit:`elementov`,verb:`imeti`},set:{unit:`elementov`,verb:`imeti`}};function t(t){return e[t]??null}let n={regex:`vnos`,email:`e-poštni naslov`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum in čas`,date:`ISO datum`,time:`ISO čas`,duration:`ISO trajanje`,ipv4:`IPv4 naslov`,ipv6:`IPv6 naslov`,cidrv4:`obseg IPv4`,cidrv6:`obseg IPv6`,base64:`base64 kodiran niz`,base64url:`base64url kodiran niz`,json_string:`JSON niz`,e164:`E.164 številka`,jwt:`JWT`,template_literal:`vnos`},r={nan:`NaN`,number:`število`,array:`tabela`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neveljaven vnos: pričakovano instanceof ${e.expected}, prejeto ${i}`:`Neveljaven vnos: pričakovano ${t}, prejeto ${i}`}case`invalid_value`:return e.values.length===1?`Neveljaven vnos: pričakovano ${S(e.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} imelo ${n}${e.maximum.toString()} ${r.unit??`elementov`}`:`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Premajhno: pričakovano, da bo ${e.origin} imelo ${n}${e.minimum.toString()} ${r.unit}`:`Premajhno: pričakovano, da bo ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neveljaven niz: mora se začeti z "${t.prefix}"`:t.format===`ends_with`?`Neveljaven niz: mora se končati z "${t.suffix}"`:t.format===`includes`?`Neveljaven niz: mora vsebovati "${t.includes}"`:t.format===`regex`?`Neveljaven niz: mora ustrezati vzorcu ${t.pattern}`:`Neveljaven ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neveljavno število: mora biti večkratnik ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznan${e.keys.length>1?`i ključi`:` ključ`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Neveljaven ključ v ${e.origin}`;case`invalid_union`:return`Neveljaven vnos`;case`invalid_element`:return`Neveljavna vrednost v ${e.origin}`;default:return`Neveljaven vnos`}}};function Zu(){return{localeError:Xu()}}const Qu=()=>{let e={string:{unit:`tecken`,verb:`att ha`},file:{unit:`bytes`,verb:`att ha`},array:{unit:`objekt`,verb:`att innehålla`},set:{unit:`objekt`,verb:`att innehålla`}};function t(t){return e[t]??null}let n={regex:`reguljärt uttryck`,email:`e-postadress`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datum och tid`,date:`ISO-datum`,time:`ISO-tid`,duration:`ISO-varaktighet`,ipv4:`IPv4-intervall`,ipv6:`IPv6-intervall`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodad sträng`,base64url:`base64url-kodad sträng`,json_string:`JSON-sträng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`mall-literal`},r={nan:`NaN`,number:`antal`,array:`lista`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ogiltig inmatning: förväntat instanceof ${e.expected}, fick ${i}`:`Ogiltig inmatning: förväntat ${t}, fick ${i}`}case`invalid_value`:return e.values.length===1?`Ogiltig inmatning: förväntat ${S(e.values[0])}`:`Ogiltigt val: förväntade en av ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`För stor(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()} ${r.unit??`element`}`:`För stor(t): förväntat ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()} ${r.unit}`:`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ogiltig sträng: måste börja med "${t.prefix}"`:t.format===`ends_with`?`Ogiltig sträng: måste sluta med "${t.suffix}"`:t.format===`includes`?`Ogiltig sträng: måste innehålla "${t.includes}"`:t.format===`regex`?`Ogiltig sträng: måste matcha mönstret "${t.pattern}"`:`Ogiltig(t) ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ogiltigt tal: måste vara en multipel av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Okända nycklar`:`Okänd nyckel`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Ogiltig nyckel i ${e.origin??`värdet`}`;case`invalid_union`:return`Ogiltig input`;case`invalid_element`:return`Ogiltigt värde i ${e.origin??`värdet`}`;default:return`Ogiltig input`}}};function $u(){return{localeError:Qu()}}const ed=()=>{let e={string:{unit:`எழுத்துக்கள்`,verb:`கொண்டிருக்க வேண்டும்`},file:{unit:`பைட்டுகள்`,verb:`கொண்டிருக்க வேண்டும்`},array:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},set:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`}};function t(t){return e[t]??null}let n={regex:`உள்ளீடு`,email:`மின்னஞ்சல் முகவரி`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO தேதி நேரம்`,date:`ISO தேதி`,time:`ISO நேரம்`,duration:`ISO கால அளவு`,ipv4:`IPv4 முகவரி`,ipv6:`IPv6 முகவரி`,cidrv4:`IPv4 வரம்பு`,cidrv6:`IPv6 வரம்பு`,base64:`base64-encoded சரம்`,base64url:`base64url-encoded சரம்`,json_string:`JSON சரம்`,e164:`E.164 எண்`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`எண்`,array:`அணி`,null:`வெறுமை`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${e.expected}, பெறப்பட்டது ${i}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${t}, பெறப்பட்டது ${i}`}case`invalid_value`:return e.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${S(e.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${C(e.values,`|`)} இல் ஒன்று`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ${r.unit??`உறுப்புகள்`} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ஆக இருக்க வேண்டும்`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ஆக இருக்க வேண்டும்`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`தவறான சரம்: "${t.prefix}" இல் தொடங்க வேண்டும்`:t.format===`ends_with`?`தவறான சரம்: "${t.suffix}" இல் முடிவடைய வேண்டும்`:t.format===`includes`?`தவறான சரம்: "${t.includes}" ஐ உள்ளடக்க வேண்டும்`:t.format===`regex`?`தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${n[t.format]??e.format}`}case`not_multiple_of`:return`தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`;case`unrecognized_keys`:return`அடையாளம் தெரியாத விசை${e.keys.length>1?`கள்`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} இல் தவறான விசை`;case`invalid_union`:return`தவறான உள்ளீடு`;case`invalid_element`:return`${e.origin} இல் தவறான மதிப்பு`;default:return`தவறான உள்ளீடு`}}};function td(){return{localeError:ed()}}const nd=()=>{let e={string:{unit:`ตัวอักษร`,verb:`ควรมี`},file:{unit:`ไบต์`,verb:`ควรมี`},array:{unit:`รายการ`,verb:`ควรมี`},set:{unit:`รายการ`,verb:`ควรมี`}};function t(t){return e[t]??null}let n={regex:`ข้อมูลที่ป้อน`,email:`ที่อยู่อีเมล`,url:`URL`,emoji:`อิโมจิ`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`วันที่เวลาแบบ ISO`,date:`วันที่แบบ ISO`,time:`เวลาแบบ ISO`,duration:`ช่วงเวลาแบบ ISO`,ipv4:`ที่อยู่ IPv4`,ipv6:`ที่อยู่ IPv6`,cidrv4:`ช่วง IP แบบ IPv4`,cidrv6:`ช่วง IP แบบ IPv6`,base64:`ข้อความแบบ Base64`,base64url:`ข้อความแบบ Base64 สำหรับ URL`,json_string:`ข้อความแบบ JSON`,e164:`เบอร์โทรศัพท์ระหว่างประเทศ (E.164)`,jwt:`โทเคน JWT`,template_literal:`ข้อมูลที่ป้อน`},r={nan:`NaN`,number:`ตัวเลข`,array:`อาร์เรย์ (Array)`,null:`ไม่มีค่า (null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${e.expected} แต่ได้รับ ${i}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${t} แต่ได้รับ ${i}`}case`invalid_value`:return e.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${S(e.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`ไม่เกิน`:`น้อยกว่า`,r=t(e.origin);return r?`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()} ${r.unit??`รายการ`}`:`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`อย่างน้อย`:`มากกว่า`,r=t(e.origin);return r?`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()} ${r.unit}`:`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${t.prefix}"`:t.format===`ends_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${t.suffix}"`:t.format===`includes`?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${t.includes}" อยู่ในข้อความ`:t.format===`regex`?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}`:`รูปแบบไม่ถูกต้อง: ${n[t.format]??e.format}`}case`not_multiple_of`:return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`;case`unrecognized_keys`:return`พบคีย์ที่ไม่รู้จัก: ${C(e.keys,`, `)}`;case`invalid_key`:return`คีย์ไม่ถูกต้องใน ${e.origin}`;case`invalid_union`:return`ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`;case`invalid_element`:return`ข้อมูลไม่ถูกต้องใน ${e.origin}`;default:return`ข้อมูลไม่ถูกต้อง`}}};function rd(){return{localeError:nd()}}const id=()=>{let e={string:{unit:`karakter`,verb:`olmalı`},file:{unit:`bayt`,verb:`olmalı`},array:{unit:`öğe`,verb:`olmalı`},set:{unit:`öğe`,verb:`olmalı`}};function t(t){return e[t]??null}let n={regex:`girdi`,email:`e-posta adresi`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO tarih ve saat`,date:`ISO tarih`,time:`ISO saat`,duration:`ISO süre`,ipv4:`IPv4 adresi`,ipv6:`IPv6 adresi`,cidrv4:`IPv4 aralığı`,cidrv6:`IPv6 aralığı`,base64:`base64 ile şifrelenmiş metin`,base64url:`base64url ile şifrelenmiş metin`,json_string:`JSON dizesi`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`Şablon dizesi`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Geçersiz değer: beklenen instanceof ${e.expected}, alınan ${i}`:`Geçersiz değer: beklenen ${t}, alınan ${i}`}case`invalid_value`:return e.values.length===1?`Geçersiz değer: beklenen ${S(e.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()} ${r.unit??`öğe`}`:`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Geçersiz metin: "${t.prefix}" ile başlamalı`:t.format===`ends_with`?`Geçersiz metin: "${t.suffix}" ile bitmeli`:t.format===`includes`?`Geçersiz metin: "${t.includes}" içermeli`:t.format===`regex`?`Geçersiz metin: ${t.pattern} desenine uymalı`:`Geçersiz ${n[t.format]??e.format}`}case`not_multiple_of`:return`Geçersiz sayı: ${e.divisor} ile tam bölünebilmeli`;case`unrecognized_keys`:return`Tanınmayan anahtar${e.keys.length>1?`lar`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} içinde geçersiz anahtar`;case`invalid_union`:return`Geçersiz değer`;case`invalid_element`:return`${e.origin} içinde geçersiz değer`;default:return`Geçersiz değer`}}};function ad(){return{localeError:id()}}const od=()=>{let e={string:{unit:`символів`,verb:`матиме`},file:{unit:`байтів`,verb:`матиме`},array:{unit:`елементів`,verb:`матиме`},set:{unit:`елементів`,verb:`матиме`}};function t(t){return e[t]??null}let n={regex:`вхідні дані`,email:`адреса електронної пошти`,url:`URL`,emoji:`емодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`дата та час ISO`,date:`дата ISO`,time:`час ISO`,duration:`тривалість ISO`,ipv4:`адреса IPv4`,ipv6:`адреса IPv6`,cidrv4:`діапазон IPv4`,cidrv6:`діапазон IPv6`,base64:`рядок у кодуванні base64`,base64url:`рядок у кодуванні base64url`,json_string:`рядок JSON`,e164:`номер E.164`,jwt:`JWT`,template_literal:`вхідні дані`},r={nan:`NaN`,number:`число`,array:`масив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неправильні вхідні дані: очікується instanceof ${e.expected}, отримано ${i}`:`Неправильні вхідні дані: очікується ${t}, отримано ${i}`}case`invalid_value`:return e.values.length===1?`Неправильні вхідні дані: очікується ${S(e.values[0])}`:`Неправильна опція: очікується одне з ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Занадто велике: очікується, що ${e.origin??`значення`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`елементів`}`:`Занадто велике: очікується, що ${e.origin??`значення`} буде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Занадто мале: очікується, що ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Занадто мале: очікується, що ${e.origin} буде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неправильний рядок: повинен починатися з "${t.prefix}"`:t.format===`ends_with`?`Неправильний рядок: повинен закінчуватися на "${t.suffix}"`:t.format===`includes`?`Неправильний рядок: повинен містити "${t.includes}"`:t.format===`regex`?`Неправильний рядок: повинен відповідати шаблону ${t.pattern}`:`Неправильний ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неправильне число: повинно бути кратним ${e.divisor}`;case`unrecognized_keys`:return`Нерозпізнаний ключ${e.keys.length>1?`і`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Неправильний ключ у ${e.origin}`;case`invalid_union`:return`Неправильні вхідні дані`;case`invalid_element`:return`Неправильне значення у ${e.origin}`;default:return`Неправильні вхідні дані`}}};function sd(){return{localeError:od()}}function cd(){return sd()}const ld=()=>{let e={string:{unit:`حروف`,verb:`ہونا`},file:{unit:`بائٹس`,verb:`ہونا`},array:{unit:`آئٹمز`,verb:`ہونا`},set:{unit:`آئٹمز`,verb:`ہونا`}};function t(t){return e[t]??null}let n={regex:`ان پٹ`,email:`ای میل ایڈریس`,url:`یو آر ایل`,emoji:`ایموجی`,uuid:`یو یو آئی ڈی`,uuidv4:`یو یو آئی ڈی وی 4`,uuidv6:`یو یو آئی ڈی وی 6`,nanoid:`نینو آئی ڈی`,guid:`جی یو آئی ڈی`,cuid:`سی یو آئی ڈی`,cuid2:`سی یو آئی ڈی 2`,ulid:`یو ایل آئی ڈی`,xid:`ایکس آئی ڈی`,ksuid:`کے ایس یو آئی ڈی`,datetime:`آئی ایس او ڈیٹ ٹائم`,date:`آئی ایس او تاریخ`,time:`آئی ایس او وقت`,duration:`آئی ایس او مدت`,ipv4:`آئی پی وی 4 ایڈریس`,ipv6:`آئی پی وی 6 ایڈریس`,cidrv4:`آئی پی وی 4 رینج`,cidrv6:`آئی پی وی 6 رینج`,base64:`بیس 64 ان کوڈڈ سٹرنگ`,base64url:`بیس 64 یو آر ایل ان کوڈڈ سٹرنگ`,json_string:`جے ایس او این سٹرنگ`,e164:`ای 164 نمبر`,jwt:`جے ڈبلیو ٹی`,template_literal:`ان پٹ`},r={nan:`NaN`,number:`نمبر`,array:`آرے`,null:`نل`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`غلط ان پٹ: instanceof ${e.expected} متوقع تھا، ${i} موصول ہوا`:`غلط ان پٹ: ${t} متوقع تھا، ${i} موصول ہوا`}case`invalid_value`:return e.values.length===1?`غلط ان پٹ: ${S(e.values[0])} متوقع تھا`:`غلط آپشن: ${C(e.values,`|`)} میں سے ایک متوقع تھا`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`بہت بڑا: ${e.origin??`ویلیو`} کے ${n}${e.maximum.toString()} ${r.unit??`عناصر`} ہونے متوقع تھے`:`بہت بڑا: ${e.origin??`ویلیو`} کا ${n}${e.maximum.toString()} ہونا متوقع تھا`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`بہت چھوٹا: ${e.origin} کے ${n}${e.minimum.toString()} ${r.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${e.origin} کا ${n}${e.minimum.toString()} ہونا متوقع تھا`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`غلط سٹرنگ: "${t.prefix}" سے شروع ہونا چاہیے`:t.format===`ends_with`?`غلط سٹرنگ: "${t.suffix}" پر ختم ہونا چاہیے`:t.format===`includes`?`غلط سٹرنگ: "${t.includes}" شامل ہونا چاہیے`:t.format===`regex`?`غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے`:`غلط ${n[t.format]??e.format}`}case`not_multiple_of`:return`غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`;case`unrecognized_keys`:return`غیر تسلیم شدہ کی${e.keys.length>1?`ز`:``}: ${C(e.keys,`، `)}`;case`invalid_key`:return`${e.origin} میں غلط کی`;case`invalid_union`:return`غلط ان پٹ`;case`invalid_element`:return`${e.origin} میں غلط ویلیو`;default:return`غلط ان پٹ`}}};function ud(){return{localeError:ld()}}const dd=()=>{let e={string:{unit:`belgi`,verb:`bo‘lishi kerak`},file:{unit:`bayt`,verb:`bo‘lishi kerak`},array:{unit:`element`,verb:`bo‘lishi kerak`},set:{unit:`element`,verb:`bo‘lishi kerak`}};function t(t){return e[t]??null}let n={regex:`kirish`,email:`elektron pochta manzili`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO sana va vaqti`,date:`ISO sana`,time:`ISO vaqt`,duration:`ISO davomiylik`,ipv4:`IPv4 manzil`,ipv6:`IPv6 manzil`,mac:`MAC manzil`,cidrv4:`IPv4 diapazon`,cidrv6:`IPv6 diapazon`,base64:`base64 kodlangan satr`,base64url:`base64url kodlangan satr`,json_string:`JSON satr`,e164:`E.164 raqam`,jwt:`JWT`,template_literal:`kirish`},r={nan:`NaN`,number:`raqam`,array:`massiv`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${e.expected}, qabul qilingan ${i}`:`Noto‘g‘ri kirish: kutilgan ${t}, qabul qilingan ${i}`}case`invalid_value`:return e.values.length===1?`Noto‘g‘ri kirish: kutilgan ${S(e.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Juda katta: kutilgan ${e.origin??`qiymat`} ${n}${e.maximum.toString()} ${r.unit} ${r.verb}`:`Juda katta: kutilgan ${e.origin??`qiymat`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Noto‘g‘ri satr: "${t.prefix}" bilan boshlanishi kerak`:t.format===`ends_with`?`Noto‘g‘ri satr: "${t.suffix}" bilan tugashi kerak`:t.format===`includes`?`Noto‘g‘ri satr: "${t.includes}" ni o‘z ichiga olishi kerak`:t.format===`regex`?`Noto‘g‘ri satr: ${t.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${n[t.format]??e.format}`}case`not_multiple_of`:return`Noto‘g‘ri raqam: ${e.divisor} ning karralisi bo‘lishi kerak`;case`unrecognized_keys`:return`Noma’lum kalit${e.keys.length>1?`lar`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} dagi kalit noto‘g‘ri`;case`invalid_union`:return`Noto‘g‘ri kirish`;case`invalid_element`:return`${e.origin} da noto‘g‘ri qiymat`;default:return`Noto‘g‘ri kirish`}}};function fd(){return{localeError:dd()}}const pd=()=>{let e={string:{unit:`ký tự`,verb:`có`},file:{unit:`byte`,verb:`có`},array:{unit:`phần tử`,verb:`có`},set:{unit:`phần tử`,verb:`có`}};function t(t){return e[t]??null}let n={regex:`đầu vào`,email:`địa chỉ email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ngày giờ ISO`,date:`ngày ISO`,time:`giờ ISO`,duration:`khoảng thời gian ISO`,ipv4:`địa chỉ IPv4`,ipv6:`địa chỉ IPv6`,cidrv4:`dải IPv4`,cidrv6:`dải IPv6`,base64:`chuỗi mã hóa base64`,base64url:`chuỗi mã hóa base64url`,json_string:`chuỗi JSON`,e164:`số E.164`,jwt:`JWT`,template_literal:`đầu vào`},r={nan:`NaN`,number:`số`,array:`mảng`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${e.expected}, nhận được ${i}`:`Đầu vào không hợp lệ: mong đợi ${t}, nhận được ${i}`}case`invalid_value`:return e.values.length===1?`Đầu vào không hợp lệ: mong đợi ${S(e.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Quá lớn: mong đợi ${e.origin??`giá trị`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`phần tử`}`:`Quá lớn: mong đợi ${e.origin??`giá trị`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Quá nhỏ: mong đợi ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Quá nhỏ: mong đợi ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chuỗi không hợp lệ: phải bắt đầu bằng "${t.prefix}"`:t.format===`ends_with`?`Chuỗi không hợp lệ: phải kết thúc bằng "${t.suffix}"`:t.format===`includes`?`Chuỗi không hợp lệ: phải bao gồm "${t.includes}"`:t.format===`regex`?`Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}`:`${n[t.format]??e.format} không hợp lệ`}case`not_multiple_of`:return`Số không hợp lệ: phải là bội số của ${e.divisor}`;case`unrecognized_keys`:return`Khóa không được nhận dạng: ${C(e.keys,`, `)}`;case`invalid_key`:return`Khóa không hợp lệ trong ${e.origin}`;case`invalid_union`:return`Đầu vào không hợp lệ`;case`invalid_element`:return`Giá trị không hợp lệ trong ${e.origin}`;default:return`Đầu vào không hợp lệ`}}};function md(){return{localeError:pd()}}const hd=()=>{let e={string:{unit:`字符`,verb:`包含`},file:{unit:`字节`,verb:`包含`},array:{unit:`项`,verb:`包含`},set:{unit:`项`,verb:`包含`}};function t(t){return e[t]??null}let n={regex:`输入`,email:`电子邮件`,url:`URL`,emoji:`表情符号`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日期时间`,date:`ISO日期`,time:`ISO时间`,duration:`ISO时长`,ipv4:`IPv4地址`,ipv6:`IPv6地址`,cidrv4:`IPv4网段`,cidrv6:`IPv6网段`,base64:`base64编码字符串`,base64url:`base64url编码字符串`,json_string:`JSON字符串`,e164:`E.164号码`,jwt:`JWT`,template_literal:`输入`},r={nan:`NaN`,number:`数字`,array:`数组`,null:`空值(null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`无效输入:期望 instanceof ${e.expected},实际接收 ${i}`:`无效输入:期望 ${t},实际接收 ${i}`}case`invalid_value`:return e.values.length===1?`无效输入:期望 ${S(e.values[0])}`:`无效选项:期望以下之一 ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()} ${r.unit??`个元素`}`:`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`无效字符串:必须以 "${t.prefix}" 开头`:t.format===`ends_with`?`无效字符串:必须以 "${t.suffix}" 结尾`:t.format===`includes`?`无效字符串:必须包含 "${t.includes}"`:t.format===`regex`?`无效字符串:必须满足正则表达式 ${t.pattern}`:`无效${n[t.format]??e.format}`}case`not_multiple_of`:return`无效数字:必须是 ${e.divisor} 的倍数`;case`unrecognized_keys`:return`出现未知的键(key): ${C(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} 中的键(key)无效`;case`invalid_union`:return`无效输入`;case`invalid_element`:return`${e.origin} 中包含无效值(value)`;default:return`无效输入`}}};function gd(){return{localeError:hd()}}const _d=()=>{let e={string:{unit:`字元`,verb:`擁有`},file:{unit:`位元組`,verb:`擁有`},array:{unit:`項目`,verb:`擁有`},set:{unit:`項目`,verb:`擁有`}};function t(t){return e[t]??null}let n={regex:`輸入`,email:`郵件地址`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 日期時間`,date:`ISO 日期`,time:`ISO 時間`,duration:`ISO 期間`,ipv4:`IPv4 位址`,ipv6:`IPv6 位址`,cidrv4:`IPv4 範圍`,cidrv6:`IPv6 範圍`,base64:`base64 編碼字串`,base64url:`base64url 編碼字串`,json_string:`JSON 字串`,e164:`E.164 數值`,jwt:`JWT`,template_literal:`輸入`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`無效的輸入值:預期為 instanceof ${e.expected},但收到 ${i}`:`無效的輸入值:預期為 ${t},但收到 ${i}`}case`invalid_value`:return e.values.length===1?`無效的輸入值:預期為 ${S(e.values[0])}`:`無效的選項:預期為以下其中之一 ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()} ${r.unit??`個元素`}`:`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()} ${r.unit}`:`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無效的字串:必須以 "${t.prefix}" 開頭`:t.format===`ends_with`?`無效的字串:必須以 "${t.suffix}" 結尾`:t.format===`includes`?`無效的字串:必須包含 "${t.includes}"`:t.format===`regex`?`無效的字串:必須符合格式 ${t.pattern}`:`無效的 ${n[t.format]??e.format}`}case`not_multiple_of`:return`無效的數字:必須為 ${e.divisor} 的倍數`;case`unrecognized_keys`:return`無法識別的鍵值${e.keys.length>1?`們`:``}:${C(e.keys,`、`)}`;case`invalid_key`:return`${e.origin} 中有無效的鍵值`;case`invalid_union`:return`無效的輸入值`;case`invalid_element`:return`${e.origin} 中有無效的值`;default:return`無效的輸入值`}}};function vd(){return{localeError:_d()}}const yd=()=>{let e={string:{unit:`àmi`,verb:`ní`},file:{unit:`bytes`,verb:`ní`},array:{unit:`nkan`,verb:`ní`},set:{unit:`nkan`,verb:`ní`}};function t(t){return e[t]??null}let n={regex:`ẹ̀rọ ìbáwọlé`,email:`àdírẹ́sì ìmẹ́lì`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`àkókò ISO`,date:`ọjọ́ ISO`,time:`àkókò ISO`,duration:`àkókò tó pé ISO`,ipv4:`àdírẹ́sì IPv4`,ipv6:`àdírẹ́sì IPv6`,cidrv4:`àgbègbè IPv4`,cidrv6:`àgbègbè IPv6`,base64:`ọ̀rọ̀ tí a kọ́ ní base64`,base64url:`ọ̀rọ̀ base64url`,json_string:`ọ̀rọ̀ JSON`,e164:`nọ́mbà E.164`,jwt:`JWT`,template_literal:`ẹ̀rọ ìbáwọlé`},r={nan:`NaN`,number:`nọ́mbà`,array:`akopọ`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=x(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${e.expected}, àmọ̀ a rí ${i}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${t}, àmọ̀ a rí ${i}`}case`invalid_value`:return e.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${S(e.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tó pọ̀ jù: a ní láti jẹ́ pé ${e.origin??`iye`} ${r.verb} ${n}${e.maximum} ${r.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${n}${e.maximum}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Kéré ju: a ní láti jẹ́ pé ${e.origin} ${r.verb} ${n}${e.minimum} ${r.unit}`:`Kéré ju: a ní láti jẹ́ ${n}${e.minimum}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${t.prefix}"`:t.format===`ends_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${t.suffix}"`:t.format===`includes`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${t.includes}"`:t.format===`regex`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${t.pattern}`:`Aṣìṣe: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${e.divisor}`;case`unrecognized_keys`:return`Bọtìnì àìmọ̀: ${C(e.keys,`, `)}`;case`invalid_key`:return`Bọtìnì aṣìṣe nínú ${e.origin}`;case`invalid_union`:return`Ìbáwọlé aṣìṣe`;case`invalid_element`:return`Iye aṣìṣe nínú ${e.origin}`;default:return`Ìbáwọlé aṣìṣe`}}};function bd(){return{localeError:yd()}}var xd=r({ar:()=>Ol,az:()=>Al,be:()=>Nl,bg:()=>Fl,ca:()=>Ll,cs:()=>zl,da:()=>Vl,de:()=>Ul,en:()=>Gl,eo:()=>ql,es:()=>Yl,fa:()=>Zl,fi:()=>$l,fr:()=>tu,frCA:()=>ru,he:()=>au,hu:()=>su,hy:()=>du,id:()=>pu,is:()=>hu,it:()=>_u,ja:()=>yu,ka:()=>xu,kh:()=>wu,km:()=>Cu,ko:()=>Eu,lt:()=>Au,mk:()=>Mu,ms:()=>Pu,nl:()=>Iu,no:()=>Ru,ota:()=>Bu,pl:()=>Wu,ps:()=>Hu,pt:()=>Ku,ru:()=>Yu,sl:()=>Zu,sv:()=>$u,ta:()=>td,th:()=>rd,tr:()=>ad,ua:()=>cd,uk:()=>sd,ur:()=>ud,uz:()=>fd,vi:()=>md,yo:()=>bd,zhCN:()=>gd,zhTW:()=>vd}),Sd=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??`draft-2020-12`;t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),this.ctx=Sn({processors:mn,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return Je(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),Xt(this.ctx,e);let{"~standard":n,...r}=an(this.ctx,e);return r}},Cd=r({}),wd=r({$ZodAny:()=>St,$ZodArray:()=>Rr,$ZodAsyncError:()=>ve,$ZodBase64:()=>Ar,$ZodBase64URL:()=>Kr,$ZodBigInt:()=>En,$ZodBigIntFormat:()=>m,$ZodBoolean:()=>Ki,$ZodCIDRv4:()=>hs,$ZodCIDRv6:()=>yo,$ZodCUID:()=>Qo,$ZodCUID2:()=>Oa,$ZodCatch:()=>fi,$ZodCheck:()=>Fs,$ZodCheckBigIntFormat:()=>oc,$ZodCheckEndsWith:()=>Si,$ZodCheckGreaterThan:()=>Qs,$ZodCheckIncludes:()=>Jn,$ZodCheckLengthEquals:()=>Ce,$ZodCheckLessThan:()=>Ws,$ZodCheckLowerCase:()=>rr,$ZodCheckMaxLength:()=>Ve,$ZodCheckMaxSize:()=>Me,$ZodCheckMimeType:()=>hn,$ZodCheckMinLength:()=>qa,$ZodCheckMinSize:()=>oe,$ZodCheckMultipleOf:()=>Ra,$ZodCheckNumberFormat:()=>Zt,$ZodCheckOverwrite:()=>on,$ZodCheckProperty:()=>Cn,$ZodCheckRegex:()=>Ye,$ZodCheckSizeEquals:()=>yt,$ZodCheckStartsWith:()=>Ut,$ZodCheckStringFormat:()=>zn,$ZodCheckUpperCase:()=>mc,$ZodCodec:()=>Do,$ZodCustom:()=>ss,$ZodCustomStringFormat:()=>ki,$ZodDate:()=>eo,$ZodDefault:()=>ws,$ZodDiscriminatedUnion:()=>Ri,$ZodE164:()=>ta,$ZodEmail:()=>Io,$ZodEmoji:()=>lo,$ZodEncodeError:()=>zs,$ZodEnum:()=>ya,$ZodError:()=>Fi,$ZodExactOptional:()=>ua,$ZodFile:()=>ii,$ZodFunction:()=>Ns,$ZodGUID:()=>ic,$ZodIPv4:()=>bi,$ZodIPv6:()=>Xs,$ZodISODate:()=>Kn,$ZodISODateTime:()=>xe,$ZodISODuration:()=>Hs,$ZodISOTime:()=>tr,$ZodIntersection:()=>ze,$ZodJWT:()=>Ae,$ZodKSUID:()=>pn,$ZodLazy:()=>Ga,$ZodLiteral:()=>ie,$ZodMAC:()=>Ia,$ZodMap:()=>Yt,$ZodNaN:()=>rn,$ZodNanoID:()=>xn,$ZodNever:()=>qe,$ZodNonOptional:()=>_t,$ZodNull:()=>Vt,$ZodNullable:()=>Ln,$ZodNumber:()=>fc,$ZodNumberFormat:()=>fe,$ZodObject:()=>_r,$ZodObjectJIT:()=>lt,$ZodOptional:()=>lr,$ZodPipe:()=>Tr,$ZodPrefault:()=>tt,$ZodPromise:()=>Nt,$ZodReadonly:()=>Wo,$ZodRealError:()=>Qi,$ZodRecord:()=>Tt,$ZodRegistry:()=>or,$ZodSet:()=>Vr,$ZodString:()=>Nr,$ZodStringFormat:()=>Yr,$ZodSuccess:()=>kn,$ZodSymbol:()=>_,$ZodTemplateLiteral:()=>Ji,$ZodTransform:()=>_s,$ZodTuple:()=>xo,$ZodType:()=>es,$ZodULID:()=>Aa,$ZodURL:()=>mi,$ZodUUID:()=>ko,$ZodUndefined:()=>ls,$ZodUnion:()=>ji,$ZodUnknown:()=>no,$ZodVoid:()=>Es,$ZodXID:()=>Bi,$ZodXor:()=>ra,$brand:()=>Qn,$constructor:()=>Ie,$input:()=>Sr,$output:()=>Qe,Doc:()=>oi,JSONSchema:()=>Cd,JSONSchemaGenerator:()=>Sd,NEVER:()=>De,TimePrecision:()=>vt,_any:()=>Ht,_array:()=>Rn,_base64:()=>pc,_base64url:()=>pe,_bigint:()=>vr,_boolean:()=>ut,_catch:()=>ur,_check:()=>Er,_cidrv4:()=>nt,_cidrv6:()=>Pt,_coercedBigint:()=>Go,_coercedBoolean:()=>Et,_coercedDate:()=>Hr,_coercedNumber:()=>Pr,_coercedString:()=>Xr,_cuid:()=>An,_cuid2:()=>v,_custom:()=>Wi,_date:()=>ps,_decode:()=>yr,_decodeAsync:()=>dt,_default:()=>_o,_discriminatedUnion:()=>Xo,_e164:()=>Ea,_email:()=>ui,_emoji:()=>To,_encode:()=>dr,_encodeAsync:()=>Dr,_endsWith:()=>as,_enum:()=>Di,_file:()=>Qa,_float32:()=>Ss,_float64:()=>Ii,_gt:()=>$i,_gte:()=>Po,_guid:()=>so,_includes:()=>_a,_int:()=>ca,_int32:()=>ni,_int64:()=>js,_intersection:()=>nc,_ipv4:()=>vi,_ipv6:()=>Js,_isoDate:()=>Wn,_isoDateTime:()=>ye,_isoDuration:()=>Bs,_isoTime:()=>$n,_jwt:()=>Le,_ksuid:()=>Oe,_lazy:()=>dn,_length:()=>Ua,_literal:()=>ne,_lowercase:()=>Pa,_lt:()=>qt,_lte:()=>tn,_mac:()=>yn,_map:()=>Ge,_max:()=>tn,_maxLength:()=>ht,_maxSize:()=>zt,_mime:()=>Fn,_min:()=>Po,_minLength:()=>uc,_minSize:()=>ue,_multipleOf:()=>hr,_nan:()=>st,_nanoid:()=>sr,_nativeEnum:()=>Cr,_negative:()=>$e,_never:()=>jt,_nonnegative:()=>Ho,_nonoptional:()=>Ct,_nonpositive:()=>zr,_normalize:()=>jr,_null:()=>qr,_nullable:()=>Dn,_number:()=>h,_optional:()=>Hi,_overwrite:()=>ds,_parse:()=>rt,_parseAsync:()=>Ft,_pipe:()=>ho,_positive:()=>Jo,_promise:()=>wa,_property:()=>ci,_readonly:()=>Co,_record:()=>rs,_refine:()=>Ti,_regex:()=>Xa,_safeDecode:()=>Ko,_safeDecodeAsync:()=>Dt,_safeEncode:()=>Ur,_safeEncodeAsync:()=>Fr,_safeParse:()=>Zr,_safeParseAsync:()=>jn,_set:()=>bs,_size:()=>Pi,_slugify:()=>Zi,_startsWith:()=>Mo,_string:()=>ao,_stringFormat:()=>ha,_stringbool:()=>oa,_success:()=>ei,_superRefine:()=>ks,_symbol:()=>tc,_templateLiteral:()=>_i,_toLowerCase:()=>qs,_toUpperCase:()=>Hn,_transform:()=>_e,_trim:()=>Rs,_tuple:()=>Zn,_uint32:()=>Fe,_uint64:()=>Ee,_ulid:()=>ln,_undefined:()=>Va,_union:()=>te,_unknown:()=>Na,_uppercase:()=>Kt,_url:()=>en,_uuid:()=>vn,_uuidv4:()=>We,_uuidv6:()=>mt,_uuidv7:()=>Rt,_void:()=>Pn,_xid:()=>lc,_xor:()=>le,clone:()=>As,config:()=>un,createStandardJSONSchemaMethod:()=>ae,createToJSONSchemaMethod:()=>La,decode:()=>y,decodeAsync:()=>Ui,describe:()=>mr,encode:()=>fs,encodeAsync:()=>go,extractDefs:()=>Xt,finalize:()=>an,flattenError:()=>No,formatError:()=>oo,globalConfig:()=>Ha,globalRegistry:()=>At,initializeContext:()=>Sn,isValidBase64:()=>Ro,isValidBase64URL:()=>fo,isValidJWT:()=>xa,locales:()=>xd,meta:()=>ot,parse:()=>Yo,parseAsync:()=>Ta,prettifyError:()=>ga,process:()=>Je,regexes:()=>me,registry:()=>Vo,safeDecode:()=>li,safeDecodeAsync:()=>wo,safeEncode:()=>is,safeEncodeAsync:()=>Ei,safeParse:()=>Za,safeParseAsync:()=>xs,toDotPath:()=>sa,toJSONSchema:()=>Ka,treeifyError:()=>ti,util:()=>Un,version:()=>fa}),Td=r({endsWith:()=>as,gt:()=>$i,gte:()=>Po,includes:()=>_a,length:()=>Ua,lowercase:()=>Pa,lt:()=>qt,lte:()=>tn,maxLength:()=>ht,maxSize:()=>zt,mime:()=>Fn,minLength:()=>uc,minSize:()=>ue,multipleOf:()=>hr,negative:()=>$e,nonnegative:()=>Ho,nonpositive:()=>zr,normalize:()=>jr,overwrite:()=>ds,positive:()=>Jo,property:()=>ci,regex:()=>Xa,size:()=>Pi,slugify:()=>Zi,startsWith:()=>Mo,toLowerCase:()=>qs,toUpperCase:()=>Hn,trim:()=>Rs,uppercase:()=>Kt});const Ed={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`};function Dd(e){un({customError:e})}function Od(){return un().customError}var kd;kd||={};const w={...dc,...Td,iso:je},Ad=new Set(`$schema.$ref.$defs.definitions.$id.id.$comment.$anchor.$vocabulary.$dynamicRef.$dynamicAnchor.type.enum.const.anyOf.oneOf.allOf.not.properties.required.additionalProperties.patternProperties.propertyNames.minProperties.maxProperties.items.prefixItems.additionalItems.minItems.maxItems.uniqueItems.contains.minContains.maxContains.minLength.maxLength.pattern.format.minimum.maximum.exclusiveMinimum.exclusiveMaximum.multipleOf.description.default.contentEncoding.contentMediaType.contentSchema.unevaluatedItems.unevaluatedProperties.if.then.else.dependentSchemas.dependentRequired.nullable.readOnly`.split(`.`));function jd(e,t){let n=e.$schema;return n===`https://json-schema.org/draft/2020-12/schema`?`draft-2020-12`:n===`http://json-schema.org/draft-07/schema#`?`draft-7`:n===`http://json-schema.org/draft-04/schema#`?`draft-4`:t??`draft-2020-12`}function Md(e,t){if(!e.startsWith(`#`))throw Error(`External $ref is not supported, only local refs (#/...) are allowed`);let n=e.slice(1).split(`/`).filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version===`draft-2020-12`?`$defs`:`definitions`;if(n[0]===r){let r=n[1];if(!r||!t.defs[r])throw Error(`Reference not found: ${e}`);return t.defs[r]}throw Error(`Reference not found: ${e}`)}function Nd(e,t){if(e.not!==void 0){if(typeof e.not==`object`&&Object.keys(e.not).length===0)return w.never();throw Error(`not is not supported in Zod (except { not: {} } for never)`)}if(e.unevaluatedItems!==void 0)throw Error(`unevaluatedItems is not supported`);if(e.unevaluatedProperties!==void 0)throw Error(`unevaluatedProperties is not supported`);if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error(`Conditional schemas (if/then/else) are not supported`);if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error(`dependentSchemas and dependentRequired are not supported`);if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return w.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let r=Pd(Md(n,t),t);return t.refs.set(n,r),t.processing.delete(n),r}if(e.enum!==void 0){let n=e.enum;if(t.version===`openapi-3.0`&&e.nullable===!0&&n.length===1&&n[0]===null)return w.null();if(n.length===0)return w.never();if(n.length===1)return w.literal(n[0]);if(n.every(e=>typeof e==`string`))return w.enum(n);let r=n.map(e=>w.literal(e));return r.length<2?r[0]:w.union([r[0],r[1],...r.slice(2)])}if(e.const!==void 0)return w.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(n=>Nd({...e,type:n},t));return r.length===0?w.never():r.length===1?r[0]:w.union(r)}if(!n)return w.any();let r;switch(n){case`string`:{let t=w.string();if(e.format){let n=e.format;n===`email`?t=t.check(w.email()):n===`uri`||n===`uri-reference`?t=t.check(w.url()):n===`uuid`||n===`guid`?t=t.check(w.uuid()):n===`date-time`?t=t.check(w.iso.datetime()):n===`date`?t=t.check(w.iso.date()):n===`time`?t=t.check(w.iso.time()):n===`duration`?t=t.check(w.iso.duration()):n===`ipv4`?t=t.check(w.ipv4()):n===`ipv6`?t=t.check(w.ipv6()):n===`mac`?t=t.check(w.mac()):n===`cidr`?t=t.check(w.cidrv4()):n===`cidr-v6`?t=t.check(w.cidrv6()):n===`base64`?t=t.check(w.base64()):n===`base64url`?t=t.check(w.base64url()):n===`e164`?t=t.check(w.e164()):n===`jwt`?t=t.check(w.jwt()):n===`emoji`?t=t.check(w.emoji()):n===`nanoid`?t=t.check(w.nanoid()):n===`cuid`?t=t.check(w.cuid()):n===`cuid2`?t=t.check(w.cuid2()):n===`ulid`?t=t.check(w.ulid()):n===`xid`?t=t.check(w.xid()):n===`ksuid`&&(t=t.check(w.ksuid()))}typeof e.minLength==`number`&&(t=t.min(e.minLength)),typeof e.maxLength==`number`&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),r=t;break}case`number`:case`integer`:{let t=n===`integer`?w.number().int():w.number();typeof e.minimum==`number`&&(t=t.min(e.minimum)),typeof e.maximum==`number`&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum==`number`?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum==`number`&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum==`number`?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum==`number`&&(t=t.lt(e.maximum)),typeof e.multipleOf==`number`&&(t=t.multipleOf(e.multipleOf)),r=t;break}case`boolean`:r=w.boolean();break;case`null`:r=w.null();break;case`object`:{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[e,r]of Object.entries(i)){let i=Pd(r,t);n[e]=a.has(e)?i:i.optional()}if(e.propertyNames){let i=Pd(e.propertyNames,t),a=e.additionalProperties&&typeof e.additionalProperties==`object`?Pd(e.additionalProperties,t):w.any();if(Object.keys(n).length===0){r=w.record(i,a);break}let o=w.object(n).passthrough(),s=w.looseRecord(i,a);r=w.intersection(o,s);break}if(e.patternProperties){let i=e.patternProperties,a=Object.keys(i),o=[];for(let e of a){let n=Pd(i[e],t),r=w.string().regex(new RegExp(e));o.push(w.looseRecord(r,n))}let s=[];if(Object.keys(n).length>0&&s.push(w.object(n).passthrough()),s.push(...o),s.length===0)r=w.object({}).passthrough();else if(s.length===1)r=s[0];else{let e=w.intersection(s[0],s[1]);for(let t=2;t<s.length;t++)e=w.intersection(e,s[t]);r=e}break}let o=w.object(n);r=e.additionalProperties===!1?o.strict():typeof e.additionalProperties==`object`?o.catchall(Pd(e.additionalProperties,t)):o.passthrough();break}case`array`:{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(e=>Pd(e,t)),o=i&&typeof i==`object`&&!Array.isArray(i)?Pd(i,t):void 0;r=o?w.tuple(a).rest(o):w.tuple(a),typeof e.minItems==`number`&&(r=r.check(w.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(w.maxLength(e.maxItems)))}else if(Array.isArray(i)){let n=i.map(e=>Pd(e,t)),a=e.additionalItems&&typeof e.additionalItems==`object`?Pd(e.additionalItems,t):void 0;r=a?w.tuple(n).rest(a):w.tuple(n),typeof e.minItems==`number`&&(r=r.check(w.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(w.maxLength(e.maxItems)))}else if(i!==void 0){let n=Pd(i,t),a=w.array(n);typeof e.minItems==`number`&&(a=a.min(e.minItems)),typeof e.maxItems==`number`&&(a=a.max(e.maxItems)),r=a}else r=w.array(w.any());break}default:throw Error(`Unsupported type: ${n}`)}return e.description&&(r=r.describe(e.description)),e.default!==void 0&&(r=r.default(e.default)),r}function Pd(e,t){if(typeof e==`boolean`)return e?w.any():w.never();let n=Nd(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let i=e.anyOf.map(e=>Pd(e,t)),a=w.union(i);n=r?w.intersection(n,a):a}if(e.oneOf&&Array.isArray(e.oneOf)){let i=e.oneOf.map(e=>Pd(e,t)),a=w.xor(i);n=r?w.intersection(n,a):a}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:w.any();else{let i=r?n:Pd(e.allOf[0],t),a=+!r;for(let n=a;n<e.allOf.length;n++)i=w.intersection(i,Pd(e.allOf[n],t));n=i}e.nullable===!0&&t.version===`openapi-3.0`&&(n=w.nullable(n)),e.readOnly===!0&&(n=w.readonly(n));let i={};for(let t of[`$id`,`id`,`$comment`,`$anchor`,`$vocabulary`,`$dynamicRef`,`$dynamicAnchor`])t in e&&(i[t]=e[t]);for(let t of[`contentEncoding`,`contentMediaType`,`contentSchema`])t in e&&(i[t]=e[t]);for(let t of Object.keys(e))Ad.has(t)||(i[t]=e[t]);return Object.keys(i).length>0&&t.registry.add(n,i),n}function Fd(e,t){return typeof e==`boolean`?e?w.any():w.never():Pd(e,{version:jd(e,t?.defaultTarget),defs:e.$defs||e.definitions||{},refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??At})}var Id=r({$brand:()=>Qn,$input:()=>Sr,$output:()=>Qe,NEVER:()=>De,TimePrecision:()=>vt,ZodAny:()=>ns,ZodArray:()=>wi,ZodBase64:()=>Ya,ZodBase64URL:()=>ys,ZodBigInt:()=>Ni,ZodBigIntFormat:()=>Xi,ZodBoolean:()=>jo,ZodCIDRv4:()=>io,ZodCIDRv6:()=>ma,ZodCUID:()=>aa,ZodCUID2:()=>$r,ZodCatch:()=>Os,ZodCodec:()=>ec,ZodCustom:()=>gi,ZodCustomStringFormat:()=>Ks,ZodDate:()=>Vn,ZodDefault:()=>ge,ZodDiscriminatedUnion:()=>Ls,ZodE164:()=>Xn,ZodEmail:()=>Pe,ZodEmoji:()=>Te,ZodEnum:()=>cn,ZodError:()=>Zs,ZodExactOptional:()=>Ba,ZodFile:()=>ee,ZodFirstPartyTypeKind:()=>kd,ZodFunction:()=>Ma,ZodGUID:()=>Gt,ZodIPv4:()=>$t,ZodIPv6:()=>_n,ZodISODate:()=>Se,ZodISODateTime:()=>Us,ZodISODuration:()=>nr,ZodISOTime:()=>Be,ZodIntersection:()=>Ue,ZodIssueCode:()=>Ed,ZodJWT:()=>pt,ZodKSUID:()=>Lt,ZodLazy:()=>Nn,ZodLiteral:()=>cc,ZodMAC:()=>ce,ZodMap:()=>pr,ZodNaN:()=>at,ZodNanoID:()=>ar,ZodNever:()=>xr,ZodNonOptional:()=>Ze,ZodNull:()=>kt,ZodNullable:()=>Bo,ZodNumber:()=>xt,ZodNumberFormat:()=>Lr,ZodObject:()=>kr,ZodOptional:()=>Gr,ZodPipe:()=>Tn,ZodPrefault:()=>p,ZodPromise:()=>Yi,ZodReadonly:()=>vs,ZodRealError:()=>qn,ZodRecord:()=>So,ZodSet:()=>ts,ZodString:()=>ja,ZodStringFormat:()=>hi,ZodSuccess:()=>Ao,ZodSymbol:()=>us,ZodTemplateLiteral:()=>Mi,ZodTransform:()=>ro,ZodTuple:()=>Ds,ZodType:()=>Vi,ZodULID:()=>ia,ZodURL:()=>zo,ZodUUID:()=>po,ZodUndefined:()=>Sa,ZodUnion:()=>pa,ZodUnknown:()=>si,ZodVoid:()=>Is,ZodXID:()=>sc,ZodXor:()=>Ci,_ZodString:()=>$s,_default:()=>we,_function:()=>ir,any:()=>se,array:()=>za,base64:()=>Qt,base64url:()=>sn,bigint:()=>wn,boolean:()=>Xe,catch:()=>Yn,check:()=>bt,cidrv4:()=>Wt,cidrv6:()=>Bn,clone:()=>As,codec:()=>hc,coerce:()=>Ca,config:()=>un,core:()=>wd,cuid:()=>he,cuid2:()=>br,custom:()=>ft,date:()=>fr,decode:()=>to,decodeAsync:()=>Ts,describe:()=>Or,discriminatedUnion:()=>it,e164:()=>It,email:()=>qo,emoji:()=>Ot,encode:()=>zi,encodeAsync:()=>na,endsWith:()=>as,enum:()=>Gs,exactOptional:()=>Wr,file:()=>Ir,flattenError:()=>No,float32:()=>Qr,float64:()=>Mn,formatError:()=>oo,fromJSONSchema:()=>Fd,function:()=>ir,getErrorMap:()=>Od,globalRegistry:()=>At,gt:()=>$i,gte:()=>Po,guid:()=>b,hash:()=>Gi,hex:()=>ms,hostname:()=>vo,httpUrl:()=>Zo,includes:()=>_a,instanceof:()=>He,int:()=>Da,int32:()=>di,int64:()=>Eo,intersection:()=>os,ipv4:()=>Oi,ipv6:()=>$a,iso:()=>je,json:()=>Cs,jwt:()=>Li,keyof:()=>ea,ksuid:()=>Fo,lazy:()=>co,length:()=>Ua,literal:()=>va,locales:()=>xd,looseObject:()=>la,looseRecord:()=>ri,lowercase:()=>Pa,lt:()=>qt,lte:()=>tn,mac:()=>Ms,map:()=>rc,maxLength:()=>ht,maxSize:()=>zt,meta:()=>yi,mime:()=>Fn,minLength:()=>uc,minSize:()=>ue,multipleOf:()=>hr,nan:()=>Ys,nanoid:()=>Gn,nativeEnum:()=>be,negative:()=>$e,never:()=>Vs,nonnegative:()=>Ho,nonoptional:()=>er,nonpositive:()=>zr,normalize:()=>jr,null:()=>Ne,nullable:()=>Re,nullish:()=>ke,number:()=>fn,object:()=>Wa,optional:()=>re,overwrite:()=>ds,parse:()=>Lo,parseAsync:()=>uo,partialRecord:()=>Fa,pipe:()=>Jt,positive:()=>Jo,prefault:()=>nn,preprocess:()=>bn,prettifyError:()=>ga,promise:()=>Ke,property:()=>ci,readonly:()=>gt,record:()=>Bt,refine:()=>In,regex:()=>Xa,regexes:()=>me,registry:()=>Vo,safeDecode:()=>ba,safeDecodeAsync:()=>da,safeEncode:()=>ai,safeEncodeAsync:()=>Ps,safeParse:()=>ac,safeParseAsync:()=>xi,set:()=>de,setErrorMap:()=>Dd,size:()=>Pi,slugify:()=>Zi,startsWith:()=>Mo,strictObject:()=>gr,string:()=>ct,stringFormat:()=>cr,stringbool:()=>wr,success:()=>et,superRefine:()=>Mt,symbol:()=>Uo,templateLiteral:()=>wt,toJSONSchema:()=>Ka,toLowerCase:()=>qs,toUpperCase:()=>Hn,transform:()=>Br,treeifyError:()=>ti,trim:()=>Rs,tuple:()=>Mr,uint32:()=>Jr,uint64:()=>On,ulid:()=>g,undefined:()=>gn,union:()=>qi,unknown:()=>gs,uppercase:()=>Kt,url:()=>bo,util:()=>Un,uuid:()=>$o,uuidv4:()=>ka,uuidv6:()=>pi,uuidv7:()=>Oo,void:()=>Ja,xid:()=>cs,xor:()=>Ai});un(Gl());var Ld=Id;const Rd=new Set;function zd(e,t){Rd.has(e)||(Rd.add(e),console.warn(`[workflow] ${t}`))}function Bd(e,t,n={}){let r=process.env[e];if(r===void 0||r===``)return t;let{min:i=0,max:a,integer:o=!1}=n,s=Number(r);return!Number.isFinite(s)||o&&!Number.isInteger(s)?(zd(`${e}=${r}`,`Ignoring ${e}: not a ${o?`finite integer`:`finite number`}; using default ${t}`),t):s<i?(zd(`${e}=${r}`,`${e} below minimum ${i}; clamped`),i):a!==void 0&&s>a?(zd(`${e}=${r}`,`${e} above maximum ${a}; clamped`),a):s}var Vd=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{SYMBOL_FOR_REQ_CONTEXT:()=>u,getContext:()=>d}),t.exports=c(l);let u=Symbol.for(`@vercel/request-context`);function d(){return globalThis[u]?.get?.()??{}}0&&(t.exports={SYMBOL_FOR_REQ_CONTEXT:u,getContext:d})})),Hd=i(((e,t)=>{var r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},c=(e,t,n,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(r({},`__esModule`,{value:!0}),e),u={};s(u,{getVercelOidcToken:()=>p,getVercelOidcTokenSync:()=>m}),t.exports=l(u);var d=Vd(),f=Uc();async function p(e){let t=``,r;try{t=m()}catch(e){r=e}try{let[{getTokenPayload:r,isExpired:i},{refreshToken:a}]=await Promise.all([await import(`../../_chunks/workflow/token-util-Ldar52H7.js`).then(e=>n(e.t())),await import(`../../_chunks/workflow/token-DHD-q-fS.js`).then(e=>n(e.default))]);(!t||i(r(t),e?.expirationBufferMs))&&(await a(e),t=m())}catch(e){let t=r instanceof Error?r.message:``;throw e instanceof Error&&(t=`${t}
2
+ ${e.message}`),t?new f.VercelOidcTokenError(t):e}return t}function m(){let e=(0,d.getContext)().headers?.[`x-vercel-oidc-token`]??process.env.VERCEL_OIDC_TOKEN;if(!e)throw Error(`The 'x-vercel-oidc-token' header is missing from the request. Do you have the OIDC option enabled in the Vercel project settings?`);return e}0&&(t.exports={getVercelOidcToken:p,getVercelOidcTokenSync:m})})),Ud=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{AccessTokenMissingError:()=>f.AccessTokenMissingError,RefreshAccessTokenFailedError:()=>f.RefreshAccessTokenFailedError,getContext:()=>d.getContext,getVercelOidcToken:()=>u.getVercelOidcToken,getVercelOidcTokenSync:()=>u.getVercelOidcTokenSync,getVercelToken:()=>p.getVercelToken}),t.exports=c(l);var u=Hd(),d=Vd(),f=Hc(),p=Wc();0&&(t.exports={AccessTokenMissingError,RefreshAccessTokenFailedError,getContext,getVercelOidcToken,getVercelOidcTokenSync,getVercelToken})}))();let Wd;try{Wd=new TextDecoder}catch{}let T,Gd,E=0;const Kd=[],qd=57337,Jd={};let Yd=11281e4,Xd=1681e4,Zd=Kd,Qd=0,D={},O,$d,ef=0,tf=0,k,nf,A=[],rf=[],af,of,sf,cf={useRecords:!1,mapsAsObjects:!0},lf=!1,uf=2;try{Function(``)}catch{uf=1/0}var df=class e{constructor(e){if(e&&((e.keyMap||e._keyMap)&&!e.useRecords&&(e.useRecords=!1,e.mapsAsObjects=!0),e.useRecords===!1&&e.mapsAsObjects===void 0&&(e.mapsAsObjects=!0),e.getStructures&&(e.getShared=e.getStructures),e.getShared&&!e.structures&&((e.structures=[]).uninitialized=!0),e.keyMap)){this.mapKey=new Map;for(let[t,n]of Object.entries(e.keyMap))this.mapKey.set(n,t)}Object.assign(this,e)}decodeKey(e){return this.keyMap&&this.mapKey.get(e)||e}encodeKey(e){return this.keyMap&&this.keyMap.hasOwnProperty(e)?this.keyMap[e]:e}encodeKeys(e){if(!this._keyMap)return e;let t=new Map;for(let[n,r]of Object.entries(e))t.set(this._keyMap.hasOwnProperty(n)?this._keyMap[n]:n,r);return t}decodeKeys(e){if(!this._keyMap||e.constructor.name!=`Map`)return e;if(!this._mapKey){this._mapKey=new Map;for(let[e,t]of Object.entries(this._keyMap))this._mapKey.set(t,e)}let t={};return e.forEach((e,n)=>t[hf(this._mapKey.has(n)?this._mapKey.get(n):n)]=e),t}mapDecode(e,t){let n=this.decode(e);if(this._keyMap)switch(n.constructor.name){case`Array`:return n.map(e=>this.decodeKeys(e))}return n}decode(t,n){if(T)return Rf(()=>(zf(),this?this.decode(t,n):e.prototype.decode.call(cf,t,n)));Gd=n>-1?n:t.length,E=0,Qd=0,tf=0,$d=null,Zd=Kd,k=null,T=t;try{of=t.dataView||=new DataView(t.buffer,t.byteOffset,t.byteLength)}catch(e){throw T=null,t instanceof Uint8Array?e:Error(`Source must be a Uint8Array or Buffer but was a `+(t&&typeof t==`object`?t.constructor.name:typeof t))}if(this instanceof e){if(D=this,af=this.sharedValues&&(this.pack?Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this.structures)return O=this.structures,ff();(!O||O.length>0)&&(O=[])}else D=cf,(!O||O.length>0)&&(O=[]),af=null;return ff()}decodeMultiple(e,t){let n,r=0;try{let i=e.length;lf=!0;let a=this?this.decode(e,i):Vf.decode(e,i);if(t){if(t(a)===!1)return;for(;E<i;)if(r=E,t(ff())===!1)return}else{for(n=[a];E<i;)r=E,n.push(ff());return n}}catch(e){throw e.lastPosition=r,e.values=n,e}finally{lf=!1,zf()}}};function ff(){try{let e=j();if(k){if(E>=k.postBundlePosition){let e=Error(`Unexpected bundle position`);throw e.incomplete=!0,e}E=k.postBundlePosition,k=null}if(E==Gd)O=null,T=null,nf&&=null;else if(E>Gd){let e=Error(`Unexpected end of CBOR data`);throw e.incomplete=!0,e}else if(!lf)throw Error(`Data read, but end of buffer not reached`);return e}catch(e){throw zf(),(e instanceof RangeError||e.message.startsWith(`Unexpected end of buffer`))&&(e.incomplete=!0),e}}function j(){let e=T[E++],t=e>>5;if(e&=31,e>23)switch(e){case 24:e=T[E++];break;case 25:if(t==7)return wf();e=of.getUint16(E),E+=2;break;case 26:if(t==7){let e=of.getFloat32(E);if(D.useFloat32>2){let t=Bf[(T[E]&127)<<1|T[E+1]>>7];return E+=4,(t*e+(e>0?.5:-.5)>>0)/t}return E+=4,e}e=of.getUint32(E),E+=4;break;case 27:if(t==7){let e=of.getFloat64(E);return E+=8,e}if(t>1){if(of.getUint32(E)>0)throw Error(`JavaScript does not support arrays, maps, or strings with length over 4294967295`);e=of.getUint32(E+4)}else D.int64AsNumber?(e=of.getUint32(E)*4294967296,e+=of.getUint32(E+4)):e=of.getBigUint64(E);E+=8;break;case 31:switch(t){case 2:case 3:throw Error(`Indefinite length not supported for byte or text strings`);case 4:let e=[],n,r=0;for(;(n=j())!=Jd;){if(r>=Yd)throw Error(`Array length exceeds ${Yd}`);e[r++]=n}return t==4?e:t==3?e.join(``):Buffer.concat(e);case 5:let i;if(D.mapsAsObjects){let e={},t=0;if(D.keyMap)for(;(i=j())!=Jd;){if(t++>=Xd)throw Error(`Property count exceeds ${Xd}`);e[hf(D.decodeKey(i))]=j()}else for(;(i=j())!=Jd;){if(t++>=Xd)throw Error(`Property count exceeds ${Xd}`);e[hf(i)]=j()}return e}else{sf&&=(D.mapsAsObjects=!0,!1);let e=new Map;if(D.keyMap){let t=0;for(;(i=j())!=Jd;){if(t++>=Xd)throw Error(`Map size exceeds ${Xd}`);e.set(D.decodeKey(i),j())}}else{let t=0;for(;(i=j())!=Jd;){if(t++>=Xd)throw Error(`Map size exceeds ${Xd}`);e.set(i,j())}}return e}case 7:return Jd;default:throw Error(`Invalid major type for indefinite length `+t)}default:throw Error(`Unknown token `+e)}switch(t){case 0:return e;case 1:return~e;case 2:return xf(e);case 3:if(tf>=E)return $d.slice(E-ef,(E+=e)-ef);if(tf==0&&Gd<140&&e<32){let t=e<16?bf(e):yf(e);if(t!=null)return t}return gf(e);case 4:if(e>=Yd)throw Error(`Array length exceeds ${Yd}`);let t=Array(e);for(let n=0;n<e;n++)t[n]=j();return t;case 5:if(e>=Xd)throw Error(`Map size exceeds ${Yd}`);if(D.mapsAsObjects){let t={};if(D.keyMap)for(let n=0;n<e;n++)t[hf(D.decodeKey(j()))]=j();else for(let n=0;n<e;n++)t[hf(j())]=j();return t}else{sf&&=(D.mapsAsObjects=!0,!1);let t=new Map;if(D.keyMap)for(let n=0;n<e;n++)t.set(D.decodeKey(j()),j());else for(let n=0;n<e;n++)t.set(j(),j());return t}case 6:if(e>=qd){let t=O[e&8191];if(t)return t.read||=mf(t),t.read();if(e<65536){if(e==57343){let e=If(),t=j(),n=j();Ef(t,n);let r={};if(D.keyMap)for(let t=2;t<e;t++){let e=D.decodeKey(n[t-2]);r[hf(e)]=j()}else for(let t=2;t<e;t++){let e=n[t-2];r[hf(e)]=j()}return r}else if(e==57342){let e=If(),t=j();for(let n=2;n<e;n++)Ef(t++,j());return j()}else if(e==qd)return Ff();if(D.getShared&&(Lf(),t=O[e&8191],t))return t.read||=mf(t),t.read()}}let n=A[e];if(n)return n.handlesRead?n(j):n(j());{let t=j();for(let n=0;n<rf.length;n++){let r=rf[n](e,t);if(r!==void 0)return r}return new Tf(t,e)}case 7:switch(e){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;default:let t=(af||Af())[e];if(t!==void 0)return t;throw Error(`Unknown token `+e)}default:if(isNaN(e)){let e=Error(`Unexpected end of CBOR data`);throw e.incomplete=!0,e}throw Error(`Unknown CBOR token `+e)}}const pf=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function mf(e){if(!e)throw Error(`Structure is required in record definition`);function t(){let e=T[E++];if(e&=31,e>23)switch(e){case 24:e=T[E++];break;case 25:e=of.getUint16(E),E+=2;break;case 26:e=of.getUint32(E),E+=4;break;default:throw Error(`Expected array header, but got `+T[E-1])}let t=this.compiledReader;for(;t;){if(t.propertyCount===e)return t(j);t=t.next}if(this.slowReads++>=uf){let n=this.length==e?this:this.slice(0,e);return t=D.keyMap?Function(`r`,`return {`+n.map(e=>D.decodeKey(e)).map(e=>pf.test(e)?hf(e)+`:r()`:`[`+JSON.stringify(e)+`]:r()`).join(`,`)+`}`):Function(`r`,`return {`+n.map(e=>pf.test(e)?hf(e)+`:r()`:`[`+JSON.stringify(e)+`]:r()`).join(`,`)+`}`),this.compiledReader&&(t.next=this.compiledReader),t.propertyCount=e,this.compiledReader=t,t(j)}let n={};if(D.keyMap)for(let t=0;t<e;t++)n[hf(D.decodeKey(this[t]))]=j();else for(let t=0;t<e;t++)n[hf(this[t])]=j();return n}return e.slowReads=0,t}function hf(e){if(typeof e==`string`)return e===`__proto__`?`__proto_`:e;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return e.toString();if(e==null)return e+``;throw Error(`Invalid property name type `+typeof e)}let gf=vf;function _f(e){gf=t(1);function t(t){return function(t){let n=Zd[Qd++];if(n==null){if(k)return vf(t);let r=e(E,Gd,t,T);if(typeof r==`string`)n=r,Zd=Kd;else if(Zd=r,Qd=1,tf=1,n=Zd[0],n===void 0)throw Error(`Unexpected end of buffer`)}let r=n.length;return r<=t?(E+=t,n):($d=n,ef=E,tf=E+r,E+=t,n.slice(0,t))}}}function vf(e){let t;if(e<16&&(t=bf(e)))return t;if(e>64&&Wd)return Wd.decode(T.subarray(E,E+=e));let n=E+e,r=[];for(t=``;E<n;){let e=T[E++];if(!(e&128))r.push(e);else if((e&224)==192){let t=T[E++]&63;r.push((e&31)<<6|t)}else if((e&240)==224){let t=T[E++]&63,n=T[E++]&63;r.push((e&31)<<12|t<<6|n)}else if((e&248)==240){let t=T[E++]&63,n=T[E++]&63,i=T[E++]&63,a=(e&7)<<18|t<<12|n<<6|i;a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a)}else r.push(e);r.length>=4096&&(t+=M.apply(String,r),r.length=0)}return r.length>0&&(t+=M.apply(String,r)),t}let M=String.fromCharCode;function yf(e){let t=E,n=Array(e);for(let r=0;r<e;r++){let e=T[E++];if((e&128)>0){E=t;return}n[r]=e}return M.apply(String,n)}function bf(e){if(e<4)if(e<2){if(e===0)return``;{let e=T[E++];if((e&128)>1){--E;return}return M(e)}}else{let t=T[E++],n=T[E++];if((t&128)>0||(n&128)>0){E-=2;return}if(e<3)return M(t,n);let r=T[E++];if((r&128)>0){E-=3;return}return M(t,n,r)}else{let t=T[E++],n=T[E++],r=T[E++],i=T[E++];if((t&128)>0||(n&128)>0||(r&128)>0||(i&128)>0){E-=4;return}if(e<6){if(e===4)return M(t,n,r,i);{let e=T[E++];if((e&128)>0){E-=5;return}return M(t,n,r,i,e)}}else if(e<8){let a=T[E++],o=T[E++];if((a&128)>0||(o&128)>0){E-=6;return}if(e<7)return M(t,n,r,i,a,o);let s=T[E++];if((s&128)>0){E-=7;return}return M(t,n,r,i,a,o,s)}else{let a=T[E++],o=T[E++],s=T[E++],c=T[E++];if((a&128)>0||(o&128)>0||(s&128)>0||(c&128)>0){E-=8;return}if(e<10){if(e===8)return M(t,n,r,i,a,o,s,c);{let e=T[E++];if((e&128)>0){E-=9;return}return M(t,n,r,i,a,o,s,c,e)}}else if(e<12){let l=T[E++],u=T[E++];if((l&128)>0||(u&128)>0){E-=10;return}if(e<11)return M(t,n,r,i,a,o,s,c,l,u);let d=T[E++];if((d&128)>0){E-=11;return}return M(t,n,r,i,a,o,s,c,l,u,d)}else{let l=T[E++],u=T[E++],d=T[E++],f=T[E++];if((l&128)>0||(u&128)>0||(d&128)>0||(f&128)>0){E-=12;return}if(e<14){if(e===12)return M(t,n,r,i,a,o,s,c,l,u,d,f);{let e=T[E++];if((e&128)>0){E-=13;return}return M(t,n,r,i,a,o,s,c,l,u,d,f,e)}}else{let p=T[E++],m=T[E++];if((p&128)>0||(m&128)>0){E-=14;return}if(e<15)return M(t,n,r,i,a,o,s,c,l,u,d,f,p,m);let h=T[E++];if((h&128)>0){E-=15;return}return M(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}}}}}function xf(e){return D.copyBuffers?Uint8Array.prototype.slice.call(T,E,E+=e):T.subarray(E,E+=e)}let Sf=new Float32Array(1),Cf=new Uint8Array(Sf.buffer,0,4);function wf(){let e=T[E++],t=T[E++],n=(e&127)>>2;if(n===31)return t||e&3?NaN:e&128?-1/0:1/0;if(n===0){let n=((e&3)<<8|t)/(1<<24);return e&128?-n:n}return Cf[3]=e&128|(n>>1)+56,Cf[2]=(e&7)<<5|t>>3,Cf[1]=t<<5,Cf[0]=0,Sf[0]}Array(4096);var Tf=class{constructor(e,t){this.value=e,this.tag=t}};A[0]=e=>new Date(e),A[1]=e=>new Date(Math.round(e*1e3)),A[2]=e=>{let t=BigInt(0);for(let n=0,r=e.byteLength;n<r;n++)t=BigInt(e[n])+(t<<BigInt(8));return t},A[3]=e=>BigInt(-1)-A[2](e),A[4]=e=>+(e[1]+`e`+e[0]),A[5]=e=>e[1]*Math.exp(e[0]*Math.log(2));const Ef=(e,t)=>{e-=57344;let n=O[e];n&&n.isShared&&((O.restoreStructures||=[])[e]=n),O[e]=t,t.read=mf(t)};A[105]=e=>{let t=e.length,n=e[1];Ef(e[0],n);let r={};for(let i=2;i<t;i++){let t=n[i-2];r[hf(t)]=e[i]}return r},A[14]=e=>k?k[0].slice(k.position0,k.position0+=e):new Tf(e,14),A[15]=e=>k?k[1].slice(k.position1,k.position1+=e):new Tf(e,15);let Df={Error,RegExp};A[27]=e=>(Df[e[0]]||Error)(e[1],e[2]);const Of=e=>{if(T[E++]!=132){let e=Error(`Packed values structure must be followed by a 4 element array`);throw T.length<E&&(e.incomplete=!0),e}let t=e();if(!t||!t.length){let e=Error(`Packed values structure must be followed by a 4 element array`);throw e.incomplete=!0,e}return af=af?t.concat(af.slice(t.length)):t,af.prefixes=e(),af.suffixes=e(),e()};Of.handlesRead=!0,A[51]=Of,A[6]=e=>{if(!af)if(D.getShared)Lf();else return new Tf(e,6);if(typeof e==`number`)return af[16+(e>=0?2*e:-2*e-1)];let t=Error(`No support for non-integer packed references yet`);throw e===void 0&&(t.incomplete=!0),t},A[28]=e=>{nf||(nf=new Map,nf.id=0);let t=nf.id++,n=E,r=T[E],i;i=r>>5==4?[]:{};let a={target:i};nf.set(t,a);let o=e();return a.used?(Object.getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(E=n,i=o,nf.set(t,{target:i}),o=e()),Object.assign(i,o)):(a.target=o,o)},A[28].handlesRead=!0,A[29]=e=>{let t=nf.get(e);return t.used=!0,t.target},A[258]=e=>new Set(e),(A[259]=e=>(D.mapsAsObjects&&(D.mapsAsObjects=!1,sf=!0),e())).handlesRead=!0;function kf(e,t){return typeof e==`string`?e+t:e instanceof Array?e.concat(t):Object.assign({},e,t)}function Af(){if(!af)if(D.getShared)Lf();else throw Error(`No packed values available`);return af}rf.push((e,t)=>{if(e>=225&&e<=255)return kf(Af().prefixes[e-224],t);if(e>=28704&&e<=32767)return kf(Af().prefixes[e-28672],t);if(e>=1879052288&&e<=2147483647)return kf(Af().prefixes[e-1879048192],t);if(e>=216&&e<=223)return kf(t,Af().suffixes[e-216]);if(e>=27647&&e<=28671)return kf(t,Af().suffixes[e-27639]);if(e>=1811940352&&e<=1879048191)return kf(t,Af().suffixes[e-1811939328]);if(e==1399353956)return{packedValues:af,structures:O.slice(0),version:t};if(e==55799)return t});const jf=new Uint8Array(new Uint16Array([1]).buffer)[0]==1,Mf=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array>`u`?{name:`BigUint64Array`}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>`u`?{name:`BigInt64Array`}:BigInt64Array,Float32Array,Float64Array],Nf=[64,68,69,70,71,72,77,78,79,85,86];for(let e=0;e<Mf.length;e++)Pf(Mf[e],Nf[e]);function Pf(e,t){let n=`get`+e.name.slice(0,-5),r;typeof e==`function`?r=e.BYTES_PER_ELEMENT:e=null;for(let i=0;i<2;i++){if(!i&&r==1)continue;let a=r==2?1:r==4?2:r==8?3:0;A[i?t:t-4]=r==1||i==jf?n=>{if(!e)throw Error(`Could not find typed array for code `+t);return!D.copyBuffers&&(r===1||r===2&&!(n.byteOffset&1)||r===4&&!(n.byteOffset&3)||r===8&&!(n.byteOffset&7))?new e(n.buffer,n.byteOffset,n.byteLength>>a):new e(Uint8Array.prototype.slice.call(n,0).buffer)}:r=>{if(!e)throw Error(`Could not find typed array for code `+t);let o=new DataView(r.buffer,r.byteOffset,r.byteLength),s=r.length>>a,c=new e(s),l=o[n];for(let e=0;e<s;e++)c[e]=l.call(o,e<<a,i);return c}}}function Ff(){let e=If(),t=E+j();for(let t=2;t<e;t++){let e=If();E+=e}let n=E;return E=t,k=[vf(If()),vf(If())],k.position0=0,k.position1=0,k.postBundlePosition=E,E=n,j()}function If(){let e=T[E++]&31;if(e>23)switch(e){case 24:e=T[E++];break;case 25:e=of.getUint16(E),E+=2;break;case 26:e=of.getUint32(E),E+=4;break}return e}function Lf(){if(D.getShared){let e=Rf(()=>(T=null,D.getShared()))||{},t=e.structures||[];D.sharedVersion=e.version,af=D.sharedValues=e.packedValues,O===!0?D.structures=O=t:O.splice.apply(O,[0,t.length].concat(t))}}function Rf(e){let t=Gd,n=E,r=Qd,i=ef,a=tf,o=$d,s=Zd,c=nf,l=k,u=new Uint8Array(T.slice(0,Gd)),d=O,f=D,p=lf,m=e();return Gd=t,E=n,Qd=r,ef=i,tf=a,$d=o,Zd=s,nf=c,k=l,T=u,lf=p,O=d,D=f,of=new DataView(T.buffer,T.byteOffset,T.byteLength),m}function zf(){T=null,nf=null,O=null}const Bf=Array(147);for(let e=0;e<256;e++)Bf[e]=+(`1e`+Math.floor(45.15-e*.30103));let Vf=new df({useRecords:!1});const Hf=Vf.decode;Vf.decodeMultiple;const Uf={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};let Wf;try{Wf=new TextEncoder}catch{}let Gf,Kf;const qf=typeof globalThis==`object`&&globalThis.Buffer,Jf=qf!==void 0,Yf=Jf?qf.allocUnsafeSlow:Uint8Array,Xf=Jf?qf:Uint8Array,Zf=Jf?4294967296:2144337920;let Qf,N,P,F=0,$f,I=null;const ep=/[\u0080-\uFFFF]/,tp=Symbol(`record-id`);var np=class extends df{constructor(e){super(e),this.offset=0;let t,n,r,i,a;e||={};let o=Xf.prototype.utf8Write?function(e,t,n){return N.utf8Write(e,t,n)}:Wf&&Wf.encodeInto?function(e,t){return Wf.encodeInto(e,N.subarray(t)).written}:!1,s=this,c=e.structures||e.saveStructures,l=e.maxSharedStructures;if(l??=c?128:0,l>8190)throw Error(`Maximum maxSharedStructure is 8190`);let u=e.sequential;u&&(l=0),this.structures||=[],this.saveStructures&&(this.saveShared=this.saveStructures);let d,f,p=e.sharedValues,m;if(p){m=Object.create(null);for(let e=0,t=p.length;e<t;e++)m[p[e]]=e}let h=[],g=0,_=0;this.mapEncode=function(e,t){if(this._keyMap&&!this._mapped)switch(e.constructor.name){case`Array`:e=e.map(e=>this.encodeKeys(e));break}return this.encode(e,t)},this.encode=function(o,c){if(N||(N=new Yf(8192),P=new DataView(N.buffer,0,8192),F=0),$f=N.length-10,$f-F<2048?(N=new Yf(N.length),P=new DataView(N.buffer,0,N.length),$f=N.length-10,F=0):c===512&&(F=F+7&2147483640),t=F,s.useSelfDescribedHeader&&(P.setUint32(F,3654940416),F+=3),a=s.structuredClone?new Map:null,s.bundleStrings&&typeof o!=`string`?(I=[],I.size=1/0):I=null,n=s.structures,n){if(n.uninitialized){let e=s.getShared()||{};s.structures=n=e.structures||[],s.sharedVersion=e.version;let t=s.sharedValues=e.packedValues;if(t){m={};for(let e=0,n=t.length;e<n;e++)m[t[e]]=e}}let e=n.length;if(e>l&&!u&&(e=l),!n.transitions){n.transitions=Object.create(null);for(let t=0;t<e;t++){let e=n[t];if(!e)continue;let r,i=n.transitions;for(let n=0,a=e.length;n<a;n++){i[tp]===void 0&&(i[tp]=t);let a=e[n];r=i[a],r||=i[a]=Object.create(null),i=r}i[tp]=t|1048576}}u||(n.nextId=e)}if(r&&=!1,i=n||[],f=m,e.pack){let t=new Map;if(t.values=[],t.encoder=s,t.maxValues=e.maxPrivatePackedValues||(m?16:1/0),t.objectMap=m||!1,t.samplingPackedValues=d,cp(o,t),t.values.length>0){N[F++]=216,N[F++]=51,ap(4);let e=t.values;v(e),ap(0),ap(0),f=Object.create(m||null);for(let t=0,n=e.length;t<n;t++)f[e[t]]=t}}Qf=c&bp;try{if(Qf)return;if(v(o),I&&pp(t,v),s.offset=F,a&&a.idsToInsert){F+=a.idsToInsert.length*2,F>$f&&b(F),s.offset=F;let e=fp(N.subarray(t,F),a.idsToInsert);return a=null,e}return c&512?(N.start=t,N.end=F,N):N.subarray(t,F)}finally{if(n){if(_<10&&_++,n.length>l&&(n.length=l),g>1e4)n.transitions=null,_=0,g=0,h.length>0&&(h=[]);else if(h.length>0&&!u){for(let e=0,t=h.length;e<t;e++)h[e][tp]=void 0;h=[]}}if(r&&s.saveShared){s.structures.length>l&&(s.structures=s.structures.slice(0,l));let e=N.subarray(t,F);return s.updateSharedData()===!1?s.encode(o):e}c&1024&&(F=t)}},this.findCommonStringsToPack=()=>(d=new Map,m||=Object.create(null),e=>{let t=e&&e.threshold||4,n=this.pack?e.maxPrivatePackedValues||16:0;p||=this.sharedValues=[];for(let[e,i]of d)i.count>t&&(m[e]=n++,p.push(e),r=!0);for(;this.saveShared&&this.updateSharedData()===!1;);d=null});let v=n=>{F>$f&&(N=b(F));var r=typeof n,i;if(r===`string`){if(f){let t=f[n];if(t>=0){t<16?N[F++]=t+224:(N[F++]=198,t&1?v(15-t>>1):v(t-16>>1));return}else if(d&&!e.pack){let e=d.get(n);e?e.count++:d.set(n,{count:1})}}let r=n.length;if(I&&r>=4&&r<1024){if((I.size+=r)>61440){let e,n=(I[0]?I[0].length*3+I[1].length:0)+10;F+n>$f&&(N=b(F+n)),N[F++]=217,N[F++]=223,N[F++]=249,N[F++]=I.position?132:130,N[F++]=26,e=F-t,F+=4,I.position&&pp(t,v),I=[``,``],I.size=0,I.position=e}let e=ep.test(n);I[+!e]+=n,N[F++]=e?206:207,v(r);return}let a;a=r<32?1:r<256?2:r<65536?3:5;let s=r*3;if(F+s>$f&&(N=b(F+s)),r<64||!o){let e,t,o,s=F+a;for(e=0;e<r;e++)t=n.charCodeAt(e),t<128?N[s++]=t:t<2048?(N[s++]=t>>6|192,N[s++]=t&63|128):(t&64512)==55296&&((o=n.charCodeAt(e+1))&64512)==56320?(t=65536+((t&1023)<<10)+(o&1023),e++,N[s++]=t>>18|240,N[s++]=t>>12&63|128,N[s++]=t>>6&63|128,N[s++]=t&63|128):(N[s++]=t>>12|224,N[s++]=t>>6&63|128,N[s++]=t&63|128);i=s-F-a}else i=o(n,F+a,s);i<24?N[F++]=96|i:i<256?(a<2&&N.copyWithin(F+2,F+1,F+1+i),N[F++]=120,N[F++]=i):i<65536?(a<3&&N.copyWithin(F+3,F+2,F+2+i),N[F++]=121,N[F++]=i>>8,N[F++]=i&255):(a<5&&N.copyWithin(F+5,F+3,F+3+i),N[F++]=122,P.setUint32(F,i),F+=4),F+=i}else if(r===`number`)if(!this.alwaysUseFloat&&n>>>0===n)n<24?N[F++]=n:n<256?(N[F++]=24,N[F++]=n):n<65536?(N[F++]=25,N[F++]=n>>8,N[F++]=n&255):(N[F++]=26,P.setUint32(F,n),F+=4);else if(!this.alwaysUseFloat&&n>>0===n)n>=-24?N[F++]=31-n:n>=-256?(N[F++]=56,N[F++]=~n):n>=-65536?(N[F++]=57,P.setUint16(F,~n),F+=2):(N[F++]=58,P.setUint32(F,~n),F+=4);else{let e;if((e=this.useFloat32)>0&&n<4294967296&&n>=-2147483648){N[F++]=250,P.setFloat32(F,n);let t;if(e<4||(t=n*Bf[(N[F]&127)<<1|N[F+1]>>7])>>0===t){F+=4;return}else F--}N[F++]=251,P.setFloat64(F,n),F+=8}else if(r===`object`)if(!n)N[F++]=246;else{if(a){let e=a.get(n);if(e){if(N[F++]=216,N[F++]=29,N[F++]=25,!e.references){let t=a.idsToInsert||=[];e.references=[],t.push(e)}e.references.push(F-t),F+=2;return}else a.set(n,{offset:F-t})}let e=n.constructor;if(e===Object)y(n);else if(e===Array){i=n.length,i<24?N[F++]=128|i:ap(i);for(let e=0;e<i;e++)v(n[e])}else if(e===Map)if((this.mapsAsObjects?this.useTag259ForMaps!==!1:this.useTag259ForMaps)&&(N[F++]=217,N[F++]=1,N[F++]=3),i=n.size,i<24?N[F++]=160|i:i<256?(N[F++]=184,N[F++]=i):i<65536?(N[F++]=185,N[F++]=i>>8,N[F++]=i&255):(N[F++]=186,P.setUint32(F,i),F+=4),s.keyMap)for(let[e,t]of n)v(s.encodeKey(e)),v(t);else for(let[e,t]of n)v(e),v(t);else{for(let e=0,t=Gf.length;e<t;e++){let t=Kf[e];if(n instanceof t){let t=Gf[e],r=t.tag;r??=t.getTag&&t.getTag.call(this,n),r<24?N[F++]=192|r:r<256?(N[F++]=216,N[F++]=r):r<65536?(N[F++]=217,N[F++]=r>>8,N[F++]=r&255):r>-1&&(N[F++]=218,P.setUint32(F,r),F+=4),t.encode.call(this,n,v,b);return}}if(n[Symbol.iterator]){if(Qf){let e=Error(`Iterable should be serialized as iterator`);throw e.iteratorNotHandled=!0,e}N[F++]=159;for(let e of n)v(e);N[F++]=255;return}if(n[Symbol.asyncIterator]||sp(n)){let e=Error(`Iterable/blob should be serialized as iterator`);throw e.iteratorNotHandled=!0,e}if(this.useToJSON&&n.toJSON){let e=n.toJSON();if(e!==n)return v(e)}y(n)}}else if(r===`boolean`)N[F++]=n?245:244;else if(r===`bigint`){if(n<BigInt(1)<<BigInt(64)&&n>=0)N[F++]=27,P.setBigUint64(F,n);else if(n>-(BigInt(1)<<BigInt(64))&&n<0)N[F++]=59,P.setBigUint64(F,-n-BigInt(1));else if(this.largeBigIntToFloat)N[F++]=251,P.setFloat64(F,Number(n));else{n>=BigInt(0)?N[F++]=194:(N[F++]=195,n=BigInt(-1)-n);let e=[];for(;n;)e.push(Number(n&BigInt(255))),n>>=BigInt(8);dp(new Uint8Array(e.reverse()),b);return}F+=8}else if(r===`undefined`)N[F++]=247;else throw Error(`Unknown type: `+r)},y=this.useRecords===!1?this.variableMapSize?e=>{let t=Object.keys(e),n=Object.values(e),r=t.length;if(r<24?N[F++]=160|r:r<256?(N[F++]=184,N[F++]=r):r<65536?(N[F++]=185,N[F++]=r>>8,N[F++]=r&255):(N[F++]=186,P.setUint32(F,r),F+=4),s.keyMap)for(let e=0;e<r;e++)v(s.encodeKey(t[e])),v(n[e]);else for(let e=0;e<r;e++)v(t[e]),v(n[e])}:e=>{N[F++]=185;let n=F-t;F+=2;let r=0;if(s.keyMap)for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&(v(s.encodeKey(t)),v(e[t]),r++);else for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&(v(t),v(e[t]),r++);N[n+++t]=r>>8,N[n+t]=r&255}:(e,t)=>{let n,a=i.transitions||=Object.create(null),o=0,s=0,c,u;if(this.keyMap){u=Object.keys(e).map(e=>this.encodeKey(e)),s=u.length;for(let e=0;e<s;e++){let t=u[e];n=a[t],n||(n=a[t]=Object.create(null),o++),a=n}}else for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&(n=a[t],n||(a[tp]&1048576&&(c=a[tp]&65535),n=a[t]=Object.create(null),o++),a=n,s++);let d=a[tp];if(d!==void 0)d&=65535,N[F++]=217,N[F++]=d>>8|224,N[F++]=d&255;else if(u||=a.__keys__||=Object.keys(e),c===void 0?(d=i.nextId++,d||(d=0,i.nextId=1),d>=256&&(i.nextId=(d=l)+1)):d=c,i[d]=u,d<l){N[F++]=217,N[F++]=d>>8|224,N[F++]=d&255,a=i.transitions;for(let e=0;e<s;e++)(a[tp]===void 0||a[tp]&1048576)&&(a[tp]=d),a=a[u[e]];a[tp]=d|1048576,r=!0}else{if(a[tp]=d,P.setUint32(F,3655335680),F+=3,o&&(g+=_*o),h.length>=256-l&&(h.shift()[tp]=void 0),h.push(a),ap(s+2),v(57344+d),v(u),t)return;for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&v(e[t]);return}if(s<24?N[F++]=128|s:ap(s),!t)for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&v(e[t])},b=e=>{let n;if(e>16777216){if(e-t>Zf)throw Error(`Encoded buffer would be larger than maximum buffer size`);n=Math.min(Zf,Math.round(Math.max((e-t)*(e>67108864?1.25:2),4194304)/4096)*4096)}else n=(Math.max(e-t<<2,N.length-1)>>12)+1<<12;let r=new Yf(n);return P=new DataView(r.buffer,0,n),N.copy?N.copy(r,0,t,e):r.set(N.slice(t,e)),F-=t,t=0,$f=r.length-10,N=r},ee=100,te=1e3;this.encodeAsIterable=function(e,t){return ae(e,t,ne)},this.encodeAsAsyncIterable=function(e,t){return ae(e,t,oe)};function*ne(e,n,r){let i=e.constructor;if(i===Object){let t=s.useRecords!==!1;t?y(e,!0):rp(Object.keys(e).length,160);for(let r in e){let i=e[r];t||v(r),i&&typeof i==`object`?n[r]?yield*ne(i,n[r]):yield*re(i,n,r):v(i)}}else if(i===Array){let r=e.length;ap(r);for(let i=0;i<r;i++){let r=e[i];r&&(typeof r==`object`||F-t>ee)?n.element?yield*ne(r,n.element):yield*re(r,n,`element`):v(r)}}else if(e[Symbol.iterator]&&!e.buffer){N[F++]=159;for(let r of e)r&&(typeof r==`object`||F-t>ee)?n.element?yield*ne(r,n.element):yield*re(r,n,`element`):v(r);N[F++]=255}else sp(e)?(rp(e.size,64),yield N.subarray(t,F),yield e,ie()):e[Symbol.asyncIterator]?(N[F++]=159,yield N.subarray(t,F),yield e,ie(),N[F++]=255):v(e);r&&F>t?yield N.subarray(t,F):F-t>ee&&(yield N.subarray(t,F),ie())}function*re(e,n,r){let i=F-t;try{v(e),F-t>ee&&(yield N.subarray(t,F),ie())}catch(a){if(a.iteratorNotHandled)n[r]={},F=t+i,yield*ne.call(this,e,n[r]);else throw a}}function ie(){ee=te,s.encode(null,bp)}function ae(e,t,n){return ee=t&&t.chunkThreshold?te=t.chunkThreshold:100,e&&typeof e==`object`?(s.encode(null,bp),n(e,s.iterateProperties||={},!0)):[s.encode(e)]}async function*oe(e,t){for(let n of ne(e,t,!0)){let e=n.constructor;if(e===Xf||e===Uint8Array)yield n;else if(sp(n)){let e=n.stream().getReader(),t;for(;!(t=await e.read()).done;)yield t.value}else if(n[Symbol.asyncIterator])for await(let e of n)ie(),e?yield*oe(e,t.async||={}):yield s.encode(e);else yield n}}}useBuffer(e){N=e,P=new DataView(N.buffer,N.byteOffset,N.byteLength),F=0}clearSharedData(){this.structures&&=[],this.sharedValues&&=void 0}updateSharedData(){let e=this.sharedVersion||0;this.sharedVersion=e+1;let t=this.structures.slice(0),n=new ip(t,this.sharedValues,this.sharedVersion),r=this.saveShared(n,t=>(t&&t.version||0)==e);return r===!1?(n=this.getShared()||{},this.structures=n.structures||[],this.sharedValues=n.packedValues,this.sharedVersion=n.version,this.structures.nextId=this.structures.length):t.forEach((e,t)=>this.structures[t]=e),r}};function rp(e,t){e<24?N[F++]=t|e:e<256?(N[F++]=t|24,N[F++]=e):e<65536?(N[F++]=t|25,N[F++]=e>>8,N[F++]=e&255):(N[F++]=t|26,P.setUint32(F,e),F+=4)}var ip=class{constructor(e,t,n){this.structures=e,this.packedValues=t,this.version=n}};function ap(e){e<24?N[F++]=128|e:e<256?(N[F++]=152,N[F++]=e):e<65536?(N[F++]=153,N[F++]=e>>8,N[F++]=e&255):(N[F++]=154,P.setUint32(F,e),F+=4)}const op=typeof Blob>`u`?function(){}:Blob;function sp(e){if(e instanceof op)return!0;let t=e[Symbol.toStringTag];return t===`Blob`||t===`File`}function cp(e,t){switch(typeof e){case`string`:if(e.length>3){if(t.objectMap[e]>-1||t.values.length>=t.maxValues)return;let n=t.get(e);if(n)++n.count==2&&t.values.push(e);else if(t.set(e,{count:1}),t.samplingPackedValues){let n=t.samplingPackedValues.get(e);n?n.count++:t.samplingPackedValues.set(e,{count:1})}}break;case`object`:if(e)if(e instanceof Array)for(let n=0,r=e.length;n<r;n++)cp(e[n],t);else{let r=!t.encoder.useRecords;for(var n in e)e.hasOwnProperty(n)&&(r&&cp(n,t),cp(e[n],t))}break;case`function`:console.log(e)}}const lp=new Uint8Array(new Uint16Array([1]).buffer)[0]==1;Kf=[Date,Set,Error,RegExp,Tf,ArrayBuffer,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array>`u`?function(){}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>`u`?function(){}:BigInt64Array,Float32Array,Float64Array,ip],Gf=[{tag:1,encode(e,t){let n=e.getTime()/1e3;(this.useTimestamp32||e.getMilliseconds()===0)&&n>=0&&n<4294967296?(N[F++]=26,P.setUint32(F,n),F+=4):(N[F++]=251,P.setFloat64(F,n),F+=8)}},{tag:258,encode(e,t){t(Array.from(e))}},{tag:27,encode(e,t){t([e.name,e.message])}},{tag:27,encode(e,t){t([`RegExp`,e.source,e.flags])}},{getTag(e){return e.tag},encode(e,t){t(e.value)}},{encode(e,t,n){dp(e,n)}},{getTag(e){if(e.constructor===Uint8Array&&(this.tagUint8Array||Jf&&this.tagUint8Array!==!1))return 64},encode(e,t,n){dp(e,n)}},up(68,1),up(69,2),up(70,4),up(71,8),up(72,1),up(77,2),up(78,4),up(79,8),up(85,4),up(86,8),{encode(e,t){let n=e.packedValues||[],r=e.structures||[];if(n.values.length>0){N[F++]=216,N[F++]=51,ap(4);let e=n.values;t(e),ap(0),ap(0),packedObjectMap=Object.create(sharedPackedObjectMap||null);for(let t=0,n=e.length;t<n;t++)packedObjectMap[e[t]]=t}if(r){P.setUint32(F,3655335424),F+=3;let n=r.slice(0);n.unshift(57344),n.push(new Tf(e.version,1399353956)),t(n)}else t(new Tf(e.version,1399353956))}}];function up(e,t){return!lp&&t>1&&(e-=4),{tag:e,encode:function(e,t){let n=e.byteLength,r=e.byteOffset||0,i=e.buffer||e;t(Jf?qf.from(i,r,n):new Uint8Array(i,r,n))}}}function dp(e,t){let n=e.byteLength;n<24?N[F++]=64+n:n<256?(N[F++]=88,N[F++]=n):n<65536?(N[F++]=89,N[F++]=n>>8,N[F++]=n&255):(N[F++]=90,P.setUint32(F,n),F+=4),F+n>=N.length&&t(F+n),N.set(e.buffer?e:new Uint8Array(e),F),F+=n}function fp(e,t){let n,r=t.length*2,i=e.length-r;t.sort((e,t)=>e.offset>t.offset?1:-1);for(let n=0;n<t.length;n++){let r=t[n];r.id=n;for(let t of r.references)e[t++]=n>>8,e[t]=n&255}for(;n=t.pop();){let t=n.offset;e.copyWithin(t+r,t,i),r-=2;let a=t+r;e[a++]=216,e[a++]=28,i=t}return e}function pp(e,t){P.setUint32(I.position+e,F-I.position-e+1);let n=I;I=null,t(n[0]),t(n[1])}let mp=new np({useRecords:!1});const hp=mp.encode;mp.encodeAsIterable,mp.encodeAsAsyncIterable;const{NEVER:gp,ALWAYS:_p,DECIMAL_ROUND:vp,DECIMAL_FIT:yp}=Uf,bp=2048;var xp=i(((e,t)=>{let n=()=>process.platform===`linux`,r=null;t.exports={isLinux:n,getReport:()=>{if(!r)if(n()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,r=process.report.getReport(),process.report.excludeNetwork=e}else r={};return r}}})),Sp=i(((t,n)=>{let r=e(`fs`),i=2048;n.exports={LDD_PATH:`/usr/bin/ldd`,SELF_PATH:`/proc/self/exe`,readFileSync:e=>{let t=r.openSync(e,`r`),n=Buffer.alloc(i),a=r.readSync(t,n,0,i,0);return r.close(t,()=>{}),n.subarray(0,a)},readFile:e=>new Promise((t,n)=>{r.open(e,`r`,(e,a)=>{if(e)n(e);else{let e=Buffer.alloc(i);r.read(a,e,0,i,0,(n,i)=>{t(e.subarray(0,i)),r.close(a,()=>{})})}})})}})),Cp=i(((e,t)=>{t.exports={interpreterPath:e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),n=e.readUInt16LE(54),r=e.readUInt16LE(56);for(let i=0;i<r;i++){let r=t+i*n;if(e.readUInt32LE(r)===3){let t=e.readUInt32LE(r+8),n=e.readUInt32LE(r+32);return e.subarray(t,t+n).toString().replace(/\0.*$/g,``)}}return null}}})),wp=i(((t,n)=>{let r=e(`child_process`),{isLinux:i,getReport:a}=xp(),{LDD_PATH:o,SELF_PATH:s,readFile:c,readFileSync:l}=Sp(),{interpreterPath:u}=Cp(),d,f,p,m=`getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true`,h=``,g=()=>h||new Promise(e=>{r.exec(m,(t,n)=>{h=t?` `:n,e(h)})}),_=()=>{if(!h)try{h=r.execSync(m,{encoding:`utf8`})}catch{h=` `}return h},v=`glibc`,y=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,b=`musl`,ee=e=>e.includes(`libc.musl-`)||e.includes(`ld-musl-`),te=()=>{let e=a();return e.header&&e.header.glibcVersionRuntime?v:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(ee)?b:null},ne=e=>{let[t,n]=e.split(/[\r\n]+/);return t&&t.includes(v)?v:n&&n.includes(b)?b:null},re=e=>{if(e){if(e.includes(`/ld-musl-`))return b;if(e.includes(`/ld-linux-`))return v}return null},ie=e=>(e=e.toString(),e.includes(`musl`)?b:e.includes(`GNU C Library`)?v:null),ae=async()=>{if(f!==void 0)return f;f=null;try{let e=await c(o);f=ie(e)}catch{}return f},oe=()=>{if(f!==void 0)return f;f=null;try{let e=l(o);f=ie(e)}catch{}return f},se=async()=>{if(d!==void 0)return d;d=null;try{let e=await c(s),t=u(e);d=re(t)}catch{}return d},ce=()=>{if(d!==void 0)return d;d=null;try{let e=l(s),t=u(e);d=re(t)}catch{}return d},le=async()=>{let e=null;if(i()&&(e=await se(),!e&&(e=await ae(),e||=te(),!e))){let t=await g();e=ne(t)}return e},ue=()=>{let e=null;if(i()&&(e=ce(),!e&&(e=oe(),e||=te(),!e))){let t=_();e=ne(t)}return e},de=async()=>i()&&await le()!==v,fe=()=>i()&&ue()!==v,pe=async()=>{if(p!==void 0)return p;p=null;try{let e=(await c(o)).match(y);e&&(p=e[1])}catch{}return p},me=()=>{if(p!==void 0)return p;p=null;try{let e=l(o).match(y);e&&(p=e[1])}catch{}return p},he=()=>{let e=a();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},ge=e=>e.trim().split(/\s+/)[1],_e=e=>{let[t,n,r]=e.split(/[\r\n]+/);return t&&t.includes(v)?ge(t):n&&r&&n.includes(b)?ge(r):null};n.exports={GLIBC:v,MUSL:b,family:le,familySync:ue,isNonGlibcLinux:de,isNonGlibcLinuxSync:fe,version:async()=>{let e=null;if(i()&&(e=await pe(),e||=he(),!e)){let t=await g();e=_e(t)}return e},versionSync:()=>{let e=null;if(i()&&(e=me(),e||=he(),!e)){let t=_();e=_e(t)}return e}}})),Tp=i(((t,n)=>{var r=e(`fs`),i=e(`path`),a=e(`url`),o=process.config&&process.config.variables||{},s=!!process.env.PREBUILDS_ONLY,c=process.versions,l=c.modules;(c.deno||process.isBun)&&(l=`unsupported`);var u=oe()?`electron`:`node`,d=process.arch,f=process.platform,p=process.env.LIBC||(se(f)?`musl`:`glibc`),m=process.env.ARM_VERSION||(d===`arm64`?`8`:o.arm_version)||``,h=(c.uv||``).split(`.`)[0];n.exports=g;function g(t){return typeof __webpack_require__==`function`?__non_webpack_require__(g.path(t)):e(g.path(t))}g.path=function(t){t=i.resolve(t||`.`);var n=``;try{n=typeof __webpack_require__==`function`?__non_webpack_require__(i.join(t,`package.json`)).name:e(i.join(t,`package.json`)).name;var r=n.toUpperCase().replace(/-/g,`_`)+`_PREBUILD`;process.env[r]&&(t=process.env[r])}catch{}if(!s){var o=v(i.join(t,`build/Release`),y);if(o)return o;var c=v(i.join(t,`build/Debug`),y);if(c)return c}var g=ce(t);if(g)return g;var ie=ce(i.dirname(process.execPath));if(ie)return ie;var oe=(n[0]==`@`?``:`@`+n+`/`)+n+`-`+f+`-`+d;try{return le(i.dirname(e(`module`).createRequire(a.pathToFileURL(i.join(t,`package.json`))).resolve(oe)))}catch{}var se=[`platform=`+f,`arch=`+d,`runtime=`+u,`abi=`+l,`uv=`+h,m?`armv=`+m:``,`libc=`+p,`node=`+process.versions.node,process.versions.electron?`electron=`+process.versions.electron:``,typeof __webpack_require__==`function`?`webpack=true`:``].filter(Boolean).join(` `);throw Error(`No native build was found for `+se+`
3
3
  attempted loading from: `+t+` and package: `+oe+`
4
- `);function ce(e){var t=_(i.join(e,`prebuilds`)).map(b).filter(ee(f,d)).sort(te)[0];if(t)return le(i.join(e,`prebuilds`,t.name))}function le(e){var t=_(e).map(ne).filter(re(u,l)).sort(ae(u))[0];if(t)return i.join(e,t.file)}};function _(e){try{return r.readdirSync(e)}catch{return[]}}function v(e,t){var n=_(e).filter(t);return n[0]&&i.join(e,n[0])}function y(e){return/\.node$/.test(e)}function b(e){var t=e.split(`-`);if(t.length===2){var n=t[0],r=t[1].split(`+`);if(n&&r.length&&r.every(Boolean))return{name:e,platform:n,architectures:r}}}function ee(e,t){return function(n){return n==null||n.platform!==e?!1:n.architectures.includes(t)}}function te(e,t){return e.architectures.length-t.architectures.length}function ne(e){var t=e.split(`.`),n=t.pop(),r={file:e,specificity:0};if(n===`node`){for(var i=0;i<t.length;i++){var a=t[i];if(a===`node`||a===`electron`||a===`node-webkit`)r.runtime=a;else if(a===`napi`)r.napi=!0;else if(a.slice(0,3)===`abi`)r.abi=a.slice(3);else if(a.slice(0,2)===`uv`)r.uv=a.slice(2);else if(a.slice(0,4)===`armv`)r.armv=a.slice(4);else if(a===`glibc`||a===`musl`)r.libc=a;else continue;r.specificity++}return r}}function re(e,t){return function(n){return!(n==null||n.runtime!==e&&!ie(n)||n.abi!==t&&!n.napi||n.uv&&n.uv!==h||n.armv&&n.armv!==m||n.libc&&n.libc!==p)}}function ie(e){return e.runtime===`node`&&e.napi}function ae(e){return function(t,n){return t.runtime===n.runtime?t.abi===n.abi?t.specificity===n.specificity?0:t.specificity>n.specificity?-1:1:t.abi?-1:1:t.runtime===e?-1:1}}function oe(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<`u`&&window.process&&window.process.type===`renderer`}function se(e){if(e!==`linux`)return!1;let{familySync:t,MUSL:n}=kp();return t()===n}g.parseTags=ne,g.matchTags=re,g.compareTags=ae,g.parseTuple=b,g.matchTuple=ee,g.compareTuples=te})),jp=i(((e,t)=>{t.exports=Ap()(__dirname)}));if(!(process.env.CBOR_NATIVE_ACCELERATION_DISABLED!==void 0&&process.env.CBOR_NATIVE_ACCELERATION_DISABLED.toLowerCase()===`true`)){let t;try{t=typeof e==`function`?jp():nl(import.meta.url)(`cbor-extract`),t&&Sf(t.extractStrings)}catch{}}var Mp=Yc();let Np,Pp,Fp,Ip;const Lp={connections:8,keepAliveTimeout:1e4},Rp={...Lp,allowH2:!1,pipelining:1},zp={...Lp,allowH2:!0,pipelining:100,initialWindowSize:4194304,connectionWindowSize:16777216},Bp={...Lp,allowH2:!0,pipelining:1},Vp={retryAfter:!0,statusCodes:[500,502,503,504]},Hp={retryAfter:!0,methods:[`PUT`],statusCodes:[429]},Up={retryAfter:!0,methods:[`PUT`],statusCodes:[429,500,502,503,504]};function Wp(){return process.env.WORKFLOW_H2_MULTIPLEX!==`0`}function Gp(e){if(!e||typeof e!=`object`||Array.isArray(e))return NaN;let t=e,n=t[`content-length`]??t[`Content-Length`];return typeof n==`string`||typeof n==`number`?Number(n):NaN}function Kp(e){return(t,n)=>{let r=t.body,i=!!r&&typeof r!=`string`&&!Buffer.isBuffer(r)&&typeof r[Symbol.asyncIterator]==`function`,a=Gp(t.headers);return!i||!(a>=0)||a>1048576?e({...t,idempotent:!0},n):((async()=>{try{let i=[];for await(let e of r)i.push(Buffer.from(e));e({...t,body:Buffer.concat(i),idempotent:!0},n)}catch(e){n.onError?.(e)}})(),!0)}}function qp(e){return e?.dispatcher??tm()}function Jp(e){return e?.dispatcher??nm()}function Yp(e){return e?.dispatcher??rm()}function Xp(e){return e?.dispatcher??im()}function Zp(e,t){return new Mp.RetryAgent(new Mp.Agent(e),t)}function Qp(e){let t=new Mp.RetryAgent(new Mp.Agent({...zp,...e}),Vp);return Wp()?$p(t,t.compose(Kp)):t}function $p(e,t){return new Proxy(t,{get:(t,n)=>n===`close`||n===`destroy`?e[n].bind(e):t[n]})}function em(e,t){return new Mp.RetryAgent(new Mp.Agent({...Bp,...t}),e)}function tm(){return Np??=Zp(Rp,Vp),Np}function nm(){return Pp??=Qp(),Pp}function rm(){return Fp??=em(Hp),Fp}function im(){return Ip??=em(Up),Ip}let am=null;async function om(){return am||=import(`../../_chunks/workflow/src-Cj3P1ChQ.js`).then(e=>n(e.t(),1)).catch(e=>(typeof process<`u`&&typeof process.env.DEBUG==`string`&&(process.env.DEBUG.includes(`workflow:`)||process.env.DEBUG===`*`)&&console.warn(`[workflow] @opentelemetry/api unavailable — world-vercel spans disabled:`,e instanceof Error?e.message:e),null)),am}let sm=null;function cm(){return typeof process<`u`&&typeof process.env.DEBUG==`string`&&(process.env.DEBUG.includes(`workflow:`)||process.env.DEBUG===`*`)}let lm=!1;function um(e,t){if(!(lm||!cm())){lm=!0;try{let n=globalThis[Symbol.for(`opentelemetry.js.api.1`)],r=e.trace.getTracerProvider(),i=r.getDelegate?.()??r,a=t.startSpan(`workflow.otel.probe.world_vercel`);console.warn(`[workflow:otel-diag] world-vercel`,JSON.stringify({globalRegistrationVersion:n?.version??null,providerCtor:r?.constructor?.name??null,delegateCtor:i?.constructor?.name??null,tracerCtor:t?.constructor?.name??null,probeCtor:a?.constructor?.name??null,probeRecording:a.isRecording()})),a.end()}catch(e){console.warn(`[workflow:otel-diag] world-vercel failed:`,e instanceof Error?e.message:e)}}}async function dm(){return sm||=om().then(e=>{if(!e)return null;let t=e.trace.getTracer(`workflow`);return um(e,t),t}),sm}async function fm(e,...t){let[n,r]=await Promise.all([dm(),om()]),{fn:i,opts:a}=typeof t[0]==`function`?{fn:t[0],opts:{}}:{fn:t[1],opts:t[0]};if(!i)throw Error(`Function to trace must be provided`);return!n||!r?await i():n.startActiveSpan(e,a,async e=>{try{let t=await i(e);return e.setStatus({code:r.SpanStatusCode.OK}),t}catch(t){throw e.setStatus({code:r.SpanStatusCode.ERROR,message:t.message}),t}finally{e.end()}})}async function pm(e){let t=await om();if(t)return t.SpanKind[e]}async function mm(e){let t=await om();if(!t)return;let n={};t.propagation.inject(t.context.active(),n);for(let[t,r]of Object.entries(n))e.set(t,r)}function L(...e){return t=>Object.fromEntries(e.map(e=>[e,t]))}const hm=L(`http.request.method`),gm=L(`url.full`),_m=L(`server.address`),vm=L(`server.port`),ym=L(`http.response.status_code`),bm=L(`error.type`),xm=L(`workflow.world.parse.format`),Sm=L(`peer.service`),Cm=L(`rpc.system`),wm=L(`rpc.service`),Tm=L(`rpc.method`),Em=L(`workflow.run.id`),Dm=L(`step.id`),Om=L(`workflow.stream.name`),km=L(`workflow.stream.operation`),Am=L(`workflow.stream.start_index`),jm=()=>Vc(`WORKFLOW_REQUEST_TIMEOUT_MS`,6e4,{integer:!0,min:1}),Mm=typeof process<`u`&&typeof process.env.DEBUG==`string`&&(process.env.DEBUG.includes(`workflow:`)||process.env.DEBUG===`*`),Nm=[`x-vercel-id`,`x-vercel-error`,`x-vercel-mitigated`];function Pm(e){return Nm.flatMap(t=>{let n=e.get(t);return n?[`${t}=${n}`]:[]})}function Fm(e){let t=Pm(e);return t.length>0?` (${t.join(`; `)})`:``}function Im(e,t,n,r){if(!Mm)return;let i=Pm(n.headers),a=i.length>0?`; ${i.join(`; `)}`:``;console.debug(`[workflow:world-vercel:http] ${e} ${t} -> ${n.status} (${r}ms${a})`)}function Lm(e,t,n){if(!process.env.DEBUG)return;let r=Array.from(n.entries()).filter(([e])=>e.toLowerCase()!==`authorization`).map(([e,t])=>`-H "${e}: ${t}"`).join(` `);console.error(`Failed to fetch, reproduce with:\ncurl -X ${e} ${r} "${t}"`)}function Rm(e){if(!e)return;let t=parseInt(e,10);return Number.isNaN(t)?void 0:t}function zm(e,t,n={}){let{retryAfter:r,code:i,url:a,mitigated:d,details:p}=n;return e===409?new f(t):e===410?new l(t):e===412?new c(t,{retryAfter:r,details:p}):e===425?new s(t,{retryAfter:r}):e===429?Bm(e,d)?new o(`${t} (x-vercel-mitigated=challenge)`,{url:a,status:e,code:`TRANSPORT`,retryAfter:r}):new u(t,{retryAfter:r}):new o(t,{url:a,status:e,code:i,retryAfter:r})}function Bm(e,t){return e===429&&t===`challenge`}async function Vm(e){return e?.token??process.env.VERCEL_TOKEN??await(0,Jd.getVercelOidcToken)().catch(()=>null)}function Hm(e){try{let t=new URL(e);return{serverAddress:t.hostname,serverPort:t.port?parseInt(t.port,10):t.protocol===`https:`?443:80}}catch{return{}}}function Um(e){let{method:t,url:n,peerService:r}=e,{serverAddress:i,serverPort:a}=Hm(n);return{...hm(t),...gm(n),...i?_m(i):{},...a?vm(a):{},...Sm(r),...Cm(`http`),...wm(r)}}async function Wm(e){let{method:t,url:n,headers:r,body:i,dispatcher:a,peerService:s=`workflow-server`,timeoutMs:c=jm(),signal:l,injectTraceContext:u=!0,cacheBust:d=!0,logLabel:f,buildError:p,spanName:m,attributes:h,durationAttribute:g}=e,_=f??n;return fm(m??`http ${t}`,{kind:await pm(`CLIENT`)},async e=>{if(m&&Mm&&e){let t=e.spanContext();console.warn(`[workflow:otel-diag] span-open`,JSON.stringify({spanName:m,traceId:t.traceId,spanId:t.spanId,recording:e.isRecording()}))}e?.setAttributes(Um({method:t,url:n,peerService:s})),h&&e?.setAttributes(h),u&&await mm(r),d&&r.set(`X-Request-Time`,Date.now().toString());let f=c==null?void 0:AbortSignal.timeout(c),v=l&&f?AbortSignal.any([l,f]):l??f,y=Date.now(),b;try{b=await fetch(n,{method:t,headers:r,body:i,signal:v,dispatcher:a})}catch(r){let i=Date.now()-y;if(r instanceof Error&&(r.name===`TimeoutError`||r.name===`AbortError`)){let a=new o(`${t} ${_} timed out after ${i}ms`,{url:n,cause:r});throw e?.setAttributes({...bm(`TIMEOUT`)}),e?.recordException?.(a),a}throw r}let ee=Date.now()-y;if(Im(t,_,b,ee),e?.setAttributes({...ym(b.status)}),g&&e?.setAttributes({[g]:ee}),!b.ok){if(e?.setAttributes({...bm(`HTTP ${b.status}`)}),Lm(t,n,r),p){let t=await p(b);throw e?.recordException?.(t),t}let i=await b.text().catch(()=>``),a=zm(b.status,`${t} ${_} -> HTTP ${b.status}: ${b.statusText}${i?` ${i}`:``}${Fm(b.headers)}`,{url:n,retryAfter:Rm(b.headers.get(`Retry-After`))});throw e?.recordException?.(a),a}return b})}const Gm=`5.0.0-beta.36`,Km=new Set([`GET`,`HEAD`]),qm=new Set([`UND_ERR_REQ_RETRY`,`UND_ERR_SOCKET`,`UND_ERR_CONNECT`,`UND_ERR_CONNECT_TIMEOUT`,`UND_ERR_HEADERS_TIMEOUT`,`UND_ERR_BODY_TIMEOUT`,`UND_ERR_CLOSED`,`ECONNRESET`,`ECONNREFUSED`,`ENOTFOUND`,`EAI_AGAIN`,`EPIPE`]);function Jm(e){let t=e;for(let e=0;t!=null&&e<5;e++){if(typeof t==`object`&&`code`in t){let e=t.code;if(typeof e==`string`&&qm.has(e))return e}t=t?.cause}}const Ym=()=>process.env.VERCEL_WORKFLOW_SERVER_URL||``,Xm=()=>process.env.WORKFLOW_TEST_LIMIT_OVERRIDES?.trim()||``;function Zm(e){return e}const Qm=(...e)=>e.filter(Boolean).join(` `),$m=()=>{let e=process.env.VERCEL_DEPLOYMENT_ID;return e?`@workflow/world-vercel/${Gm} node-${process.version} ${Ol.platform()} (${Ol.arch()}) ${e}`:`@workflow/world-vercel/${Gm} node-${process.version} ${Ol.platform()} (${Ol.arch()})`},eh=e=>{let t=e?.projectConfig,n=Ym()||`https://vercel-workflow.com`,r=process.env.WORKFLOW_VERCEL_BACKEND_URL,i=!!(t?.projectId&&t?.teamId);return{baseUrl:i?r||`https://api.vercel.com/v1/workflow`:`${n}/api`,usingProxy:i}},th=e=>{let t=e?.projectConfig;return t?t.environment||`production`:process.env.VERCEL_TARGET_ENV||process.env.VERCEL_ENV||void 0},nh=(e,t)=>{let n=e?.projectConfig,r=new Headers(e?.headers);r.set(`User-Agent`,Qm($m(),r.get(`User-Agent`)));let i=Xm();i&&r.set(`x-workflow-test-limit-overrides`,i),n&&(r.set(`x-vercel-environment`,th(e)),n.projectId&&r.set(`x-vercel-project-id`,n.projectId),n.teamId&&r.set(`x-vercel-team-id`,n.teamId));let a=Ym();return a&&t.usingProxy&&r.set(`x-vercel-workflow-api-url`,a),r};async function rh(e){let{baseUrl:t,usingProxy:n}=eh(e),r=nh(e,{usingProxy:n});if(n){if(!e?.token)throw Error(`world-vercel: api-workflow proxy requested (${t}) but no Vercel auth token was provided. Pass one as \`config.token\` (the SDK reads it from \`WORKFLOW_VERCEL_AUTH_TOKEN\`).`);r.set(`Authorization`,`Bearer ${e.token}`)}else{let t;try{t=await(0,Jd.getVercelOidcToken)()}catch{}let n=e?.token??t;n&&r.set(`Authorization`,`Bearer ${n}`),t&&r.set(`x-vercel-trusted-oidc-idp-token`,t)}return{baseUrl:t,headers:r,usingProxy:n}}async function R({endpoint:e,options:t={},config:n={},schema:r,data:i,onResponse:a,retryConnectTimeout:s=!1}){let c=t.method||`GET`,{baseUrl:l,headers:u}=await rh(n),d=`${l}${e}`;return fm(`http ${c}`,{kind:await pm(`CLIENT`)},async l=>{l?.setAttributes(Um({method:c,url:d,peerService:`workflow-server`})),u.set(`Accept`,`application/cbor`),await mm(u);let f;i!==void 0&&(u.set(`Content-Type`,`application/cbor`),f=bp(i));let p=Km.has(c.toUpperCase()),m,h=``;for(let r=0;;r++){u.set(`X-Request-Time`,Date.now().toString());let i=AbortSignal.timeout(jm()),g=t.signal?AbortSignal.any([t.signal,i]):i,_=new Request(d,{...t,body:f,headers:u,signal:g}),v=Date.now(),y;try{y=await fetch(_,{dispatcher:qp(n)})}catch(t){let n=Date.now()-v;if(t instanceof Error&&(t.name===`TimeoutError`||t.name===`AbortError`)){let r=new o(`${c} ${e} timed out after ${n}ms`,{url:d,code:`TIMEOUT`,cause:t});throw l?.setAttributes({...bm(`TIMEOUT`)}),l?.recordException?.(r),r}let i=Jm(t);if(i){if(s&&p&&i===`UND_ERR_CONNECT_TIMEOUT`&&r===0){await new Promise(e=>setTimeout(e,100));continue}let a=new o(`${c} ${e} transport failure after ${n}ms (${i})`,{url:d,code:`TRANSPORT`,cause:t});throw l?.setAttributes({...bm(`TRANSPORT`)}),l?.recordException?.(a),a}throw t}let b=Date.now()-v;if(h=Fm(y.headers),Im(c,e,y,b),l?.setAttributes({...ym(y.status)}),!y.ok){let t=await ah(y).then(e=>e.data).catch(()=>({})),n=t.code??t.error;Lm(_.method,d,u);let r=Rm(y.headers.get(`Retry-After`)),i=(t.message||`${_.method} ${e} -> HTTP ${y.status}: ${y.statusText}`)+h,a=zm(y.status,i,{url:d,code:n,retryAfter:r,mitigated:y.headers.get(`x-vercel-mitigated`)});throw l?.setAttributes({...bm(n||`HTTP ${y.status}`)}),l?.recordException?.(a),a}a?.(y);try{m=await fm(`world.parse`,async e=>{let t=await ah(y),n=(y.headers.get(`Content-Type`)||``).includes(`application/cbor`);return e?.setAttributes({...xm(n?`cbor`:`json`)}),t});break}catch(t){if(p&&r<2){let n=100*2**r;l?.setAttributes({...bm(`PARSE_ERROR_RETRYING`)}),Mm&&console.debug(`[workflow:world-vercel:http] ${c} ${e} body parse failed (attempt ${r+1}/3); retrying in ${n}ms: ${t}`),await new Promise(e=>setTimeout(e,n));continue}let n=y.headers.get(`Content-Type`)||`unknown`;throw new o(`Failed to parse response body for ${c} ${e}${h} (Content-Type: ${n}):\n\n${t}`,{url:d,code:`PARSE_ERROR`,cause:t})}}return await fm(`world.validate`,async()=>{let t=r.safeParse(m.data);if(!t.success){let n=t.error.issues.map(e=>` ${e.path.length>0?e.path.join(`.`):`<root>`}: ${e.message}`).join(`
5
- `),r=process.env.DEBUG?`\n\nResponse context: ${m.getDebugContext()}`:``;throw new o(`Schema validation failed for ${c} ${e}${h}:\n${n}${r}`,{url:d,code:`SCHEMA_VALIDATION`,cause:t.error})}return t.data})})}function ih(e){let t=Tl(e,{depth:3,maxArrayLength:10,breakLength:120});return t.length>500?`${t.slice(0,500)}...`:t}async function ah(e){let t=e.headers.get(`Content-Type`)||``;if(t.includes(`application/cbor`)){let n=await e.arrayBuffer(),r=qf(new Uint8Array(n));return{data:r,getDebugContext:()=>`Content-Type: ${t}, ${n.byteLength} bytes (CBOR), preview: ${ih(r)}`}}let n=await e.text(),r=JSON.parse(n);return{data:r,getDebugContext:()=>`Content-Type: ${t}, ${n.length} bytes, preview: ${ih(r)}`}}function oh(e,t){t?.limit&&e.set(`limit`,t.limit.toString()),t?.cursor&&e.set(`cursor`,t.cursor),t?.sortOrder&&e.set(`sortOrder`,t.sortOrder)}function sh(e){let t=e.toString();return t?`?${t}`:``}function ch(e,t){t.workflowName&&e.set(`workflowName`,t.workflowName),t.startTime&&t.endTime&&(e.set(`startTime`,t.startTime),e.set(`endTime`,t.endTime)),oh(e,t.pagination)}function lh(e){return{runs:{get(t){return R({endpoint:`/v2/analytics/runs/${encodeURIComponent(t)}`,config:e,schema:ir})},list(t={}){let n=new URLSearchParams;return t.workflowName&&n.set(`workflowName`,t.workflowName),t.status&&n.set(`status`,t.status),t.startTime&&t.endTime&&(n.set(`startTime`,t.startTime),n.set(`endTime`,t.endTime)),t.attributes&&Object.keys(t.attributes).length>0&&n.set(`attributes`,JSON.stringify(t.attributes)),oh(n,t.pagination),R({endpoint:`/v2/analytics/runs${sh(n)}`,config:e,schema:zs(ir)})}},attributes:{list(t={}){let n=new URLSearchParams;return ch(n,t),R({endpoint:`/v2/analytics/attributes${sh(n)}`,config:e,schema:zs(Jn)})}},steps:{get(t,n){return R({endpoint:`/v2/analytics/runs/${encodeURIComponent(t)}/steps/${encodeURIComponent(n)}`,config:e,schema:Ie})},list(t){let n=new URLSearchParams;return oh(n,t.pagination),R({endpoint:`/v2/analytics/runs/${encodeURIComponent(t.runId)}/steps${sh(n)}`,config:e,schema:zs(Ie)})}},events:{get(t,n){return R({endpoint:`/v2/analytics/runs/${encodeURIComponent(t)}/events/${encodeURIComponent(n)}`,config:e,schema:_e})},list(t){let n=new URLSearchParams;return t.eventType&&n.set(`eventType`,t.eventType),t.correlationId&&n.set(`correlationId`,t.correlationId),oh(n,t.pagination),R({endpoint:`/v2/analytics/runs/${encodeURIComponent(t.runId)}/events${sh(n)}`,config:e,schema:zs(_e)})},listByCorrelationId(t){let n=new URLSearchParams;return n.set(`correlationId`,t.correlationId),oh(n,t.pagination),R({endpoint:`/v2/analytics/runs/${encodeURIComponent(t.runId)}/events${sh(n)}`,config:e,schema:zs(_e)})}},hooks:{get(t,n){let r=new URLSearchParams;return n?.runId&&r.set(`runId`,n.runId),R({endpoint:`/v2/analytics/hooks/${encodeURIComponent(t)}${sh(r)}`,config:e,schema:ic})},list(t){let n=new URLSearchParams;return n.set(`runId`,t.runId),oh(n,t.pagination),R({endpoint:`/v2/analytics/hooks${sh(n)}`,config:e,schema:zs(ic)})}},waits:{get(t,n){return R({endpoint:`/v2/analytics/runs/${encodeURIComponent(t)}/waits/${encodeURIComponent(n)}`,config:e,schema:De})},list(t){let n=new URLSearchParams;return t.status&&n.set(`status`,t.status),oh(n,t.pagination),R({endpoint:`/v2/analytics/runs/${encodeURIComponent(t.runId)}/waits${sh(n)}`,config:e,schema:zs(De)})}}}}const uh=Li();let dh;function fh(e){let t=qc(e),n=5,r=1;for(;n>=0&&r>0;){let e=t[n]+r;t[n]=e&255,r=e>>8,n--}if(r>0)throw Error(`ULID space exhausted`);return Gc(t)}function ph(e){return typeof e!=`string`||e===``||e===`unknown`?null:Object.hasOwn(Uc,e)?e:null}function mh(e){return ph(e?.region)??ph(process.env.VERCEL_REGION)??`iad1`}function hh(e){let t=Uc[mh(e)],n=Wc(uh(),t);if(dh!==void 0)for(;n<=dh;)n=Wc(fh(dh),t);return dh=n,n}function gh(e){let t=e.startsWith(`wrun_`)?e.slice(5):e;try{let e=Jc(t);return e.tagged&&e.region?e.region:Kc}catch{return null}}function _h(e){let t=e.runId;return typeof t!=`string`||t.length===0?null:{region:gh(t)}}async function vh(e,t,n){if(e.length!==32)throw Error(`Invalid deployment key length: expected 32 bytes for AES-256, got ${e.length} bytes`);if(!t||typeof t!=`string`)throw Error(`projectId must be a non-empty string`);let r=await Sl.subtle.importKey(`raw`,e,`HKDF`,!1,[`deriveBits`]),i=new TextEncoder().encode(`${t}|${n}`),a=await Sl.subtle.deriveBits({name:`HKDF`,hash:`SHA-256`,salt:new Uint8Array(32),info:i},r,256);return new Uint8Array(a)}async function yh(e,t,n,r){let i=await Vm({token:r?.token});if(!i)throw Error(`Cannot fetch run key: no OIDC token or VERCEL_TOKEN available`);let a=new URLSearchParams({projectId:t,runId:n});r?.teamId&&a.set(`teamId`,r.teamId);let o=await(await Wm({method:`GET`,url:`https://api.vercel.com/v1/workflow/run-key/${e}?${a}`,headers:new Headers({Authorization:`Bearer ${i}`}),dispatcher:qp({dispatcher:r?.dispatcher}),peerService:`vercel-api`,timeoutMs:null,buildError:async t=>{let r;try{r=await t.text()}catch{r=`<unable to read response body>`}return Error(`Failed to fetch run key for ${n} (deployment ${e}): HTTP ${t.status} ${t.statusText}${r?` — ${r}`:``}`)}})).json(),s=dc({key:qt().nullable()}).safeParse(o);if(!s.success)throw Error(`Invalid response from Vercel API: expected { key: string | null }. Zod error: ${s.error.message}`);if(s.data.key!==null)return Buffer.from(s.data.key,`base64`)}function bh(e,t,n,r){if(!e)return;let i=process.env.VERCEL===`1`,a;function o(){if(a)return a;let e=process.env.VERCEL_DEPLOYMENT_KEY;if(e)return a=Buffer.from(e,`base64`),a}return async function(a,s){let c=typeof a==`string`?a:a.runId,l=typeof a==`string`?s?.deploymentId:a.deploymentId;if(i&&(!l||l===process.env.VERCEL_DEPLOYMENT_ID)){let t=o();return t?vh(t,e,c):void 0}if(l)return yh(l,e,c,{token:n,teamId:t,dispatcher:r})}}async function xh(){let{getDeadline:e}=await import(`../../_chunks/workflow/functions-ClJbpZhR.js`).then(e=>n(e.default,1));return e()}const Sh={peerService:`workflow-server`,rpcSystem:`http`,rpcService:`workflow-server`},Ch={"world.runs.get":0,"world.runs.experimentalSetAttributes":0,"world.steps.get":0,"world.events.create":0,"world.events.get":0},wh=new Set([`world.steps.list`,`world.events.list`,`world.hooks.list`]);function Th(e){if(e.length>=2&&typeof e[1]==`object`&&e[1]!==null){let t=e[1];if(typeof t.eventType==`string`)return t.eventType}}function Eh(e,t){return typeof e[t]==`string`?e[t]:void 0}function Dh(e){if(typeof e!=`object`||!e)return;let t=e.runId;return typeof t==`string`?t:void 0}function Oh(e){if(typeof e!=`object`||!e)return;let t=e;if(typeof t.runId==`string`)return t.runId;for(let e of[`run`,`step`,`hook`,`wait`]){let n=t[e];if(typeof n==`object`&&n){let e=n.runId;if(typeof e==`string`)return e}}}function kh(e,t,n){let r=`${e}.${t}`,i={},a=Ch[r],o=a===void 0?wh.has(r)?Dh(n[0]):void 0:Eh(n,a);if(o&&Object.assign(i,Em(o)),r===`world.steps.get`){let e=Eh(n,1);e&&Object.assign(i,Dm(e))}return i}function Ah(e,t){let n={};for(let r of Object.keys(t))if(typeof t[r]!=`function`)n[r]=t[r];else{let i=t[r],a=String(r);n[r]=async(...t)=>{let n=`${e}.${a}`;if(e===`world.events`&&a===`create`){let r=Th(t);r&&(n=`${e}.${a} ${r}`)}return fm(n,{kind:await pm(`CLIENT`)},async r=>{r?.setAttributes({...Sm(Sh.peerService),...Cm(Sh.rpcSystem),...wm(Sh.rpcService),...Tm(n),...kh(e,a,t)});let o=await i(...t),s=Oh(o);return s&&r?.setAttributes(Em(s)),o})}}return n}var z=class extends Error{constructor(e){super(e),this.name=`MultipartParseError`}};function jh(e){let t=new TextEncoder().encode(e);return(e,n=0)=>Buffer.prototype.indexOf.call(e,t,n)}function Mh(e){let t=new TextEncoder().encode(e),n={};for(let e=0;e<t.length;++e){let r=t[e];n[r]===void 0&&(n[r]=[]),n[r].push(e)}return function(e){let r=e.length-1;if(e[r]in n){let i=n[e[r]];for(let n=i.length-1;n>=0;--n)for(let a=i[n],o=r;a>=0&&e[o]===t[a];--a,--o)if(a===0)return o}return-1}}function Nh(e){let t=new TextDecoder(`iso-8859-1`).decode(e).trim().split(/\r?\n/),n=[];for(let e of t){let t=e.indexOf(`:`);if(t>0){let r=e.slice(0,t).trim(),i=e.slice(t+1).trim();n.push([r,i])}}return new Headers(n)}function Ph(e){let t=e.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!t)throw new z(`No boundary found in Content-Type header`);return t[1]??t[2]}var Fh=class{queue=[];waiters=[];finished=!1;cancelled=!1;error=null;enqueue(e){this.finished||this.cancelled||(this.waiters.length>0?this.waiters.shift().resolve(e):this.queue.push(e))}finish(e){if(!this.finished)for(this.finished=!0,this.error=e||null;this.waiters.length>0;){let t=this.waiters.shift();e?t.reject(e):t.resolve(null)}}cancel(){if(!(this.cancelled||this.finished))for(this.cancelled=!0;this.waiters.length>0;)this.waiters.shift().resolve(null)}async dequeue(){if(this.queue.length>0)return this.queue.shift();if(this.finished||this.cancelled){if(this.error)throw this.error;return null}return new Promise((e,t)=>{this.waiters.push({resolve:e,reject:t})})}get isTerminal(){return this.finished||this.cancelled}};async function*Ih(e,t){if(!e.body)throw new z(`Response body is null`);let n=e.headers.get(`content-type`);if(!n)throw new z(`Missing Content-Type header`);yield*new Lh(Ph(n),t).parseStream(e.body)}var Lh=class{boundary;findOpeningBoundary;openingBoundaryLength;findBoundary;findPartialTailBoundary;boundaryLength;findDoubleNewline;maxHeaderSize;maxBoundaryBuffer;state=0;buffer=null;currentHeaders=new Headers;currentPayloadController=null;constructor(e,t={}){this.boundary=e,this.findOpeningBoundary=jh(`--${e}`),this.openingBoundaryLength=2+e.length,this.findBoundary=jh(`\r
6
- --${e}`),this.findPartialTailBoundary=Mh(`\r
7
- --${e}`),this.boundaryLength=4+e.length,this.findDoubleNewline=jh(`\r
4
+ `);function ce(e){var t=_(i.join(e,`prebuilds`)).map(b).filter(ee(f,d)).sort(te)[0];if(t)return le(i.join(e,`prebuilds`,t.name))}function le(e){var t=_(e).map(ne).filter(re(u,l)).sort(ae(u))[0];if(t)return i.join(e,t.file)}};function _(e){try{return r.readdirSync(e)}catch{return[]}}function v(e,t){var n=_(e).filter(t);return n[0]&&i.join(e,n[0])}function y(e){return/\.node$/.test(e)}function b(e){var t=e.split(`-`);if(t.length===2){var n=t[0],r=t[1].split(`+`);if(n&&r.length&&r.every(Boolean))return{name:e,platform:n,architectures:r}}}function ee(e,t){return function(n){return n==null||n.platform!==e?!1:n.architectures.includes(t)}}function te(e,t){return e.architectures.length-t.architectures.length}function ne(e){var t=e.split(`.`),n=t.pop(),r={file:e,specificity:0};if(n===`node`){for(var i=0;i<t.length;i++){var a=t[i];if(a===`node`||a===`electron`||a===`node-webkit`)r.runtime=a;else if(a===`napi`)r.napi=!0;else if(a.slice(0,3)===`abi`)r.abi=a.slice(3);else if(a.slice(0,2)===`uv`)r.uv=a.slice(2);else if(a.slice(0,4)===`armv`)r.armv=a.slice(4);else if(a===`glibc`||a===`musl`)r.libc=a;else continue;r.specificity++}return r}}function re(e,t){return function(n){return!(n==null||n.runtime!==e&&!ie(n)||n.abi!==t&&!n.napi||n.uv&&n.uv!==h||n.armv&&n.armv!==m||n.libc&&n.libc!==p)}}function ie(e){return e.runtime===`node`&&e.napi}function ae(e){return function(t,n){return t.runtime===n.runtime?t.abi===n.abi?t.specificity===n.specificity?0:t.specificity>n.specificity?-1:1:t.abi?-1:1:t.runtime===e?-1:1}}function oe(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<`u`&&window.process&&window.process.type===`renderer`}function se(e){if(e!==`linux`)return!1;let{familySync:t,MUSL:n}=wp();return t()===n}g.parseTags=ne,g.matchTags=re,g.compareTags=ae,g.parseTuple=b,g.matchTuple=ee,g.compareTuples=te})),Ep=i(((e,t)=>{t.exports=Tp()(__dirname)}));if(!(process.env.CBOR_NATIVE_ACCELERATION_DISABLED!==void 0&&process.env.CBOR_NATIVE_ACCELERATION_DISABLED.toLowerCase()===`true`)){let t;try{t=typeof e==`function`?Ep():Jc(import.meta.url)(`cbor-extract`),t&&_f(t.extractStrings)}catch{}}var Dp=Vc();let Op,kp,Ap,jp;const Mp={connections:8,keepAliveTimeout:1e4},Np={...Mp,allowH2:!1,pipelining:1},Pp={...Mp,allowH2:!0,pipelining:100,initialWindowSize:4194304,connectionWindowSize:16777216},Fp={...Mp,allowH2:!0,pipelining:1},Ip={retryAfter:!0,statusCodes:[500,502,503,504]},Lp={retryAfter:!0,methods:[`PUT`],statusCodes:[429]},Rp={retryAfter:!0,methods:[`PUT`],statusCodes:[429,500,502,503,504]};function zp(){return process.env.WORKFLOW_H2_MULTIPLEX!==`0`}function Bp(e){if(!e||typeof e!=`object`||Array.isArray(e))return NaN;let t=e,n=t[`content-length`]??t[`Content-Length`];return typeof n==`string`||typeof n==`number`?Number(n):NaN}function Vp(e){return(t,n)=>{let r=t.body,i=!!r&&typeof r!=`string`&&!Buffer.isBuffer(r)&&typeof r[Symbol.asyncIterator]==`function`,a=Bp(t.headers);return!i||!(a>=0)||a>1048576?e({...t,idempotent:!0},n):((async()=>{try{let i=[];for await(let e of r)i.push(Buffer.from(e));e({...t,body:Buffer.concat(i),idempotent:!0},n)}catch(e){n.onError?.(e)}})(),!0)}}function Hp(e){return e?.dispatcher??Xp()}function Up(e){return e?.dispatcher??Zp()}function Wp(e){return e?.dispatcher??Qp()}function Gp(e){return e?.dispatcher??$p()}function Kp(e,t){return new Dp.RetryAgent(new Dp.Agent(e),t)}function qp(e){let t=new Dp.RetryAgent(new Dp.Agent({...Pp,...e}),Ip);return zp()?Jp(t,t.compose(Vp)):t}function Jp(e,t){return new Proxy(t,{get:(t,n)=>n===`close`||n===`destroy`?e[n].bind(e):t[n]})}function Yp(e,t){return new Dp.RetryAgent(new Dp.Agent({...Fp,...t}),e)}function Xp(){return Op??=Kp(Np,Ip),Op}function Zp(){return kp??=qp(),kp}function Qp(){return Ap??=Yp(Lp),Ap}function $p(){return jp??=Yp(Rp),jp}let em=null;async function tm(){return em||=import(`../../_chunks/workflow/src-Cj3P1ChQ.js`).then(e=>n(e.t(),1)).catch(e=>(typeof process<`u`&&typeof process.env.DEBUG==`string`&&(process.env.DEBUG.includes(`workflow:`)||process.env.DEBUG===`*`)&&console.warn(`[workflow] @opentelemetry/api unavailable — world-vercel spans disabled:`,e instanceof Error?e.message:e),null)),em}let nm=null;function rm(){return typeof process<`u`&&typeof process.env.DEBUG==`string`&&(process.env.DEBUG.includes(`workflow:`)||process.env.DEBUG===`*`)}let im=!1;function am(e,t){if(!(im||!rm())){im=!0;try{let n=globalThis[Symbol.for(`opentelemetry.js.api.1`)],r=e.trace.getTracerProvider(),i=r.getDelegate?.()??r,a=t.startSpan(`workflow.otel.probe.world_vercel`);console.warn(`[workflow:otel-diag] world-vercel`,JSON.stringify({globalRegistrationVersion:n?.version??null,providerCtor:r?.constructor?.name??null,delegateCtor:i?.constructor?.name??null,tracerCtor:t?.constructor?.name??null,probeCtor:a?.constructor?.name??null,probeRecording:a.isRecording()})),a.end()}catch(e){console.warn(`[workflow:otel-diag] world-vercel failed:`,e instanceof Error?e.message:e)}}}async function om(){return nm||=tm().then(e=>{if(!e)return null;let t=e.trace.getTracer(`workflow`);return am(e,t),t}),nm}async function sm(e,...t){let[n,r]=await Promise.all([om(),tm()]),{fn:i,opts:a}=typeof t[0]==`function`?{fn:t[0],opts:{}}:{fn:t[1],opts:t[0]};if(!i)throw Error(`Function to trace must be provided`);return!n||!r?await i():n.startActiveSpan(e,a,async e=>{try{let t=await i(e);return e.setStatus({code:r.SpanStatusCode.OK}),t}catch(t){throw e.setStatus({code:r.SpanStatusCode.ERROR,message:t.message}),t}finally{e.end()}})}async function cm(e){let t=await tm();if(t)return t.SpanKind[e]}async function lm(e){let t=await tm();if(!t)return;let n={};t.propagation.inject(t.context.active(),n);for(let[t,r]of Object.entries(n))e.set(t,r)}function um(...e){return t=>Object.fromEntries(e.map(e=>[e,t]))}const dm=um(`http.request.method`),fm=um(`url.full`),pm=um(`server.address`),mm=um(`server.port`),hm=um(`http.response.status_code`),gm=um(`error.type`),_m=um(`workflow.world.parse.format`),vm=um(`peer.service`),ym=um(`rpc.system`),bm=um(`rpc.service`),xm=um(`rpc.method`),Sm=um(`workflow.run.id`),Cm=um(`step.id`),wm=um(`workflow.stream.name`),Tm=um(`workflow.stream.operation`),Em=um(`workflow.stream.start_index`),Dm=()=>Bd(`WORKFLOW_REQUEST_TIMEOUT_MS`,6e4,{integer:!0,min:1}),Om=typeof process<`u`&&typeof process.env.DEBUG==`string`&&(process.env.DEBUG.includes(`workflow:`)||process.env.DEBUG===`*`),km=[`x-vercel-id`,`x-vercel-error`,`x-vercel-mitigated`];function Am(e){return km.flatMap(t=>{let n=e.get(t);return n?[`${t}=${n}`]:[]})}function jm(e){let t=Am(e);return t.length>0?` (${t.join(`; `)})`:``}function Mm(e,t,n,r){if(!Om)return;let i=Am(n.headers),a=i.length>0?`; ${i.join(`; `)}`:``;console.debug(`[workflow:world-vercel:http] ${e} ${t} -> ${n.status} (${r}ms${a})`)}function Nm(e,t,n){if(!process.env.DEBUG)return;let r=Array.from(n.entries()).filter(([e])=>e.toLowerCase()!==`authorization`).map(([e,t])=>`-H "${e}: ${t}"`).join(` `);console.error(`Failed to fetch, reproduce with:\ncurl -X ${e} ${r} "${t}"`)}function Pm(e){if(!e)return;let t=parseInt(e,10);return Number.isNaN(t)?void 0:t}function Fm(e,t,n={}){let{retryAfter:r,code:i,url:a,mitigated:d,details:p}=n;return e===409?new f(t):e===410?new l(t):e===412?new c(t,{retryAfter:r,details:p}):e===425?new s(t,{retryAfter:r}):e===429?Im(e,d)?new o(`${t} (x-vercel-mitigated=challenge)`,{url:a,status:e,code:`TRANSPORT`,retryAfter:r}):new u(t,{retryAfter:r}):new o(t,{url:a,status:e,code:i,retryAfter:r})}function Im(e,t){return e===429&&t===`challenge`}async function Lm(e){return e?.token??process.env.VERCEL_TOKEN??await(0,Ud.getVercelOidcToken)().catch(()=>null)}function Rm(e){try{let t=new URL(e);return{serverAddress:t.hostname,serverPort:t.port?parseInt(t.port,10):t.protocol===`https:`?443:80}}catch{return{}}}function zm(e){let{method:t,url:n,peerService:r}=e,{serverAddress:i,serverPort:a}=Rm(n);return{...dm(t),...fm(n),...i?pm(i):{},...a?mm(a):{},...vm(r),...ym(`http`),...bm(r)}}async function Bm(e){let{method:t,url:n,headers:r,body:i,dispatcher:a,peerService:s=`workflow-server`,timeoutMs:c=Dm(),signal:l,injectTraceContext:u=!0,cacheBust:d=!0,logLabel:f,buildError:p,spanName:m,attributes:h,durationAttribute:g}=e,_=f??n;return sm(m??`http ${t}`,{kind:await cm(`CLIENT`)},async e=>{if(m&&Om&&e){let t=e.spanContext();console.warn(`[workflow:otel-diag] span-open`,JSON.stringify({spanName:m,traceId:t.traceId,spanId:t.spanId,recording:e.isRecording()}))}e?.setAttributes(zm({method:t,url:n,peerService:s})),h&&e?.setAttributes(h),u&&await lm(r),d&&r.set(`X-Request-Time`,Date.now().toString());let f=c==null?void 0:AbortSignal.timeout(c),v=l&&f?AbortSignal.any([l,f]):l??f,y=Date.now(),b;try{b=await fetch(n,{method:t,headers:r,body:i,signal:v,dispatcher:a})}catch(r){let i=Date.now()-y;if(r instanceof Error&&(r.name===`TimeoutError`||r.name===`AbortError`)){let a=new o(`${t} ${_} timed out after ${i}ms`,{url:n,cause:r});throw e?.setAttributes({...gm(`TIMEOUT`)}),e?.recordException?.(a),a}throw r}let ee=Date.now()-y;if(Mm(t,_,b,ee),e?.setAttributes({...hm(b.status)}),g&&e?.setAttributes({[g]:ee}),!b.ok){if(e?.setAttributes({...gm(`HTTP ${b.status}`)}),Nm(t,n,r),p){let t=await p(b);throw e?.recordException?.(t),t}let i=await b.text().catch(()=>``),a=Fm(b.status,`${t} ${_} -> HTTP ${b.status}: ${b.statusText}${i?` ${i}`:``}${jm(b.headers)}`,{url:n,retryAfter:Pm(b.headers.get(`Retry-After`))});throw e?.recordException?.(a),a}return b})}const Vm=`5.0.0-beta.36`,Hm=new Set([`GET`,`HEAD`]),Um=new Set([`UND_ERR_REQ_RETRY`,`UND_ERR_SOCKET`,`UND_ERR_CONNECT`,`UND_ERR_CONNECT_TIMEOUT`,`UND_ERR_HEADERS_TIMEOUT`,`UND_ERR_BODY_TIMEOUT`,`UND_ERR_CLOSED`,`ECONNRESET`,`ECONNREFUSED`,`ENOTFOUND`,`EAI_AGAIN`,`EPIPE`]);function Wm(e){let t=e;for(let e=0;t!=null&&e<5;e++){if(typeof t==`object`&&`code`in t){let e=t.code;if(typeof e==`string`&&Um.has(e))return e}t=t?.cause}}const Gm=()=>process.env.VERCEL_WORKFLOW_SERVER_URL||``,Km=()=>process.env.WORKFLOW_TEST_LIMIT_OVERRIDES?.trim()||``;function qm(e){return e}const Jm=(...e)=>e.filter(Boolean).join(` `),Ym=()=>{let e=process.env.VERCEL_DEPLOYMENT_ID;return e?`@workflow/world-vercel/${Vm} node-${process.version} ${bl.platform()} (${bl.arch()}) ${e}`:`@workflow/world-vercel/${Vm} node-${process.version} ${bl.platform()} (${bl.arch()})`},Xm=e=>{let t=e?.projectConfig,n=Gm()||`https://vercel-workflow.com`,r=process.env.WORKFLOW_VERCEL_BACKEND_URL,i=!!(t?.projectId&&t?.teamId);return{baseUrl:i?r||`https://api.vercel.com/v1/workflow`:`${n}/api`,usingProxy:i}},Zm=e=>{let t=e?.projectConfig;return t?t.environment||`production`:process.env.VERCEL_TARGET_ENV||process.env.VERCEL_ENV||void 0},Qm=(e,t)=>{let n=e?.projectConfig,r=new Headers(e?.headers);r.set(`User-Agent`,Jm(Ym(),r.get(`User-Agent`)));let i=Km();i&&r.set(`x-workflow-test-limit-overrides`,i),n&&(r.set(`x-vercel-environment`,Zm(e)),n.projectId&&r.set(`x-vercel-project-id`,n.projectId),n.teamId&&r.set(`x-vercel-team-id`,n.teamId));let a=Gm();return a&&t.usingProxy&&r.set(`x-vercel-workflow-api-url`,a),r};async function $m(e){let{baseUrl:t,usingProxy:n}=Xm(e),r=Qm(e,{usingProxy:n});if(n){if(!e?.token)throw Error(`world-vercel: api-workflow proxy requested (${t}) but no Vercel auth token was provided. Pass one as \`config.token\` (the SDK reads it from \`WORKFLOW_VERCEL_AUTH_TOKEN\`).`);r.set(`Authorization`,`Bearer ${e.token}`)}else{let t;try{t=await(0,Ud.getVercelOidcToken)()}catch{}let n=e?.token??t;n&&r.set(`Authorization`,`Bearer ${n}`),t&&r.set(`x-vercel-trusted-oidc-idp-token`,t)}return{baseUrl:t,headers:r,usingProxy:n}}async function L({endpoint:e,options:t={},config:n={},schema:r,data:i,onResponse:a,retryConnectTimeout:s=!1}){let c=t.method||`GET`,{baseUrl:l,headers:u}=await $m(n),d=`${l}${e}`;return sm(`http ${c}`,{kind:await cm(`CLIENT`)},async l=>{l?.setAttributes(zm({method:c,url:d,peerService:`workflow-server`})),u.set(`Accept`,`application/cbor`),await lm(u);let f;i!==void 0&&(u.set(`Content-Type`,`application/cbor`),f=hp(i));let p=Hm.has(c.toUpperCase()),m,h=``;for(let r=0;;r++){u.set(`X-Request-Time`,Date.now().toString());let i=AbortSignal.timeout(Dm()),g=t.signal?AbortSignal.any([t.signal,i]):i,_=new Request(d,{...t,body:f,headers:u,signal:g}),v=Date.now(),y;try{y=await fetch(_,{dispatcher:Hp(n)})}catch(t){let n=Date.now()-v;if(t instanceof Error&&(t.name===`TimeoutError`||t.name===`AbortError`)){let r=new o(`${c} ${e} timed out after ${n}ms`,{url:d,code:`TIMEOUT`,cause:t});throw l?.setAttributes({...gm(`TIMEOUT`)}),l?.recordException?.(r),r}let i=Wm(t);if(i){if(s&&p&&i===`UND_ERR_CONNECT_TIMEOUT`&&r===0){await new Promise(e=>setTimeout(e,100));continue}let a=new o(`${c} ${e} transport failure after ${n}ms (${i})`,{url:d,code:`TRANSPORT`,cause:t});throw l?.setAttributes({...gm(`TRANSPORT`)}),l?.recordException?.(a),a}throw t}let b=Date.now()-v;if(h=jm(y.headers),Mm(c,e,y,b),l?.setAttributes({...hm(y.status)}),!y.ok){let t=await th(y).then(e=>e.data).catch(()=>({})),n=t.code??t.error;Nm(_.method,d,u);let r=Pm(y.headers.get(`Retry-After`)),i=(t.message||`${_.method} ${e} -> HTTP ${y.status}: ${y.statusText}`)+h,a=Fm(y.status,i,{url:d,code:n,retryAfter:r,mitigated:y.headers.get(`x-vercel-mitigated`)});throw l?.setAttributes({...gm(n||`HTTP ${y.status}`)}),l?.recordException?.(a),a}a?.(y);try{m=await sm(`world.parse`,async e=>{let t=await th(y),n=(y.headers.get(`Content-Type`)||``).includes(`application/cbor`);return e?.setAttributes({..._m(n?`cbor`:`json`)}),t});break}catch(t){if(p&&r<2){let n=100*2**r;l?.setAttributes({...gm(`PARSE_ERROR_RETRYING`)}),Om&&console.debug(`[workflow:world-vercel:http] ${c} ${e} body parse failed (attempt ${r+1}/3); retrying in ${n}ms: ${t}`),await new Promise(e=>setTimeout(e,n));continue}let n=y.headers.get(`Content-Type`)||`unknown`;throw new o(`Failed to parse response body for ${c} ${e}${h} (Content-Type: ${n}):\n\n${t}`,{url:d,code:`PARSE_ERROR`,cause:t})}}return await sm(`world.validate`,async()=>{let t=r.safeParse(m.data);if(!t.success){let n=t.error.issues.map(e=>` ${e.path.length>0?e.path.join(`.`):`<root>`}: ${e.message}`).join(`
5
+ `),r=process.env.DEBUG?`\n\nResponse context: ${m.getDebugContext()}`:``;throw new o(`Schema validation failed for ${c} ${e}${h}:\n${n}${r}`,{url:d,code:`SCHEMA_VALIDATION`,cause:t.error})}return t.data})})}function eh(e){let t=_l(e,{depth:3,maxArrayLength:10,breakLength:120});return t.length>500?`${t.slice(0,500)}...`:t}async function th(e){let t=e.headers.get(`Content-Type`)||``;if(t.includes(`application/cbor`)){let n=await e.arrayBuffer(),r=Hf(new Uint8Array(n));return{data:r,getDebugContext:()=>`Content-Type: ${t}, ${n.byteLength} bytes (CBOR), preview: ${eh(r)}`}}let n=await e.text(),r=JSON.parse(n);return{data:r,getDebugContext:()=>`Content-Type: ${t}, ${n.length} bytes, preview: ${eh(r)}`}}function nh(e,t){t?.limit&&e.set(`limit`,t.limit.toString()),t?.cursor&&e.set(`cursor`,t.cursor),t?.sortOrder&&e.set(`sortOrder`,t.sortOrder)}function rh(e){let t=e.toString();return t?`?${t}`:``}function ih(e,t){t.workflowName&&e.set(`workflowName`,t.workflowName),t.startTime&&t.endTime&&(e.set(`startTime`,t.startTime),e.set(`endTime`,t.endTime)),nh(e,t.pagination)}function ah(e){return{runs:{get(t){return L({endpoint:`/v2/analytics/runs/${encodeURIComponent(t)}`,config:e,schema:Oc})},list(t={}){let n=new URLSearchParams;return t.workflowName&&n.set(`workflowName`,t.workflowName),t.status&&n.set(`status`,t.status),t.startTime&&t.endTime&&(n.set(`startTime`,t.startTime),n.set(`endTime`,t.endTime)),t.attributes&&Object.keys(t.attributes).length>0&&n.set(`attributes`,JSON.stringify(t.attributes)),nh(n,t.pagination),L({endpoint:`/v2/analytics/runs${rh(n)}`,config:e,schema:kc(Oc)})}},attributes:{list(t={}){let n=new URLSearchParams;return ih(n,t),L({endpoint:`/v2/analytics/attributes${rh(n)}`,config:e,schema:kc(Ec)})}},steps:{get(t,n){return L({endpoint:`/v2/analytics/runs/${encodeURIComponent(t)}/steps/${encodeURIComponent(n)}`,config:e,schema:Dc})},list(t){let n=new URLSearchParams;return nh(n,t.pagination),L({endpoint:`/v2/analytics/runs/${encodeURIComponent(t.runId)}/steps${rh(n)}`,config:e,schema:kc(Dc)})}},events:{get(t,n){return L({endpoint:`/v2/analytics/runs/${encodeURIComponent(t)}/events/${encodeURIComponent(n)}`,config:e,schema:Pc})},list(t){let n=new URLSearchParams;return t.eventType&&n.set(`eventType`,t.eventType),t.correlationId&&n.set(`correlationId`,t.correlationId),nh(n,t.pagination),L({endpoint:`/v2/analytics/runs/${encodeURIComponent(t.runId)}/events${rh(n)}`,config:e,schema:kc(Pc)})},listByCorrelationId(t){let n=new URLSearchParams;return n.set(`correlationId`,t.correlationId),nh(n,t.pagination),L({endpoint:`/v2/analytics/runs/${encodeURIComponent(t.runId)}/events${rh(n)}`,config:e,schema:kc(Pc)})}},hooks:{get(t,n){let r=new URLSearchParams;return n?.runId&&r.set(`runId`,n.runId),L({endpoint:`/v2/analytics/hooks/${encodeURIComponent(t)}${rh(r)}`,config:e,schema:Nc})},list(t){let n=new URLSearchParams;return n.set(`runId`,t.runId),nh(n,t.pagination),L({endpoint:`/v2/analytics/hooks${rh(n)}`,config:e,schema:kc(Nc)})}},waits:{get(t,n){return L({endpoint:`/v2/analytics/runs/${encodeURIComponent(t)}/waits/${encodeURIComponent(n)}`,config:e,schema:Cc})},list(t){let n=new URLSearchParams;return t.status&&n.set(`status`,t.status),nh(n,t.pagination),L({endpoint:`/v2/analytics/runs/${encodeURIComponent(t.runId)}/waits${rh(n)}`,config:e,schema:kc(Cc)})}}}}const oh=`0123456789ABCDEFGHJKMNPQRSTVWXYZ`,sh=(()=>{let e=new Int8Array(128).fill(-1);for(let t=0;t<32;t++)e[oh.charCodeAt(t)]=t;for(let t=0;t<32;t++){let n=oh[t].toLowerCase();n!==oh[t]&&(e[n.charCodeAt(0)]=t)}return e})();function ch(e){if(typeof e!=`string`)throw TypeError(`Expected ULID string, got ${typeof e}`);if(e.length!==26)throw Error(`Invalid ULID length: expected 26, got ${e.length}`);let t=new Uint8Array(26);for(let n=0;n<26;n++){let r=e.charCodeAt(n),i=r<128?sh[r]:-1;if(i<0)throw Error(`Invalid Crockford-Base32 character at index ${n}: ${JSON.stringify(e[n])}`);t[n]=i}if(t[0]&24)throw Error(`Invalid ULID: top 2 bits must be zero (first char > '7'): ${JSON.stringify(e[0])}`);let n=new Uint8Array(16),r=t[0]&7,i=3,a=0;for(let e=1;e<26;e++)for(r=r<<5|t[e],i+=5;i>=8;)i-=8,n[a++]=r>>i&255;if(a!==16||i!==0)throw Error(`Internal error: ULID bit packing did not consume cleanly`);return n}function lh(e){if(e.length!==16)throw Error(`Invalid byte length: expected 16, got ${e.length}`);let t=0,n=0;t=0,n=2;let r=``;for(let i=0;i<16;i++)for(t=t<<8|e[i],n+=8;n>=5;)n-=5,r+=oh[t>>n&31];if(r.length!==26||n!==0)throw Error(`Internal error: ULID bit packing did not flush cleanly`);return r}const uh={unknown:0,iad1:1,sfo1:2,pdx1:3,cle1:4,yul1:5,gru1:6,dub1:7,lhr1:8,cdg1:9,fra1:10,bru1:11,arn1:12,hel1:13,zrh1:14,cpt1:15,dxb1:16,bom1:17,sin1:18,hkg1:19,hnd1:20,icn1:21,kix1:22,syd1:23},dh=new Map(Object.entries(uh).filter(e=>e[0]!==`unknown`).map(([e,t])=>[t,e]));function fh(e){return dh.get(e)??null}function ph(e){return e!==void 0&&e!==`unknown`&&Object.hasOwn(uh,e)}function mh(e){return typeof e==`string`&&e!==`unknown`&&Object.hasOwn(uh,e)}function hh(e,t,n={}){let r;if(typeof t==`number`){if(!Number.isInteger(t)||t<0||t>63)throw RangeError(`regionId must be an integer in [0, 63]; got ${t}`);r=t}else if(mh(t))r=uh[t];else throw Error(`Unknown region: ${String(t)}`);let i=n.version??1;if(!Number.isInteger(i)||i<0||i>31)throw RangeError(`version must be an integer in [0, 31]; got ${i}`);let a=ch(e);a[0]|=128;let o=(r&63)<<2,s=i>>3&3,c=(i&7)<<5;return a[6]=a[6]&-256|o|s,a[7]=a[7]&-225|c,lh(a)}function gh(e){let t=ch(e),n=(t[0]&128)!=0;t[0]&=-129;let r=lh(t);if(!n)return{tagged:!1,ulid:r,version:null,regionId:null,region:null};let i=(t[6]&252)>>2;return{tagged:!0,ulid:r,version:(t[6]&3)<<3|(t[7]&224)>>5,regionId:i,region:fh(i)}}const _h=mo();let vh;function yh(e){let t=ch(e),n=5,r=1;for(;n>=0&&r>0;){let e=t[n]+r;t[n]=e&255,r=e>>8,n--}if(r>0)throw Error(`ULID space exhausted`);return lh(t)}function bh(e){return typeof e!=`string`||e===``||e===`unknown`?null:Object.hasOwn(uh,e)?e:null}function xh(e){return bh(e?.region)??bh(process.env.VERCEL_REGION)??`iad1`}function Sh(e){let t=uh[xh(e)],n=hh(_h(),t);if(vh!==void 0)for(;n<=vh;)n=hh(yh(vh),t);return vh=n,n}function Ch(e){let t=e.startsWith(`wrun_`)?e.slice(5):e;try{let e=gh(t);return e.tagged&&e.region?e.region:`iad1`}catch{return null}}function wh(e){let t=e.runId;return typeof t!=`string`||t.length===0?null:{region:Ch(t)}}async function Th(e,t,n){if(e.length!==32)throw Error(`Invalid deployment key length: expected 32 bytes for AES-256, got ${e.length} bytes`);if(!t||typeof t!=`string`)throw Error(`projectId must be a non-empty string`);let r=await ml.subtle.importKey(`raw`,e,`HKDF`,!1,[`deriveBits`]),i=new TextEncoder().encode(`${t}|${n}`),a=await ml.subtle.deriveBits({name:`HKDF`,hash:`SHA-256`,salt:new Uint8Array(32),info:i},r,256);return new Uint8Array(a)}async function Eh(e,t,n,r){let i=await Lm({token:r?.token});if(!i)throw Error(`Cannot fetch run key: no OIDC token or VERCEL_TOKEN available`);let a=new URLSearchParams({projectId:t,runId:n});r?.teamId&&a.set(`teamId`,r.teamId);let o=await(await Bm({method:`GET`,url:`https://api.vercel.com/v1/workflow/run-key/${e}?${a}`,headers:new Headers({Authorization:`Bearer ${i}`}),dispatcher:Hp({dispatcher:r?.dispatcher}),peerService:`vercel-api`,timeoutMs:null,buildError:async t=>{let r;try{r=await t.text()}catch{r=`<unable to read response body>`}return Error(`Failed to fetch run key for ${n} (deployment ${e}): HTTP ${t.status} ${t.statusText}${r?` — ${r}`:``}`)}})).json(),s=Wa({key:ct().nullable()}).safeParse(o);if(!s.success)throw Error(`Invalid response from Vercel API: expected { key: string | null }. Zod error: ${s.error.message}`);if(s.data.key!==null)return Buffer.from(s.data.key,`base64`)}function Dh(e,t,n,r){if(!e)return;let i=process.env.VERCEL===`1`,a;function o(){if(a)return a;let e=process.env.VERCEL_DEPLOYMENT_KEY;if(e)return a=Buffer.from(e,`base64`),a}return async function(a,s){let c=typeof a==`string`?a:a.runId,l=typeof a==`string`?s?.deploymentId:a.deploymentId;if(i&&(!l||l===process.env.VERCEL_DEPLOYMENT_ID)){let t=o();return t?Th(t,e,c):void 0}if(l)return Eh(l,e,c,{token:n,teamId:t,dispatcher:r})}}async function Oh(){let{getDeadline:e}=await import(`../../_chunks/workflow/functions-xMPAeWFr.js`).then(e=>n(e.default,1));return e()}const kh={peerService:`workflow-server`,rpcSystem:`http`,rpcService:`workflow-server`},Ah={"world.runs.get":0,"world.runs.experimentalSetAttributes":0,"world.steps.get":0,"world.events.create":0,"world.events.get":0},jh=new Set([`world.steps.list`,`world.events.list`,`world.hooks.list`]);function Mh(e){if(e.length>=2&&typeof e[1]==`object`&&e[1]!==null){let t=e[1];if(typeof t.eventType==`string`)return t.eventType}}function Nh(e,t){return typeof e[t]==`string`?e[t]:void 0}function Ph(e){if(typeof e!=`object`||!e)return;let t=e.runId;return typeof t==`string`?t:void 0}function Fh(e){if(typeof e!=`object`||!e)return;let t=e;if(typeof t.runId==`string`)return t.runId;for(let e of[`run`,`step`,`hook`,`wait`]){let n=t[e];if(typeof n==`object`&&n){let e=n.runId;if(typeof e==`string`)return e}}}function Ih(e,t,n){let r=`${e}.${t}`,i={},a=Ah[r],o=a===void 0?jh.has(r)?Ph(n[0]):void 0:Nh(n,a);if(o&&Object.assign(i,Sm(o)),r===`world.steps.get`){let e=Nh(n,1);e&&Object.assign(i,Cm(e))}return i}function Lh(e,t){let n={};for(let r of Object.keys(t))if(typeof t[r]!=`function`)n[r]=t[r];else{let i=t[r],a=String(r);n[r]=async(...t)=>{let n=`${e}.${a}`;if(e===`world.events`&&a===`create`){let r=Mh(t);r&&(n=`${e}.${a} ${r}`)}return sm(n,{kind:await cm(`CLIENT`)},async r=>{r?.setAttributes({...vm(kh.peerService),...ym(kh.rpcSystem),...bm(kh.rpcService),...xm(n),...Ih(e,a,t)});let o=await i(...t),s=Fh(o);return s&&r?.setAttributes(Sm(s)),o})}}return n}var R=class extends Error{constructor(e){super(e),this.name=`MultipartParseError`}};function Rh(e){let t=new TextEncoder().encode(e);return(e,n=0)=>Buffer.prototype.indexOf.call(e,t,n)}function zh(e){let t=new TextEncoder().encode(e),n={};for(let e=0;e<t.length;++e){let r=t[e];n[r]===void 0&&(n[r]=[]),n[r].push(e)}return function(e){let r=e.length-1;if(e[r]in n){let i=n[e[r]];for(let n=i.length-1;n>=0;--n)for(let a=i[n],o=r;a>=0&&e[o]===t[a];--a,--o)if(a===0)return o}return-1}}function Bh(e){let t=new TextDecoder(`iso-8859-1`).decode(e).trim().split(/\r?\n/),n=[];for(let e of t){let t=e.indexOf(`:`);if(t>0){let r=e.slice(0,t).trim(),i=e.slice(t+1).trim();n.push([r,i])}}return new Headers(n)}function Vh(e){let t=e.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!t)throw new R(`No boundary found in Content-Type header`);return t[1]??t[2]}var Hh=class{queue=[];waiters=[];finished=!1;cancelled=!1;error=null;enqueue(e){this.finished||this.cancelled||(this.waiters.length>0?this.waiters.shift().resolve(e):this.queue.push(e))}finish(e){if(!this.finished)for(this.finished=!0,this.error=e||null;this.waiters.length>0;){let t=this.waiters.shift();e?t.reject(e):t.resolve(null)}}cancel(){if(!(this.cancelled||this.finished))for(this.cancelled=!0;this.waiters.length>0;)this.waiters.shift().resolve(null)}async dequeue(){if(this.queue.length>0)return this.queue.shift();if(this.finished||this.cancelled){if(this.error)throw this.error;return null}return new Promise((e,t)=>{this.waiters.push({resolve:e,reject:t})})}get isTerminal(){return this.finished||this.cancelled}};async function*Uh(e,t){if(!e.body)throw new R(`Response body is null`);let n=e.headers.get(`content-type`);if(!n)throw new R(`Missing Content-Type header`);yield*new Wh(Vh(n),t).parseStream(e.body)}var Wh=class{boundary;findOpeningBoundary;openingBoundaryLength;findBoundary;findPartialTailBoundary;boundaryLength;findDoubleNewline;maxHeaderSize;maxBoundaryBuffer;state=0;buffer=null;currentHeaders=new Headers;currentPayloadController=null;constructor(e,t={}){this.boundary=e,this.findOpeningBoundary=Rh(`--${e}`),this.openingBoundaryLength=2+e.length,this.findBoundary=Rh(`\r
6
+ --${e}`),this.findPartialTailBoundary=zh(`\r
7
+ --${e}`),this.boundaryLength=4+e.length,this.findDoubleNewline=Rh(`\r
8
8
  \r
9
- `),this.maxHeaderSize=t.maxHeaderSize??65536,this.maxBoundaryBuffer=t.maxBoundaryBuffer??8192}async*parseStream(e){let t=e.getReader(),n=new Fh,r=this.startProducer(t,n);try{yield*this.consumeMessages(n)}finally{n.cancel(),this.closeCurrentPayload();try{await t.cancel()}catch{}await r}}async startProducer(e,t){try{for(;!t.isTerminal;){let n;try{n=await e.read()}catch(e){if(e instanceof Error&&(e.name===`AbortError`||e.constructor.name===`AbortError`||e.name===`TimeoutError`||e.constructor.name===`TimeoutError`))break;throw e}let{done:r,value:i}=n;if(r){if(this.buffer!==null&&this.buffer.length>0){let e=this.write(new Uint8Array);for(let n of e){if(t.isTerminal)break;t.enqueue(n)}}if(this.state!==4)throw this.state===0?new z(`Invalid multipart stream: missing initial boundary`):new z(`Unexpected end of stream`);break}if(!(i instanceof Uint8Array))throw new z(`Invalid chunk type: expected Uint8Array, got ${typeof i}`);let a=this.write(i);for(let e of a){if(t.isTerminal)break;t.enqueue(e)}}t.isTerminal||t.finish()}catch(e){this.closeCurrentPayload(e),t.isTerminal||t.finish(e)}finally{try{e.releaseLock()}catch{}}}async*consumeMessages(e){for(;;){let t=await e.dequeue();if(t===null)break;yield t}}write(e){let t=[];if(this.state===4)throw new z(`Unexpected data after end of stream`);let n=0,r=e.length;if(this.buffer!==null){let t=this.buffer.length,n=t+r;if(this.state===2){if(n>this.maxHeaderSize)throw new z(`Buffer size limit exceeded: ${n} bytes > ${this.maxHeaderSize} bytes. This may indicate malformed multipart data with oversized headers.`)}else if(t>this.maxBoundaryBuffer)throw new z(`Boundary buffer limit exceeded: ${t} bytes > ${this.maxBoundaryBuffer} bytes. This may indicate malformed multipart data with invalid boundaries.`);let i=new Uint8Array(n);i.set(this.buffer,0),i.set(e,t),e=i,r=e.length,this.buffer=null}if(r===0&&this.state===0)throw new z(`Invalid multipart stream: missing initial boundary`);for(;;){if(this.state===3){if(r-n<this.boundaryLength){let t=e.subarray(n);if(t.length>this.maxBoundaryBuffer)throw new z(`Boundary buffer limit exceeded: ${t.length} > ${this.maxBoundaryBuffer}`);this.buffer=t;break}let t=this.findBoundary(e,n);if(t===-1){let t=this.findPartialTailBoundary(e);if(t===-1)this.writeBody(n===0?e:e.subarray(n));else{this.writeBody(e.subarray(n,t));let r=e.subarray(t);if(r.length>this.maxBoundaryBuffer)throw new z(`Partial boundary too large: ${r.length} > ${this.maxBoundaryBuffer}`);this.buffer=r}break}this.writeBody(e.subarray(n,t)),this.finishMessage(),n=t+this.boundaryLength,this.state=1}if(this.state===1){if(r-n<2){let t=e.subarray(n);if(t.length>this.maxBoundaryBuffer)throw new z(`After-boundary buffer limit exceeded: ${t.length} > ${this.maxBoundaryBuffer}`);this.buffer=t;break}if(e[n]===45&&e[n+1]===45){this.state=4;break}if(e[n]===13&&e[n+1]===10)n+=2;else if(e[n]===10)n+=1;else throw new z(`Invalid character after boundary: expected CRLF or LF, got 0x${e[n].toString(16)}`);this.state=2}if(this.state===2){if(r-n<4){let t=e.subarray(n);if(t.length>this.maxHeaderSize)throw new z(`Header buffer limit exceeded: ${t.length} > ${this.maxHeaderSize}`);this.buffer=t;break}let i=this.findDoubleNewline(e,n),a=4;if(i===-1&&(i=jh(`
9
+ `),this.maxHeaderSize=t.maxHeaderSize??65536,this.maxBoundaryBuffer=t.maxBoundaryBuffer??8192}async*parseStream(e){let t=e.getReader(),n=new Hh,r=this.startProducer(t,n);try{yield*this.consumeMessages(n)}finally{n.cancel(),this.closeCurrentPayload();try{await t.cancel()}catch{}await r}}async startProducer(e,t){try{for(;!t.isTerminal;){let n;try{n=await e.read()}catch(e){if(e instanceof Error&&(e.name===`AbortError`||e.constructor.name===`AbortError`||e.name===`TimeoutError`||e.constructor.name===`TimeoutError`))break;throw e}let{done:r,value:i}=n;if(r){if(this.buffer!==null&&this.buffer.length>0){let e=this.write(new Uint8Array);for(let n of e){if(t.isTerminal)break;t.enqueue(n)}}if(this.state!==4)throw this.state===0?new R(`Invalid multipart stream: missing initial boundary`):new R(`Unexpected end of stream`);break}if(!(i instanceof Uint8Array))throw new R(`Invalid chunk type: expected Uint8Array, got ${typeof i}`);let a=this.write(i);for(let e of a){if(t.isTerminal)break;t.enqueue(e)}}t.isTerminal||t.finish()}catch(e){this.closeCurrentPayload(e),t.isTerminal||t.finish(e)}finally{try{e.releaseLock()}catch{}}}async*consumeMessages(e){for(;;){let t=await e.dequeue();if(t===null)break;yield t}}write(e){let t=[];if(this.state===4)throw new R(`Unexpected data after end of stream`);let n=0,r=e.length;if(this.buffer!==null){let t=this.buffer.length,n=t+r;if(this.state===2){if(n>this.maxHeaderSize)throw new R(`Buffer size limit exceeded: ${n} bytes > ${this.maxHeaderSize} bytes. This may indicate malformed multipart data with oversized headers.`)}else if(t>this.maxBoundaryBuffer)throw new R(`Boundary buffer limit exceeded: ${t} bytes > ${this.maxBoundaryBuffer} bytes. This may indicate malformed multipart data with invalid boundaries.`);let i=new Uint8Array(n);i.set(this.buffer,0),i.set(e,t),e=i,r=e.length,this.buffer=null}if(r===0&&this.state===0)throw new R(`Invalid multipart stream: missing initial boundary`);for(;;){if(this.state===3){if(r-n<this.boundaryLength){let t=e.subarray(n);if(t.length>this.maxBoundaryBuffer)throw new R(`Boundary buffer limit exceeded: ${t.length} > ${this.maxBoundaryBuffer}`);this.buffer=t;break}let t=this.findBoundary(e,n);if(t===-1){let t=this.findPartialTailBoundary(e);if(t===-1)this.writeBody(n===0?e:e.subarray(n));else{this.writeBody(e.subarray(n,t));let r=e.subarray(t);if(r.length>this.maxBoundaryBuffer)throw new R(`Partial boundary too large: ${r.length} > ${this.maxBoundaryBuffer}`);this.buffer=r}break}this.writeBody(e.subarray(n,t)),this.finishMessage(),n=t+this.boundaryLength,this.state=1}if(this.state===1){if(r-n<2){let t=e.subarray(n);if(t.length>this.maxBoundaryBuffer)throw new R(`After-boundary buffer limit exceeded: ${t.length} > ${this.maxBoundaryBuffer}`);this.buffer=t;break}if(e[n]===45&&e[n+1]===45){this.state=4;break}if(e[n]===13&&e[n+1]===10)n+=2;else if(e[n]===10)n+=1;else throw new R(`Invalid character after boundary: expected CRLF or LF, got 0x${e[n].toString(16)}`);this.state=2}if(this.state===2){if(r-n<4){let t=e.subarray(n);if(t.length>this.maxHeaderSize)throw new R(`Header buffer limit exceeded: ${t.length} > ${this.maxHeaderSize}`);this.buffer=t;break}let i=this.findDoubleNewline(e,n),a=4;if(i===-1&&(i=Rh(`
10
10
 
11
- `)(e,n),a=2),i===-1){let t=e.subarray(n);if(t.length>this.maxHeaderSize)throw new z(`Headers too large: ${t.length} > ${this.maxHeaderSize} bytes`);this.buffer=t;break}let o=e.subarray(n,i);this.currentHeaders=Nh(o);let s=this.createStreamingMessage();t.push(s),n=i+a,this.state=3;continue}if(this.state===0){if(r<this.openingBoundaryLength){if(e.length>this.maxBoundaryBuffer)throw new z(`Initial chunk too large for boundary detection: ${e.length} > ${this.maxBoundaryBuffer}`);this.buffer=e;break}if(this.findOpeningBoundary(e)!==0)throw new z(`Invalid multipart stream: missing initial boundary`);n=this.openingBoundaryLength,this.state=1}}return t}createStreamingMessage(){let e=new Headers(this.currentHeaders),t=new ReadableStream({start:e=>{this.currentPayloadController=e}});return this.currentHeaders=new Headers,{headers:e,payload:t}}writeBody(e){this.currentPayloadController&&this.currentPayloadController.enqueue(e)}finishMessage(){this.currentPayloadController&&=(this.currentPayloadController.close(),null)}closeCurrentPayload(e){if(this.currentPayloadController){try{e?this.currentPayloadController.error(e):this.currentPayloadController.close()}catch{}this.currentPayloadController=null}}};const Rh=(e,t,n)=>{let r=e instanceof RegExp?zh(e,n):e,i=t instanceof RegExp?zh(t,n):t,a=r!==null&&i!=null&&Bh(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},zh=(e,t)=>{let n=t.match(e);return n?n[0]:null},Bh=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},Vh=`\0SLASH`+Math.random()+`\0`,Hh=`\0OPEN`+Math.random()+`\0`,Uh=`\0CLOSE`+Math.random()+`\0`,Wh=`\0COMMA`+Math.random()+`\0`,Gh=`\0PERIOD`+Math.random()+`\0`,Kh=new RegExp(Vh,`g`),qh=new RegExp(Hh,`g`),Jh=new RegExp(Uh,`g`),Yh=new RegExp(Wh,`g`),Xh=new RegExp(Gh,`g`),Zh=/\\\\/g,Qh=/\\{/g,$h=/\\}/g,eg=/\\,/g,tg=/\\\./g;function ng(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function rg(e){return e.replace(Zh,Vh).replace(Qh,Hh).replace($h,Uh).replace(eg,Wh).replace(tg,Gh)}function ig(e){return e.replace(Kh,`\\`).replace(qh,`{`).replace(Jh,`}`).replace(Yh,`,`).replace(Xh,`.`)}function ag(e){if(!e)return[``];let t=[],n=Rh(`{`,`}`,e);if(!n)return e.split(`,`);let{pre:r,body:i,post:a}=n,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;let s=ag(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function og(e,t={}){if(!e)return[];let{max:n=1e5}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),dg(rg(e),n,!0).map(ig)}function sg(e){return`{`+e+`}`}function cg(e){return/^-?0\d/.test(e)}function lg(e,t){return e<=t}function ug(e,t){return e>=t}function dg(e,t,n){let r=[];for(;;){let i=Rh(`{`,`}`,e);if(!i)return[e];let a=i.pre;if(/\$$/.test(i.pre)){let e=i.post.length?dg(i.post,t,!1):[``];for(let n=0;n<e.length&&n<t;n++){let t=a+`{`+i.body+`}`+e[n];r.push(t)}return r}let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),s=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),c=o||s,l=i.body.indexOf(`,`)>=0;if(!c&&!l){if(i.post.match(/,(?!,).*\}/)){e=i.pre+`{`+i.body+Uh+i.post,n=!0;continue}return[e]}let u=i.post.length?dg(i.post,t,!1):[``],d;if(c)d=i.body.split(/\.\./);else if(d=ag(i.body),d.length===1&&d[0]!==void 0&&(d=dg(d[0],t,!1).map(sg),d.length===1))return u.map(e=>i.pre+d[0]+e);let f;if(c&&d[0]!==void 0&&d[1]!==void 0){let e=ng(d[0]),n=ng(d[1]),r=Math.max(d[0].length,d[1].length),i=d.length===3&&d[2]!==void 0?Math.max(Math.abs(ng(d[2])),1):1,a=lg;n<e&&(i*=-1,a=ug);let o=d.some(cg);f=[];for(let c=e;a(c,n)&&f.length<t;c+=i){let e;if(s)e=String.fromCharCode(c),e===`\\`&&(e=``);else if(e=String(c),o){let t=r-e.length;if(t>0){let n=Array(t+1).join(`0`);e=c<0?`-`+n+e.slice(1):n+e}}f.push(e)}}else{f=[];for(let e=0;e<d.length;e++)f.push.apply(f,dg(d[e],t,!1))}for(let e=0;e<f.length;e++)for(let i=0;i<u.length&&r.length<t;i++){let t=a+f[e]+u[i];(!n||c||t)&&r.push(t)}return r}}const fg=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},pg={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},mg=e=>e.replace(/[[\]\\-]/g,`\\$&`),hg=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),gg=e=>e.join(``),_g=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(pg))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(mg(d)+`-`+mg(t)):t===d&&r.push(mg(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(mg(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(mg(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let e=r[0].length===2?r[0].slice(-1):r[0];return[hg(e),!1,u-n,!1]}let f=`[`+(l?`^`:``)+gg(r)+`]`,p=`[`+(l?``:`^`)+gg(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},vg=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\])\]/g,`$1$2`).replace(/\\([^/])/g,`$1`):t?e.replace(/\[([^/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,`$1$2`).replace(/\\([^/{}])/g,`$1`);var yg;const bg=new Set([`!`,`?`,`+`,`*`,`@`]),xg=e=>bg.has(e),Sg=e=>xg(e.type),Cg=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),wg=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),Tg=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),Eg=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),Dg=`(?!\\.)`,Og=new Set([`[`,`.`]),kg=new Set([`..`,`.`]),Ag=new Set(`().*{}+?[]^$\\!`),jg=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),Mg=`[^/]+?`;let Ng=0;var Pg=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;id=++Ng;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for(`nodejs.util.inspect.custom`)](){return{"@@type":`AST`,id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#r.length,parts:this.#r}}constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#l=this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==``){if(typeof t!=`string`&&!(t instanceof yg&&t.#i===this))throw Error(`invalid part: `+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#r[t];if(!(n instanceof yg&&n.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new yg(this.type,e);for(let e of this.#r)t.copyIn(e);return t}static#f(e,t,n,r,i){let a=r.maxExtglobRecursion??2,o=!1,s=!1,c=-1,l=!1;if(t.type===null){let u=n,d=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,d+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),d+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,d+=n;continue}if(!r.noext&&xg(n)&&e.charAt(u)===`(`&&i<=a){t.push(d),d=``;let a=new yg(n,t);u=yg.#f(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new yg(null,t),f=[],p=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,p+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),p+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,p+=n;continue}if(!r.noext&&xg(n)&&e.charAt(u)===`(`&&(i<=a||t&&t.#h(n))){let a=t&&t.#h(n)?0:1;d.push(p),p=``;let o=new yg(n,d);d.push(o),u=yg.#f(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new yg(null,t);continue}if(n===`)`)return p===``&&t.#r.length===0&&(t.#u=!0),d.push(p),p=``,t.push(...f,d),u;p+=n}return t.type=null,t.#t=void 0,t.#r=[e.substring(n-1)],u}#p(e){return this.#m(e,wg)}#m(e,t=Cg){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null)return!1;let n=e.#r[0];return!n||typeof n!=`object`||n.type===null?!1:this.#h(n.type,t)}#h(e,t=Tg){return!!t.get(this.type)?.includes(e)}#g(e,t){let n=e.#r[0],r=new yg(null,n,this.options);r.#r.push(``),n.push(r),this.#_(e,t)}#_(e,t){let n=e.#r[0];this.#r.splice(t,1,...n.#r);for(let e of n.#r)typeof e==`object`&&(e.#i=this);this.#l=void 0}#v(e){return!!Eg.get(this.type)?.has(e)}#y(e){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let t=e.#r[0];return!t||typeof t!=`object`||t.type===null?!1:this.#v(t.type)}#b(e){let t=Eg.get(this.type),n=e.#r[0],r=t?.get(n.type);if(!r)return!1;this.#r=n.#r;for(let e of this.#r)typeof e==`object`&&(e.#i=this);this.type=r,this.#l=void 0,this.#u=!1}static fromGlob(e,t={}){let n=new yg(null,void 0,t);return yg.#f(e,n,0,t,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#e===this&&(this.#x(),this.#d()),!Sg(this)){let n=this.isStart()&&this.isEnd()&&!this.#r.some(e=>typeof e!=`string`),r=this.#r.map(t=>{let[r,i,a,o]=typeof t==`string`?yg.#C(t,this.#t,n):t.toRegExpSource(e);return this.#t=this.#t||a,this.#n=this.#n||o,r}).join(``),i=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&kg.has(this.#r[0]))){let n=Og,a=t&&n.has(r.charAt(0))||r.startsWith(`\\.`)&&n.has(r.charAt(2))||r.startsWith(`\\.\\.`)&&n.has(r.charAt(4)),o=!t&&!e&&n.has(r.charAt(0));i=a?`(?!(?:^|/)\\.\\.?(?:$|/))`:o?Dg:``}let a=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(a=`(?:$|\\/)`),[i+r+a,vg(r),this.#t=!!this.#t,this.#n]}let n=this.type===`*`||this.type===`+`,r=this.type===`!`?`(?:(?!(?:`:`(?:`,i=this.#S(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,vg(this.toString()),!1,!1]}let a=!n||e||t?``:this.#S(!0);a===i&&(a=``),a&&(i=`(?:${i})(?:${a})*?`);let o=``;if(this.type===`!`&&this.#u)o=(this.isStart()&&!t?Dg:``)+Mg;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?Dg:``)+`[^/]*?)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,vg(i),this.#t=!!this.#t,this.#n]}#x(){if(Sg(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#r.length;e++){let n=this.#r[e];typeof n==`object`&&(n.#x(),this.#m(n)?(t=!1,this.#_(n,e)):this.#p(n)?(t=!1,this.#g(n,e)):this.#y(n)&&(t=!1,this.#b(n)))}}while(!t&&++e<10)}else for(let e of this.#r)typeof e==`object`&&e.#x();this.#l=void 0}#S(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#C(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(r){r=!1,i+=(Ag.has(c)?`\\`:``)+c;continue}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?Mg:`[^/]*?`,t=!0;continue}else o=!1;if(c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,o,c]=_g(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}if(c===`?`){i+=`[^/]`,t=!0;continue}i+=jg(c)}return[i,vg(e),!!t,a]}};yg=Pg;const Fg=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),B=(e,t,n={})=>(fg(t),!n.nocomment&&t.charAt(0)===`#`?!1:new l_(t,n).match(e)),Ig=/^\*+([^+@!?*[(]*)$/,Lg=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),Rg=e=>t=>t.endsWith(e),zg=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),Bg=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Vg=/^\*+\.\*+$/,Hg=e=>!e.startsWith(`.`)&&e.includes(`.`),Ug=e=>e!==`.`&&e!==`..`&&e.includes(`.`),Wg=/^\.\*+$/,Gg=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),Kg=/^\*+$/,qg=e=>e.length!==0&&!e.startsWith(`.`),Jg=e=>e.length!==0&&e!==`.`&&e!==`..`,Yg=/^\?+([^+@!?*[(]*)?$/,Xg=([e,t=``])=>{let n=e_([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Zg=([e,t=``])=>{let n=t_([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Qg=([e,t=``])=>{let n=t_([e]);return t?e=>n(e)&&e.endsWith(t):n},$g=([e,t=``])=>{let n=e_([e]);return t?e=>n(e)&&e.endsWith(t):n},e_=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},t_=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},n_=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,r_={win32:{sep:`\\`},posix:{sep:`/`}};B.sep=n_===`win32`?r_.win32.sep:r_.posix.sep;const i_=Symbol(`globstar **`);B.GLOBSTAR=i_,B.filter=(e,t={})=>n=>B(n,e,t);const a_=(e,t={})=>Object.assign({},e,t);B.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return B;let t=B;return Object.assign((n,r,i={})=>t(n,r,a_(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,a_(e,n))}static defaults(n){return t.defaults(a_(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,a_(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,a_(e,r))}},unescape:(n,r={})=>t.unescape(n,a_(e,r)),escape:(n,r={})=>t.escape(n,a_(e,r)),filter:(n,r={})=>t.filter(n,a_(e,r)),defaults:n=>t.defaults(a_(e,n)),makeRe:(n,r={})=>t.makeRe(n,a_(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,a_(e,r)),match:(n,r,i={})=>t.match(n,r,a_(e,i)),sep:t.sep,GLOBSTAR:i_})};const o_=(e,t={})=>(fg(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:og(e,{max:t.braceExpandMax}));B.braceExpand=o_,B.makeRe=(e,t={})=>new l_(e,t).makeRe(),B.match=(e,t,n={})=>{let r=new l_(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};const s_=/[?*]|[+@!]\(.*?\)|\[|\]/,c_=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`);var l_=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){fg(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||n_,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!s_.test(e[2]))&&!s_.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t of e)for(let e=0;e<t.length;e++)t[e]===`**`&&(t[e]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&!(this.isWindows&&/^[a-z]:$/i.test(r))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),a=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),s=!o&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]),c=a?3:n?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[n,a]=[e[c],t[l]];n.toLowerCase()===a.toLowerCase()&&(t[l]=n,i=l,r=c)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(i_)?this.#e(e,t,n,r,i):this.#n(e,t,n,r,i)}#e(e,t,n,r,i){let a=t.indexOf(i_,i),o=t.lastIndexOf(i_),[s,c,l]=n?[t.slice(i,a),t.slice(a+1),[]]:[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#n(t,s,n,0,0))return!1;r+=s.length,i+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#n(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#n(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return n||t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===i_?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,g=e.length-u;for(let e of d)e[1]=g-(m[h--]+e[0].length);return!!this.#t(e,d,r,0,n,0,!!u)}#t(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){if(this.#n(e.slice(0,n+c.length),c,i,n,0)&&a<this.maxGlobstarRecursion){let s=this.#t(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let s=e[n];if(s===`.`||s===`..`||!this.options.dot&&s.startsWith(`.`))return!1;n++}return i||null}#n(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===i_)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return o_(this.pattern,this.options)}parse(e){fg(e);let t=this.options;if(e===`**`)return i_;if(e===``)return``;let n,r=null;(n=e.match(Kg))?r=t.dot?Jg:qg:(n=e.match(Ig))?r=(t.nocase?t.dot?Bg:zg:t.dot?Rg:Lg)(n[1]):(n=e.match(Yg))?r=(t.nocase?t.dot?Zg:Xg:t.dot?Qg:$g)(n):(n=e.match(Vg))?r=t.dot?Ug:Hg:(n=e.match(Wg))&&(r=Gg);let i=Pg.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,"test",{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?`[^/]*?`:t.dot?`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`:`(?:(?!(?:\\/|^)\\.).)*?`,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?c_(e):e===i_?i_:e._src});t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==i_||a===i_||(a===void 0?i!==void 0&&i!==i_?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|\\/`+n+`)?`:i!==i_&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=i_))});let i=t.filter(e=>e!==i_);if(this.partial&&i.length>=1){let e=[];for(let t=1;t<=i.length;t++)e.push(i.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return i.join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.partial&&(i=`^(?:\\/|`+a+i.slice(1,-1)+o+`)$`),this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e of i){let i=r;if(n.matchBase&&e.length===1&&(i=[a]),this.matchOne(i,e,t))return n.flipNegate?!0:!this.negate}return!n.flipNegate&&this.negate}static defaults(e){return B.defaults(e).Minimatch}};B.AST=Pg,B.Minimatch=l_,B.escape=Fg,B.unescape=vg;var u_=i(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c})),d_=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{version:()=>u}),t.exports=c(l);let u=`3.8.0`;0&&(t.exports={version:u})})),f_=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{exchangeVercelOidcToken:()=>p}),t.exports=c(l);var u=d_();let d=new class{constructor(e){this.maxEntries=e,this.entries=new Map}get(e){let t=this.entries.get(e);if(t!==void 0){if(t.expiresAt<=Date.now()){this.entries.delete(e);return}return this.entries.delete(e),this.entries.set(e,t),t.token}}set({key:e,token:t,expiresAt:n}){for(this.entries.delete(e),this.entries.set(e,{token:t,expiresAt:n});this.entries.size>this.maxEntries;){let e=this.entries.keys().next().value;if(e===void 0)break;this.entries.delete(e)}}}(1e3);async function f(e){let t=JSON.stringify([e.token,e.audience,e.jti]),n=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(t));return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function p(e){let t=await f(e);if(!e.skipCache){let e=d.get(t);if(e!==void 0)return e}let n=await fetch(`https://oidc.vercel.com/~token`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`,"User-Agent":`@vercel/oidc@${u.version}`},body:JSON.stringify({token:e.token,aud:e.audience,...e.jti?{jti:e.jti}:void 0})});if(!n.ok)throw Error(`Failed to exchange token: ${await m(n)}`);let r;try{r=await n.json()}catch{throw Error(`Failed to exchange token: response was not valid JSON`)}if(!r||typeof r!=`object`||!(`token`in r)||typeof r.token!=`string`)throw Error(`Failed to exchange token: response did not contain a token`);let{token:i}=r,a=`expiry`in r&&typeof r.expiry==`number`?r.expiry:void 0;if(a!==void 0){let e=a*1e3;e>Date.now()&&d.set({key:t,token:i,expiresAt:e})}return i}async function m(e){try{let t=await e.json();if(t&&typeof t==`object`&&`error`in t&&typeof t.error==`string`)return t.error}catch{}return e.statusText||`HTTP ${e.status}`}0&&(t.exports={exchangeVercelOidcToken:p})})),p_=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{SYMBOL_FOR_REQ_CONTEXT:()=>u,getContext:()=>d}),t.exports=c(l);let u=Symbol.for(`@vercel/request-context`);function d(){return globalThis[u]?.get?.()??{}}0&&(t.exports={SYMBOL_FOR_REQ_CONTEXT:u,getContext:d})})),m_=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{getVercelOidcTokenSync:()=>d}),t.exports=c(l);var u=p_();function d(){let e=(0,u.getContext)().headers?.[`x-vercel-oidc-token`]??process.env.VERCEL_OIDC_TOKEN;if(!e)throw Error(`The 'x-vercel-oidc-token' header is missing from the request.`);return e}0&&(t.exports={getVercelOidcTokenSync:d})})),h_=i(((e,t)=>{var r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},c=(e,t,n,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(r({},`__esModule`,{value:!0}),e),u={};s(u,{getVercelOidcToken:()=>m}),t.exports=l(u);var d=f_(),f=m_(),p=$c();async function m(e){let t=``,r;try{t=(0,f.getVercelOidcTokenSync)()}catch(e){r=e}try{let[{getTokenPayload:r,isExpired:i},{refreshToken:a}]=await Promise.all([await import(`../../_chunks/workflow/token-util-DNwIAn_u.js`).then(e=>n(e.t())),await import(`../../_chunks/workflow/token-DtCUEpJs.js`).then(e=>n(e.default))]);(!t||i(r(t),e?.expirationBufferMs))&&(await a(e),t=(0,f.getVercelOidcTokenSync)())}catch(e){let t=r instanceof Error?r.message:``;throw e instanceof Error&&(t=`${t}
12
- ${e.message}`),t?new p.VercelOidcTokenError(t):e}return e?.audience&&(t=await(0,d.exchangeVercelOidcToken)({token:t,audience:e.audience,jti:e.jti,skipCache:e.skipCache})),t}0&&(t.exports={getVercelOidcToken:m})})),g_,__=t((()=>{g_=(e,t)=>ll(e).update(t).digest()}));function v_(...e){let t=e.reduce((e,{length:t})=>e+t,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function y_(e,t){return v_(V.encode(e),new Uint8Array([0]),t)}function b_(e,t,n){if(t<0||t>=E_)throw RangeError(`value must be >= 0 and <= ${E_-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,t&255],n)}function x_(e){let t=Math.floor(e/E_),n=e%E_,r=new Uint8Array(8);return b_(r,t,0),b_(r,n,4),r}function S_(e){let t=new Uint8Array(4);return b_(t,e),t}function C_(e){return v_(S_(e.length),e)}async function w_(e,t,n){let r=Math.ceil((t>>3)/32),i=new Uint8Array(r*32);for(let t=0;t<r;t++){let r=new Uint8Array(4+e.length+n.length);r.set(S_(t+1)),r.set(e,4),r.set(n,4+e.length),i.set(await g_(`sha256`,r),t*32)}return i.slice(0,t>>3)}var V,T_,E_,H=t((()=>{__(),V=new TextEncoder,T_=new TextDecoder,E_=2**32}));function D_(e){let t=e;return t instanceof Uint8Array&&(t=T_.decode(t)),t}var U,W,O_=t((()=>{H(),U=e=>jl.from(e).toString(`base64url`),W=e=>new Uint8Array(jl.from(D_(e),`base64url`))})),k_=r({JOSEAlgNotAllowed:()=>M_,JOSEError:()=>G,JOSENotSupported:()=>K,JWEDecryptionFailed:()=>N_,JWEInvalid:()=>q,JWKInvalid:()=>F_,JWKSInvalid:()=>I_,JWKSMultipleMatchingKeys:()=>R_,JWKSNoMatchingKey:()=>L_,JWKSTimeout:()=>z_,JWSInvalid:()=>J,JWSSignatureVerificationFailed:()=>B_,JWTClaimValidationFailed:()=>A_,JWTExpired:()=>j_,JWTInvalid:()=>P_}),G,A_,j_,M_,K,N_,q,J,P_,F_,I_,L_,R_,z_,B_,Y=t((()=>{G=class extends Error{static code=`ERR_JOSE_GENERIC`;code=`ERR_JOSE_GENERIC`;constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},A_=class extends G{static code=`ERR_JWT_CLAIM_VALIDATION_FAILED`;code=`ERR_JWT_CLAIM_VALIDATION_FAILED`;claim;reason;payload;constructor(e,t,n=`unspecified`,r=`unspecified`){super(e,{cause:{claim:n,reason:r,payload:t}}),this.claim=n,this.reason=r,this.payload=t}},j_=class extends G{static code=`ERR_JWT_EXPIRED`;code=`ERR_JWT_EXPIRED`;claim;reason;payload;constructor(e,t,n=`unspecified`,r=`unspecified`){super(e,{cause:{claim:n,reason:r,payload:t}}),this.claim=n,this.reason=r,this.payload=t}},M_=class extends G{static code=`ERR_JOSE_ALG_NOT_ALLOWED`;code=`ERR_JOSE_ALG_NOT_ALLOWED`},K=class extends G{static code=`ERR_JOSE_NOT_SUPPORTED`;code=`ERR_JOSE_NOT_SUPPORTED`},N_=class extends G{static code=`ERR_JWE_DECRYPTION_FAILED`;code=`ERR_JWE_DECRYPTION_FAILED`;constructor(e=`decryption operation failed`,t){super(e,t)}},q=class extends G{static code=`ERR_JWE_INVALID`;code=`ERR_JWE_INVALID`},J=class extends G{static code=`ERR_JWS_INVALID`;code=`ERR_JWS_INVALID`},P_=class extends G{static code=`ERR_JWT_INVALID`;code=`ERR_JWT_INVALID`},F_=class extends G{static code=`ERR_JWK_INVALID`;code=`ERR_JWK_INVALID`},I_=class extends G{static code=`ERR_JWKS_INVALID`;code=`ERR_JWKS_INVALID`},L_=class extends G{static code=`ERR_JWKS_NO_MATCHING_KEY`;code=`ERR_JWKS_NO_MATCHING_KEY`;constructor(e=`no applicable key found in the JSON Web Key Set`,t){super(e,t)}},R_=class extends G{[Symbol.asyncIterator];static code=`ERR_JWKS_MULTIPLE_MATCHING_KEYS`;code=`ERR_JWKS_MULTIPLE_MATCHING_KEYS`;constructor(e=`multiple matching keys found in the JSON Web Key Set`,t){super(e,t)}},z_=class extends G{static code=`ERR_JWKS_TIMEOUT`;code=`ERR_JWKS_TIMEOUT`;constructor(e=`request timed out`,t){super(e,t)}},B_=class extends G{static code=`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`;code=`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`;constructor(e=`signature verification failed`,t){super(e,t)}}})),V_=t((()=>{}));function H_(e){switch(e){case`A128GCM`:case`A128GCMKW`:case`A192GCM`:case`A192GCMKW`:case`A256GCM`:case`A256GCMKW`:return 96;case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:return 128;default:throw new K(`Unsupported JWE Algorithm: ${e}`)}}var U_,W_=t((()=>{Y(),V_(),U_=e=>bl(new Uint8Array(H_(e)>>3))})),G_,K_=t((()=>{Y(),W_(),G_=(e,t)=>{if(t.length<<3!==H_(e))throw new q(`Invalid Initialization Vector length`)}})),q_,J_=t((()=>{q_=e=>Cl.types.isKeyObject(e)})),Y_,X_=t((()=>{Y(),J_(),Y_=(e,t)=>{let n;switch(e){case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:n=parseInt(e.slice(-3),10);break;case`A128GCM`:case`A192GCM`:case`A256GCM`:n=parseInt(e.slice(1,4),10);break;default:throw new K(`Content Encryption Algorithm ${e} is not supported either by JOSE or your javascript runtime`)}if(t instanceof Uint8Array){let e=t.byteLength<<3;if(e!==n)throw new q(`Invalid Content Encryption Key length. Expected ${n} bits, got ${e} bits`);return}if(q_(t)&&t.type===`secret`){let e=t.symmetricKeySize<<3;if(e!==n)throw new q(`Invalid Content Encryption Key length. Expected ${n} bits, got ${e} bits`);return}throw TypeError(`Invalid Content Encryption Key type`)}})),Z_,Q_=t((()=>{Z_=xl}));function $_(e,t,n,r,i,a){let o=v_(e,t,n,x_(e.length<<3)),s=ul(`sha${r}`,i);return s.update(o),s.digest().slice(0,a>>3)}var ev=t((()=>{H()})),tv,nv,rv=t((()=>{tv=il.webcrypto,nv=e=>Cl.types.isCryptoKey(e)}));function X(e,t=`algorithm.name`){return TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function iv(e,t){return e.name===t}function av(e){return parseInt(e.name.slice(4),10)}function ov(e){switch(e){case`ES256`:return`P-256`;case`ES384`:return`P-384`;case`ES512`:return`P-521`;default:throw Error(`unreachable`)}}function sv(e,t){if(t.length&&!t.some(t=>e.usages.includes(t))){let e=`CryptoKey does not support this operation, its usages must include `;if(t.length>2){let n=t.pop();e+=`one of ${t.join(`, `)}, or ${n}.`}else t.length===2?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw TypeError(e)}}function cv(e,t,...n){switch(t){case`HS256`:case`HS384`:case`HS512`:{if(!iv(e.algorithm,`HMAC`))throw X(`HMAC`);let n=parseInt(t.slice(2),10);if(av(e.algorithm.hash)!==n)throw X(`SHA-${n}`,`algorithm.hash`);break}case`RS256`:case`RS384`:case`RS512`:{if(!iv(e.algorithm,`RSASSA-PKCS1-v1_5`))throw X(`RSASSA-PKCS1-v1_5`);let n=parseInt(t.slice(2),10);if(av(e.algorithm.hash)!==n)throw X(`SHA-${n}`,`algorithm.hash`);break}case`PS256`:case`PS384`:case`PS512`:{if(!iv(e.algorithm,`RSA-PSS`))throw X(`RSA-PSS`);let n=parseInt(t.slice(2),10);if(av(e.algorithm.hash)!==n)throw X(`SHA-${n}`,`algorithm.hash`);break}case`EdDSA`:if(e.algorithm.name!==`Ed25519`&&e.algorithm.name!==`Ed448`)throw X(`Ed25519 or Ed448`);break;case`Ed25519`:if(!iv(e.algorithm,`Ed25519`))throw X(`Ed25519`);break;case`ES256`:case`ES384`:case`ES512`:{if(!iv(e.algorithm,`ECDSA`))throw X(`ECDSA`);let n=ov(t);if(e.algorithm.namedCurve!==n)throw X(n,`algorithm.namedCurve`);break}default:throw TypeError(`CryptoKey does not support this operation`)}sv(e,n)}function lv(e,t,...n){switch(t){case`A128GCM`:case`A192GCM`:case`A256GCM`:{if(!iv(e.algorithm,`AES-GCM`))throw X(`AES-GCM`);let n=parseInt(t.slice(1,4),10);if(e.algorithm.length!==n)throw X(n,`algorithm.length`);break}case`A128KW`:case`A192KW`:case`A256KW`:{if(!iv(e.algorithm,`AES-KW`))throw X(`AES-KW`);let n=parseInt(t.slice(1,4),10);if(e.algorithm.length!==n)throw X(n,`algorithm.length`);break}case`ECDH`:switch(e.algorithm.name){case`ECDH`:case`X25519`:case`X448`:break;default:throw X(`ECDH, X25519, or X448`)}break;case`PBES2-HS256+A128KW`:case`PBES2-HS384+A192KW`:case`PBES2-HS512+A256KW`:if(!iv(e.algorithm,`PBKDF2`))throw X(`PBKDF2`);break;case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:{if(!iv(e.algorithm,`RSA-OAEP`))throw X(`RSA-OAEP`);let n=parseInt(t.slice(9),10)||1;if(av(e.algorithm.hash)!==n)throw X(`SHA-${n}`,`algorithm.hash`);break}default:throw TypeError(`CryptoKey does not support this operation`)}sv(e,n)}var uv=t((()=>{}));function dv(e,t,...n){if(n=n.filter(Boolean),n.length>2){let t=n.pop();e+=`one of type ${n.join(`, `)}, or ${t}.`}else n.length===2?e+=`one of type ${n[0]} or ${n[1]}.`:e+=`of type ${n[0]}.`;return t==null?e+=` Received ${t}`:typeof t==`function`&&t.name?e+=` Received function ${t.name}`:typeof t==`object`&&t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}function fv(e,t,...n){return dv(`Key for the ${e} algorithm must be `,t,...n)}var pv,mv=t((()=>{pv=(e,...t)=>dv(`Key must be `,e,...t)})),hv,gv,_v=t((()=>{gv=e=>(hv||=new Set(gl()),hv.has(e))})),vv,Z,yv=t((()=>{rv(),J_(),vv=e=>q_(e)||nv(e),Z=[`KeyObject`],(globalThis.CryptoKey||tv?.CryptoKey)&&Z.push(`CryptoKey`)}));function bv(e,t,n,r,i,a){let o=parseInt(e.slice(1,4),10);q_(t)&&(t=t.export());let s=t.subarray(o>>3),c=t.subarray(0,o>>3),l=parseInt(e.slice(-3),10),u=`aes-${o}-cbc`;if(!gv(u))throw new K(`alg ${e} is not supported by your javascript runtime`);let d=$_(a,r,n,l,c,o),f;try{f=Z_(i,d)}catch{}if(!f)throw new N_;let p;try{let e=cl(u,s,r);p=v_(e.update(n),e.final())}catch{}if(!p)throw new N_;return p}function xv(e,t,n,r,i,a){let o=`aes-${parseInt(e.slice(1,4),10)}-gcm`;if(!gv(o))throw new K(`alg ${e} is not supported by your javascript runtime`);try{let e=cl(o,t,r,{authTagLength:16});e.setAuthTag(i),a.byteLength&&e.setAAD(a,{plaintextLength:n.length});let s=e.update(n);return e.final(),s}catch{throw new N_}}var Sv,Cv=t((()=>{K_(),X_(),H(),Y(),Q_(),ev(),rv(),uv(),J_(),mv(),_v(),yv(),Sv=(e,t,n,r,i,a)=>{let o;if(nv(t))lv(t,e,`decrypt`),o=al.from(t);else if(t instanceof Uint8Array||q_(t))o=t;else throw TypeError(pv(t,...Z,`Uint8Array`));if(!r)throw new q(`JWE Initialization Vector missing`);if(!i)throw new q(`JWE Authentication Tag missing`);switch(Y_(e,o),G_(e,r),e){case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:return bv(e,o,n,r,i,a);case`A128GCM`:case`A192GCM`:case`A256GCM`:return xv(e,o,n,r,i,a);default:throw new K(`Unsupported JWE Content Encryption Algorithm`)}}})),wv,Tv=t((()=>{wv=(...e)=>{let t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let n;for(let e of t){let t=Object.keys(e);if(!n||n.size===0){n=new Set(t);continue}for(let e of t){if(n.has(e))return!1;n.add(e)}}return!0}}));function Ev(e){return typeof e==`object`&&!!e}function Q(e){if(!Ev(e)||Object.prototype.toString.call(e)!==`[object Object]`)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}var Dv=t((()=>{}));function Ov(e,t){if(e.symmetricKeySize<<3!==parseInt(t.slice(1,4),10))throw TypeError(`Invalid key size for alg: ${t}`)}function kv(e,t,n){if(q_(e))return e;if(e instanceof Uint8Array)return pl(e);if(nv(e))return lv(e,t,n),al.from(e);throw TypeError(pv(e,...Z,`Uint8Array`))}var Av,jv,Mv=t((()=>{Y(),H(),rv(),uv(),J_(),mv(),_v(),yv(),Av=(e,t,n)=>{let r=`aes${parseInt(e.slice(1,4),10)}-wrap`;if(!gv(r))throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`);let i=kv(t,e,`wrapKey`);Ov(i,e);let a=sl(r,i,jl.alloc(8,166));return v_(a.update(n),a.final())},jv=(e,t,n)=>{let r=`aes${parseInt(e.slice(1,4),10)}-wrap`;if(!gv(r))throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`);let i=kv(t,e,`unwrapKey`);Ov(i,e);let a=cl(r,i,jl.alloc(8,166));return v_(a.update(n),a.final())}}));function Nv(e){return Q(e)&&typeof e.kty==`string`}function Pv(e){return e.kty!==`oct`&&typeof e.d==`string`}function Fv(e){return e.kty!==`oct`&&e.d===void 0}function Iv(e){return Nv(e)&&e.kty===`oct`&&typeof e.k==`string`}var Lv=t((()=>{Dv()})),Rv,zv,Bv=t((()=>{Y(),rv(),J_(),mv(),yv(),Lv(),Rv=e=>{switch(e){case`prime256v1`:return`P-256`;case`secp384r1`:return`P-384`;case`secp521r1`:return`P-521`;case`secp256k1`:return`secp256k1`;default:throw new K(`Unsupported key curve for this operation`)}},zv=(e,t)=>{let n;if(nv(e))n=al.from(e);else if(q_(e))n=e;else if(Nv(e))return e.crv;else throw TypeError(pv(e,...Z));if(n.type===`secret`)throw TypeError(`only "private" or "public" type keys can be used for this operation`);switch(n.asymmetricKeyType){case`ed25519`:case`ed448`:return`Ed${n.asymmetricKeyType.slice(2)}`;case`x25519`:case`x448`:return`X${n.asymmetricKeyType.slice(1)}`;case`ec`:{let e=n.asymmetricKeyDetails.namedCurve;return t?e:Rv(e)}default:throw TypeError(`Invalid asymmetric key type for this operation`)}}}));async function Vv(e,t,n,r,i=new Uint8Array,a=new Uint8Array){let o;if(nv(e))lv(e,`ECDH`),o=al.from(e);else if(q_(e))o=e;else throw TypeError(pv(e,...Z));let s;if(nv(t))lv(t,`ECDH`,`deriveBits`),s=al.from(t);else if(q_(t))s=t;else throw TypeError(pv(t,...Z));let c=v_(C_(V.encode(n)),C_(i),C_(a),S_(r));return w_(ml({privateKey:s,publicKey:o}),r,c)}async function Hv(e){let t;if(nv(e))t=al.from(e);else if(q_(e))t=e;else throw TypeError(pv(e,...Z));switch(t.asymmetricKeyType){case`x25519`:return Uv(`x25519`);case`x448`:return Uv(`x448`);case`ec`:{let e=zv(t);return Uv(`ec`,{namedCurve:e})}default:throw new K(`Invalid or unsupported EPK`)}}var Uv,Wv,Gv=t((()=>{Bv(),H(),Y(),rv(),uv(),J_(),mv(),yv(),Uv=El(hl),Wv=e=>[`P-256`,`P-384`,`P-521`,`X25519`,`X448`].includes(zv(e))}));function Kv(e){if(!(e instanceof Uint8Array)||e.length<8)throw new q(`PBES2 Salt Input must be 8 or more octets`)}var qv=t((()=>{Y()}));function Jv(e,t){if(q_(e))return e.export();if(e instanceof Uint8Array)return e;if(nv(e))return lv(e,t,`deriveBits`,`deriveKey`),al.from(e).export();throw TypeError(pv(e,...Z,`Uint8Array`))}var Yv,Xv,Zv,Qv=t((()=>{V_(),H(),O_(),Mv(),qv(),rv(),uv(),J_(),mv(),yv(),Yv=El(_l),Xv=async(e,t,n,r=2048,i=bl(new Uint8Array(16)))=>{Kv(i);let a=y_(e,i),o=parseInt(e.slice(13,16),10)>>3,s=Jv(t,e),c=await Yv(s,a,r,o,`sha${e.slice(8,11)}`);return{encryptedKey:await Av(e.slice(-6),c,n),p2c:r,p2s:U(i)}},Zv=async(e,t,n,r,i)=>{Kv(i);let a=y_(e,i),o=parseInt(e.slice(13,16),10)>>3,s=Jv(t,e),c=await Yv(s,a,r,o,`sha${e.slice(8,11)}`);return jv(e.slice(-6),c,n)}})),$v,ey=t((()=>{$v=(e,t)=>{let n;try{n=e instanceof al?e.asymmetricKeyDetails?.modulusLength:Buffer.from(e.n,`base64url`).byteLength<<3}catch{}if(typeof n!=`number`||n<2048)throw TypeError(`${t} requires key modulusLength to be 2048 bits or larger`)}}));function ty(e,t,...n){if(q_(e))return e;if(nv(e))return lv(e,t,...n),al.from(e);throw TypeError(pv(e,...Z))}var ny,ry,iy,ay,oy,sy,cy=t((()=>{ey(),rv(),uv(),J_(),mv(),yv(),ny=(e,t)=>{if(e.asymmetricKeyType!==`rsa`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be rsa`);$v(e,t)},ry=wl(()=>ol.RSA_PKCS1_PADDING,`The RSA1_5 "alg" (JWE Algorithm) is deprecated and will be removed in the next major revision.`),iy=e=>{switch(e){case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:return ol.RSA_PKCS1_OAEP_PADDING;case`RSA1_5`:return ry();default:return}},ay=e=>{switch(e){case`RSA-OAEP`:return`sha1`;case`RSA-OAEP-256`:return`sha256`;case`RSA-OAEP-384`:return`sha384`;case`RSA-OAEP-512`:return`sha512`;default:return}},oy=(e,t,n)=>{let r=iy(e),i=ay(e),a=ty(t,e,`wrapKey`,`encrypt`);return ny(a,e),yl({key:a,oaepHash:i,padding:r},n)},sy=(e,t,n)=>{let r=iy(e),i=ay(e),a=ty(t,e,`unwrapKey`,`decrypt`);return ny(a,e),vl({key:a,oaepHash:i,padding:r},n)}})),ly,uy=t((()=>{ly={}}));function dy(e){switch(e){case`A128GCM`:return 128;case`A192GCM`:return 192;case`A256GCM`:case`A128CBC-HS256`:return 256;case`A192CBC-HS384`:return 384;case`A256CBC-HS512`:return 512;default:throw new K(`Unsupported JWE Algorithm: ${e}`)}}var fy,py=t((()=>{Y(),V_(),fy=e=>bl(new Uint8Array(dy(e)>>3))})),my,hy,gy,_y,vy,yy,by=t((()=>{rv(),J_(),mv(),yv(),my=(e,t,n)=>{let r;if(nv(n)){if(!n.extractable)throw TypeError(`CryptoKey is not extractable`);r=al.from(n)}else if(q_(n))r=n;else throw TypeError(pv(n,...Z));if(r.type!==e)throw TypeError(`key is not a ${e} key`);return r.export({format:`pem`,type:t})},hy=e=>my(`public`,`spki`,e),gy=e=>my(`private`,`pkcs8`,e),_y=e=>dl({key:jl.from(e.replace(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,``),`base64`),type:`pkcs8`,format:`der`}),vy=e=>fl({key:jl.from(e.replace(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,``),`base64`),type:`spki`,format:`der`}),yy=e=>fl({key:e,type:`spki`,format:`pem`})})),xy,Sy=t((()=>{xy=e=>e.d?dl({format:`jwk`,key:e}):fl({format:`jwk`,key:e})}));async function Cy(e,t,n){if(typeof e!=`string`||e.indexOf(`-----BEGIN PUBLIC KEY-----`)!==0)throw TypeError(`"spki" must be SPKI formatted string`);return vy(e,t,n)}async function wy(e,t,n){if(typeof e!=`string`||e.indexOf(`-----BEGIN CERTIFICATE-----`)!==0)throw TypeError(`"x509" must be X.509 formatted string`);return yy(e,t,n)}async function Ty(e,t,n){if(typeof e!=`string`||e.indexOf(`-----BEGIN PRIVATE KEY-----`)!==0)throw TypeError(`"pkcs8" must be PKCS#8 formatted string`);return _y(e,t,n)}async function Ey(e,t){if(!Q(e))throw TypeError(`JWK must be an object`);switch(t||=e.alg,e.kty){case`oct`:if(typeof e.k!=`string`||!e.k)throw TypeError(`missing "k" (Key Value) Parameter value`);return W(e.k);case`RSA`:if(`oth`in e&&e.oth!==void 0)throw new K(`RSA JWK "oth" (Other Primes Info) Parameter value is not supported`);case`EC`:case`OKP`:return xy({...e,alg:t});default:throw new K(`Unsupported "kty" (Key Type) Parameter value`)}}var Dy=t((()=>{O_(),by(),Sy(),Y(),Dv()}));function Oy(e,t,n,r){t.startsWith(`HS`)||t===`dir`||t.startsWith(`PBES2`)||/^A\d{3}(?:GCM)?KW$/.test(t)?jy(t,n,r,e):My(t,n,r,e)}var ky,Ay,jy,My,Ny,Py,Fy=t((()=>{mv(),yv(),Lv(),ky=e=>e?.[Symbol.toStringTag],Ay=(e,t,n)=>{if(t.use!==void 0&&t.use!==`sig`)throw TypeError(`Invalid key for this operation, when present its use must be sig`);if(t.key_ops!==void 0&&t.key_ops.includes?.(n)!==!0)throw TypeError(`Invalid key for this operation, when present its key_ops must include ${n}`);if(t.alg!==void 0&&t.alg!==e)throw TypeError(`Invalid key for this operation, when present its alg must be ${e}`);return!0},jy=(e,t,n,r)=>{if(!(t instanceof Uint8Array)){if(r&&Nv(t)){if(Iv(t)&&Ay(e,t,n))return;throw TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`)}if(!vv(t))throw TypeError(fv(e,t,...Z,`Uint8Array`,r?`JSON Web Key`:null));if(t.type!==`secret`)throw TypeError(`${ky(t)} instances for symmetric algorithms must be of type "secret"`)}},My=(e,t,n,r)=>{if(r&&Nv(t))switch(n){case`sign`:if(Pv(t)&&Ay(e,t,n))return;throw TypeError(`JSON Web Key for this operation be a private JWK`);case`verify`:if(Fv(t)&&Ay(e,t,n))return;throw TypeError(`JSON Web Key for this operation be a public JWK`)}if(!vv(t))throw TypeError(fv(e,t,...Z,r?`JSON Web Key`:null));if(t.type===`secret`)throw TypeError(`${ky(t)} instances for asymmetric algorithms must not be of type "secret"`);if(n===`sign`&&t.type===`public`)throw TypeError(`${ky(t)} instances for asymmetric algorithm signing must be of type "private"`);if(n===`decrypt`&&t.type===`public`)throw TypeError(`${ky(t)} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&n===`verify`&&t.type===`private`)throw TypeError(`${ky(t)} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&n===`encrypt`&&t.type===`private`)throw TypeError(`${ky(t)} instances for asymmetric algorithm encryption must be of type "public"`)},Ny=Oy.bind(void 0,!1),Py=Oy.bind(void 0,!0)}));function Iy(e,t,n,r,i){let a=parseInt(e.slice(1,4),10);q_(n)&&(n=n.export());let o=n.subarray(a>>3),s=n.subarray(0,a>>3),c=`aes-${a}-cbc`;if(!gv(c))throw new K(`alg ${e} is not supported by your javascript runtime`);let l=sl(c,o,r),u=v_(l.update(t),l.final());return{ciphertext:u,tag:$_(i,r,u,parseInt(e.slice(-3),10),s,a),iv:r}}function Ly(e,t,n,r,i){let a=`aes-${parseInt(e.slice(1,4),10)}-gcm`;if(!gv(a))throw new K(`alg ${e} is not supported by your javascript runtime`);let o=sl(a,n,r,{authTagLength:16});i.byteLength&&o.setAAD(i,{plaintextLength:t.length});let s=o.update(t);return o.final(),{ciphertext:s,tag:o.getAuthTag(),iv:r}}var Ry,zy=t((()=>{K_(),X_(),H(),ev(),rv(),uv(),J_(),mv(),W_(),Y(),_v(),yv(),Ry=(e,t,n,r,i)=>{let a;if(nv(n))lv(n,e,`encrypt`),a=al.from(n);else if(n instanceof Uint8Array||q_(n))a=n;else throw TypeError(pv(n,...Z,`Uint8Array`));switch(Y_(e,a),r?G_(e,r):r=U_(e),e){case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:return Iy(e,t,a,r,i);case`A128GCM`:case`A192GCM`:case`A256GCM`:return Ly(e,t,a,r,i);default:throw new K(`Unsupported JWE Content Encryption Algorithm`)}}}));async function By(e,t,n,r){let i=await Ry(e.slice(0,7),n,t,r,new Uint8Array);return{encryptedKey:i.ciphertext,iv:U(i.iv),tag:U(i.tag)}}async function Vy(e,t,n,r,i){return Sv(e.slice(0,7),t,n,r,i,new Uint8Array)}var Hy=t((()=>{zy(),Cv(),O_()}));async function Uy(e,t,n,r,i){switch(Ny(e,t,`decrypt`),t=await ly.normalizePrivateKey?.(t,e)||t,e){case`dir`:if(n!==void 0)throw new q(`Encountered unexpected JWE Encrypted Key`);return t;case`ECDH-ES`:if(n!==void 0)throw new q(`Encountered unexpected JWE Encrypted Key`);case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:{if(!Q(r.epk))throw new q(`JOSE Header "epk" (Ephemeral Public Key) missing or invalid`);if(!Wv(t))throw new K(`ECDH with the provided key is not allowed or not supported by your javascript runtime`);let i=await Ey(r.epk,e),a,o;if(r.apu!==void 0){if(typeof r.apu!=`string`)throw new q(`JOSE Header "apu" (Agreement PartyUInfo) invalid`);try{a=W(r.apu)}catch{throw new q(`Failed to base64url decode the apu`)}}if(r.apv!==void 0){if(typeof r.apv!=`string`)throw new q(`JOSE Header "apv" (Agreement PartyVInfo) invalid`);try{o=W(r.apv)}catch{throw new q(`Failed to base64url decode the apv`)}}let s=await Vv(i,t,e===`ECDH-ES`?r.enc:e,e===`ECDH-ES`?dy(r.enc):parseInt(e.slice(-5,-2),10),a,o);if(e===`ECDH-ES`)return s;if(n===void 0)throw new q(`JWE Encrypted Key missing`);return jv(e.slice(-6),s,n)}case`RSA1_5`:case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:if(n===void 0)throw new q(`JWE Encrypted Key missing`);return sy(e,t,n);case`PBES2-HS256+A128KW`:case`PBES2-HS384+A192KW`:case`PBES2-HS512+A256KW`:{if(n===void 0)throw new q(`JWE Encrypted Key missing`);if(typeof r.p2c!=`number`)throw new q(`JOSE Header "p2c" (PBES2 Count) missing or invalid`);let a=i?.maxPBES2Count||1e4;if(r.p2c>a)throw new q(`JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds`);if(typeof r.p2s!=`string`)throw new q(`JOSE Header "p2s" (PBES2 Salt) missing or invalid`);let o;try{o=W(r.p2s)}catch{throw new q(`Failed to base64url decode the p2s`)}return Zv(e,t,n,r.p2c,o)}case`A128KW`:case`A192KW`:case`A256KW`:if(n===void 0)throw new q(`JWE Encrypted Key missing`);return jv(e,t,n);case`A128GCMKW`:case`A192GCMKW`:case`A256GCMKW`:{if(n===void 0)throw new q(`JWE Encrypted Key missing`);if(typeof r.iv!=`string`)throw new q(`JOSE Header "iv" (Initialization Vector) missing or invalid`);if(typeof r.tag!=`string`)throw new q(`JOSE Header "tag" (Authentication Tag) missing or invalid`);let i;try{i=W(r.iv)}catch{throw new q(`Failed to base64url decode the iv`)}let a;try{a=W(r.tag)}catch{throw new q(`Failed to base64url decode the tag`)}return Vy(e,t,n,i,a)}default:throw new K(`Invalid or unsupported "alg" (JWE Algorithm) header value`)}}var Wy=t((()=>{Mv(),Gv(),Qv(),cy(),O_(),uy(),Y(),py(),Dy(),Fy(),Dv(),Hy()}));function Gy(e,t,n,r,i){if(i.crit!==void 0&&r?.crit===void 0)throw new e(`"crit" (Critical) Header Parameter MUST be integrity protected`);if(!r||r.crit===void 0)return new Set;if(!Array.isArray(r.crit)||r.crit.length===0||r.crit.some(e=>typeof e!=`string`||e.length===0))throw new e(`"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present`);let a;a=n===void 0?t:new Map([...Object.entries(n),...t.entries()]);for(let t of r.crit){if(!a.has(t))throw new K(`Extension Header Parameter "${t}" is not recognized`);if(i[t]===void 0)throw new e(`Extension Header Parameter "${t}" is missing`);if(a.get(t)&&r[t]===void 0)throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(r.crit)}var Ky=t((()=>{Y()})),qy,Jy=t((()=>{qy=(e,t)=>{if(t!==void 0&&(!Array.isArray(t)||t.some(e=>typeof e!=`string`)))throw TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)}}));async function Yy(e,t,n){if(!Q(e))throw new q(`Flattened JWE must be an object`);if(e.protected===void 0&&e.header===void 0&&e.unprotected===void 0)throw new q(`JOSE Header missing`);if(e.iv!==void 0&&typeof e.iv!=`string`)throw new q(`JWE Initialization Vector incorrect type`);if(typeof e.ciphertext!=`string`)throw new q(`JWE Ciphertext missing or incorrect type`);if(e.tag!==void 0&&typeof e.tag!=`string`)throw new q(`JWE Authentication Tag incorrect type`);if(e.protected!==void 0&&typeof e.protected!=`string`)throw new q(`JWE Protected Header incorrect type`);if(e.encrypted_key!==void 0&&typeof e.encrypted_key!=`string`)throw new q(`JWE Encrypted Key incorrect type`);if(e.aad!==void 0&&typeof e.aad!=`string`)throw new q(`JWE AAD incorrect type`);if(e.header!==void 0&&!Q(e.header))throw new q(`JWE Shared Unprotected Header incorrect type`);if(e.unprotected!==void 0&&!Q(e.unprotected))throw new q(`JWE Per-Recipient Unprotected Header incorrect type`);let r;if(e.protected)try{let t=W(e.protected);r=JSON.parse(T_.decode(t))}catch{throw new q(`JWE Protected Header is invalid`)}if(!wv(r,e.header,e.unprotected))throw new q(`JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint`);let i={...r,...e.header,...e.unprotected};if(Gy(q,new Map,n?.crit,r,i),i.zip!==void 0)throw new K(`JWE "zip" (Compression Algorithm) Header Parameter is not supported.`);let{alg:a,enc:o}=i;if(typeof a!=`string`||!a)throw new q(`missing JWE Algorithm (alg) in JWE Header`);if(typeof o!=`string`||!o)throw new q(`missing JWE Encryption Algorithm (enc) in JWE Header`);let s=n&&qy(`keyManagementAlgorithms`,n.keyManagementAlgorithms),c=n&&qy(`contentEncryptionAlgorithms`,n.contentEncryptionAlgorithms);if(s&&!s.has(a)||!s&&a.startsWith(`PBES2`))throw new M_(`"alg" (Algorithm) Header Parameter value not allowed`);if(c&&!c.has(o))throw new M_(`"enc" (Encryption Algorithm) Header Parameter value not allowed`);let l;if(e.encrypted_key!==void 0)try{l=W(e.encrypted_key)}catch{throw new q(`Failed to base64url decode the encrypted_key`)}let u=!1;typeof t==`function`&&(t=await t(r,e),u=!0);let d;try{d=await Uy(a,t,l,i,n)}catch(e){if(e instanceof TypeError||e instanceof q||e instanceof K)throw e;d=fy(o)}let f,p;if(e.iv!==void 0)try{f=W(e.iv)}catch{throw new q(`Failed to base64url decode the iv`)}if(e.tag!==void 0)try{p=W(e.tag)}catch{throw new q(`Failed to base64url decode the tag`)}let m=V.encode(e.protected??``),h;h=e.aad===void 0?m:v_(m,V.encode(`.`),V.encode(e.aad));let g;try{g=W(e.ciphertext)}catch{throw new q(`Failed to base64url decode the ciphertext`)}let _={plaintext:await Sv(o,d,g,f,p,h)};if(e.protected!==void 0&&(_.protectedHeader=r),e.aad!==void 0)try{_.additionalAuthenticatedData=W(e.aad)}catch{throw new q(`Failed to base64url decode the aad`)}return e.unprotected!==void 0&&(_.sharedUnprotectedHeader=e.unprotected),e.header!==void 0&&(_.unprotectedHeader=e.header),u?{..._,key:t}:_}var Xy=t((()=>{O_(),Cv(),Y(),Tv(),Dv(),Wy(),H(),py(),Ky(),Jy()}));async function Zy(e,t,n){if(e instanceof Uint8Array&&(e=T_.decode(e)),typeof e!=`string`)throw new q(`Compact JWE must be a string or Uint8Array`);let{0:r,1:i,2:a,3:o,4:s,length:c}=e.split(`.`);if(c!==5)throw new q(`Invalid Compact JWE`);let l=await Yy({ciphertext:o,iv:a||void 0,protected:r,tag:s||void 0,encrypted_key:i||void 0},t,n),u={plaintext:l.plaintext,protectedHeader:l.protectedHeader};return typeof t==`function`?{...u,key:l.key}:u}var Qy=t((()=>{Xy(),Y(),H()}));async function $y(e,t,n){if(!Q(e))throw new q(`General JWE must be an object`);if(!Array.isArray(e.recipients)||!e.recipients.every(Q))throw new q(`JWE Recipients missing or incorrect type`);if(!e.recipients.length)throw new q(`JWE Recipients has no members`);for(let r of e.recipients)try{return await Yy({aad:e.aad,ciphertext:e.ciphertext,encrypted_key:r.encrypted_key,header:r.header,iv:e.iv,protected:e.protected,tag:e.tag,unprotected:e.unprotected},t,n)}catch{}throw new N_}var eb=t((()=>{Xy(),Y(),Dv()})),tb,nb=t((()=>{tb=Symbol()})),rb,ib=t((()=>{O_(),Y(),rv(),J_(),mv(),yv(),rb=e=>{let t;if(nv(e)){if(!e.extractable)throw TypeError(`CryptoKey is not extractable`);t=al.from(e)}else if(q_(e))t=e;else if(e instanceof Uint8Array)return{kty:`oct`,k:U(e)};else throw TypeError(pv(e,...Z,`Uint8Array`));if(t.type!==`secret`&&![`rsa`,`ec`,`ed25519`,`x25519`,`ed448`,`x448`].includes(t.asymmetricKeyType))throw new K(`Unsupported key asymmetricKeyType`);return t.export({format:`jwk`})}}));async function ab(e){return hy(e)}async function ob(e){return gy(e)}async function sb(e){return rb(e)}var cb=t((()=>{by(),ib()}));async function lb(e,t,n,r,i={}){let a,o,s;switch(Ny(e,n,`encrypt`),n=await ly.normalizePublicKey?.(n,e)||n,e){case`dir`:s=n;break;case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:{if(!Wv(n))throw new K(`ECDH with the provided key is not allowed or not supported by your javascript runtime`);let{apu:c,apv:l}=i,{epk:u}=i;u||=(await Hv(n)).privateKey;let{x:d,y:f,crv:p,kty:m}=await sb(u),h=await Vv(n,u,e===`ECDH-ES`?t:e,e===`ECDH-ES`?dy(t):parseInt(e.slice(-5,-2),10),c,l);if(o={epk:{x:d,crv:p,kty:m}},m===`EC`&&(o.epk.y=f),c&&(o.apu=U(c)),l&&(o.apv=U(l)),e===`ECDH-ES`){s=h;break}s=r||fy(t),a=await Av(e.slice(-6),h,s);break}case`RSA1_5`:case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:s=r||fy(t),a=await oy(e,n,s);break;case`PBES2-HS256+A128KW`:case`PBES2-HS384+A192KW`:case`PBES2-HS512+A256KW`:{s=r||fy(t);let{p2c:c,p2s:l}=i;({encryptedKey:a,...o}=await Xv(e,n,s,c,l));break}case`A128KW`:case`A192KW`:case`A256KW`:s=r||fy(t),a=await Av(e,n,s);break;case`A128GCMKW`:case`A192GCMKW`:case`A256GCMKW`:{s=r||fy(t);let{iv:c}=i;({encryptedKey:a,...o}=await By(e,n,s,c));break}default:throw new K(`Invalid or unsupported "alg" (JWE Algorithm) header value`)}return{cek:s,encryptedKey:a,parameters:o}}var ub=t((()=>{Mv(),Gv(),Qv(),cy(),O_(),uy(),py(),Y(),cb(),Fy(),Hy()})),db,fb=t((()=>{O_(),nb(),zy(),ub(),Y(),Tv(),H(),Ky(),db=class{_plaintext;_protectedHeader;_sharedUnprotectedHeader;_unprotectedHeader;_aad;_cek;_iv;_keyManagementParameters;constructor(e){if(!(e instanceof Uint8Array))throw TypeError(`plaintext must be an instance of Uint8Array`);this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw TypeError(`setKeyManagementParameters can only be called once`);return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw TypeError(`setSharedUnprotectedHeader can only be called once`);return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError(`setUnprotectedHeader can only be called once`);return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw TypeError(`setContentEncryptionKey can only be called once`);return this._cek=e,this}setInitializationVector(e){if(this._iv)throw TypeError(`setInitializationVector can only be called once`);return this._iv=e,this}async encrypt(e,t){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new q(`either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()`);if(!wv(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new q(`JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint`);let n={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(Gy(q,new Map,t?.crit,this._protectedHeader,n),n.zip!==void 0)throw new K(`JWE "zip" (Compression Algorithm) Header Parameter is not supported.`);let{alg:r,enc:i}=n;if(typeof r!=`string`||!r)throw new q(`JWE "alg" (Algorithm) Header Parameter missing or invalid`);if(typeof i!=`string`||!i)throw new q(`JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid`);let a;if(this._cek&&(r===`dir`||r===`ECDH-ES`))throw TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${r}`);let o;{let n;({cek:o,encryptedKey:a,parameters:n}=await lb(r,i,e,this._cek,this._keyManagementParameters)),n&&(t&&tb in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...n}:this.setUnprotectedHeader(n):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...n}:this.setProtectedHeader(n))}let s,c,l;c=this._protectedHeader?V.encode(U(JSON.stringify(this._protectedHeader))):V.encode(``),this._aad?(l=U(this._aad),s=v_(c,V.encode(`.`),V.encode(l))):s=c;let{ciphertext:u,tag:d,iv:f}=await Ry(i,this._plaintext,o,this._iv,s),p={ciphertext:U(u)};return f&&(p.iv=U(f)),d&&(p.tag=U(d)),a&&(p.encrypted_key=U(a)),l&&(p.aad=l),this._protectedHeader&&(p.protected=T_.decode(c)),this._sharedUnprotectedHeader&&(p.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(p.header=this._unprotectedHeader),p}}})),pb,mb,hb=t((()=>{fb(),nb(),Y(),py(),Tv(),ub(),O_(),Ky(),pb=class{parent;unprotectedHeader;key;options;constructor(e,t,n){this.parent=e,this.key=t,this.options=n}setUnprotectedHeader(e){if(this.unprotectedHeader)throw TypeError(`setUnprotectedHeader can only be called once`);return this.unprotectedHeader=e,this}addRecipient(...e){return this.parent.addRecipient(...e)}encrypt(...e){return this.parent.encrypt(...e)}done(){return this.parent}},mb=class{_plaintext;_recipients=[];_protectedHeader;_unprotectedHeader;_aad;constructor(e){this._plaintext=e}addRecipient(e,t){let n=new pb(this,e,{crit:t?.crit});return this._recipients.push(n),n}setProtectedHeader(e){if(this._protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError(`setSharedUnprotectedHeader can only be called once`);return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}async encrypt(){if(!this._recipients.length)throw new q(`at least one recipient must be added`);if(this._recipients.length===1){let[e]=this._recipients,t=await new db(this._plaintext).setAdditionalAuthenticatedData(this._aad).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(e.unprotectedHeader).encrypt(e.key,{...e.options}),n={ciphertext:t.ciphertext,iv:t.iv,recipients:[{}],tag:t.tag};return t.aad&&(n.aad=t.aad),t.protected&&(n.protected=t.protected),t.unprotected&&(n.unprotected=t.unprotected),t.encrypted_key&&(n.recipients[0].encrypted_key=t.encrypted_key),t.header&&(n.recipients[0].header=t.header),n}let e;for(let t=0;t<this._recipients.length;t++){let n=this._recipients[t];if(!wv(this._protectedHeader,this._unprotectedHeader,n.unprotectedHeader))throw new q(`JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint`);let r={...this._protectedHeader,...this._unprotectedHeader,...n.unprotectedHeader},{alg:i}=r;if(typeof i!=`string`||!i)throw new q(`JWE "alg" (Algorithm) Header Parameter missing or invalid`);if(i===`dir`||i===`ECDH-ES`)throw new q(`"dir" and "ECDH-ES" alg may only be used with a single recipient`);if(typeof r.enc!=`string`||!r.enc)throw new q(`JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid`);if(!e)e=r.enc;else if(e!==r.enc)throw new q(`JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients`);if(Gy(q,new Map,n.options.crit,this._protectedHeader,r),r.zip!==void 0)throw new K(`JWE "zip" (Compression Algorithm) Header Parameter is not supported.`)}let t=fy(e),n={ciphertext:``,iv:``,recipients:[],tag:``};for(let r=0;r<this._recipients.length;r++){let i=this._recipients[r],a={};n.recipients.push(a);let o={...this._protectedHeader,...this._unprotectedHeader,...i.unprotectedHeader}.alg.startsWith(`PBES2`)?2048+r:void 0;if(r===0){let e=await new db(this._plaintext).setAdditionalAuthenticatedData(this._aad).setContentEncryptionKey(t).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(i.unprotectedHeader).setKeyManagementParameters({p2c:o}).encrypt(i.key,{...i.options,[tb]:!0});n.ciphertext=e.ciphertext,n.iv=e.iv,n.tag=e.tag,e.aad&&(n.aad=e.aad),e.protected&&(n.protected=e.protected),e.unprotected&&(n.unprotected=e.unprotected),a.encrypted_key=e.encrypted_key,e.header&&(a.header=e.header);continue}let{encryptedKey:s,parameters:c}=await lb(i.unprotectedHeader?.alg||this._protectedHeader?.alg||this._unprotectedHeader?.alg,e,i.key,t,{p2c:o});a.encrypted_key=U(s),(i.unprotectedHeader||c)&&(a.header={...i.unprotectedHeader,...c})}return n}}}));function gb(e){switch(e){case`PS256`:case`RS256`:case`ES256`:case`ES256K`:return`sha256`;case`PS384`:case`RS384`:case`ES384`:return`sha384`;case`PS512`:case`RS512`:case`ES512`:return`sha512`;case`Ed25519`:case`EdDSA`:return;default:throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var _b=t((()=>{Y()}));function vb(e,t){let n,r,i;if(t instanceof al)n=t.asymmetricKeyType,r=t.asymmetricKeyDetails;else switch(i=!0,t.kty){case`RSA`:n=`rsa`;break;case`EC`:n=`ec`;break;case`OKP`:if(t.crv===`Ed25519`){n=`ed25519`;break}if(t.crv===`Ed448`){n=`ed448`;break}throw TypeError(`Invalid key for this operation, its crv must be Ed25519 or Ed448`);default:throw TypeError(`Invalid key for this operation, its kty must be RSA, OKP, or EC`)}let a;switch(e){case`Ed25519`:if(n!==`ed25519`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be ed25519`);break;case`EdDSA`:if(![`ed25519`,`ed448`].includes(n))throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be ed25519 or ed448`);break;case`RS256`:case`RS384`:case`RS512`:if(n!==`rsa`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be rsa`);$v(t,e);break;case`PS256`:case`PS384`:case`PS512`:if(n===`rsa-pss`){let{hashAlgorithm:t,mgf1HashAlgorithm:n,saltLength:i}=r,a=parseInt(e.slice(-3),10);if(t!==void 0&&(t!==`sha${a}`||n!==t))throw TypeError(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}`);if(i!==void 0&&i>a>>3)throw TypeError(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}`)}else if(n!==`rsa`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be rsa or rsa-pss`);$v(t,e),a={padding:ol.RSA_PKCS1_PSS_PADDING,saltLength:ol.RSA_PSS_SALTLEN_DIGEST};break;case`ES256`:case`ES256K`:case`ES384`:case`ES512`:{if(n!==`ec`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be ec`);let r=zv(t),i=yb.get(e);if(r!==i)throw TypeError(`Invalid key curve for the algorithm, its curve must be ${i}, got ${r}`);a={dsaEncoding:`ieee-p1363`};break}default:throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`)}return i?{format:`jwk`,key:t,...a}:a?{...a,key:t}:t}var yb,bb=t((()=>{Bv(),Y(),ey(),yb=new Map([[`ES256`,`P-256`],[`ES256K`,`secp256k1`],[`ES384`,`P-384`],[`ES512`,`P-521`]])}));function xb(e){switch(e){case`HS256`:return`sha256`;case`HS384`:return`sha384`;case`HS512`:return`sha512`;default:throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var Sb=t((()=>{Y()}));function Cb(e,t,n){if(t instanceof Uint8Array){if(!e.startsWith(`HS`))throw TypeError(pv(t,...Z));return pl(t)}if(t instanceof al)return t;if(nv(t))return cv(t,e,n),al.from(t);if(Nv(t))return e.startsWith(`HS`)?pl(Buffer.from(t.k,`base64url`)):t;throw TypeError(pv(t,...Z,`Uint8Array`,`JSON Web Key`))}var wb=t((()=>{rv(),uv(),mv(),yv(),Lv()})),Tb,Eb,Db=t((()=>{_b(),Sb(),bb(),wb(),Tb=El(il.sign),Eb=async(e,t,n)=>{let r=Cb(e,t,`sign`);if(e.startsWith(`HS`)){let t=il.createHmac(xb(e),r);return t.update(n),t.digest()}return Tb(gb(e),n,vb(e,r))}})),Ob,kb,Ab=t((()=>{_b(),bb(),Db(),wb(),Ob=El(il.verify),kb=async(e,t,n,r)=>{let i=Cb(e,t,`verify`);if(e.startsWith(`HS`)){let t=await Eb(e,i,r),a=n;try{return il.timingSafeEqual(a,t)}catch{return!1}}let a=gb(e),o=vb(e,i);try{return await Ob(a,r,o,n)}catch{return!1}}}));async function jb(e,t,n){if(!Q(e))throw new J(`Flattened JWS must be an object`);if(e.protected===void 0&&e.header===void 0)throw new J(`Flattened JWS must have either of the "protected" or "header" members`);if(e.protected!==void 0&&typeof e.protected!=`string`)throw new J(`JWS Protected Header incorrect type`);if(e.payload===void 0)throw new J(`JWS Payload missing`);if(typeof e.signature!=`string`)throw new J(`JWS Signature missing or incorrect type`);if(e.header!==void 0&&!Q(e.header))throw new J(`JWS Unprotected Header incorrect type`);let r={};if(e.protected)try{let t=W(e.protected);r=JSON.parse(T_.decode(t))}catch{throw new J(`JWS Protected Header is invalid`)}if(!wv(r,e.header))throw new J(`JWS Protected and JWS Unprotected Header Parameter names must be disjoint`);let i={...r,...e.header},a=Gy(J,new Map([[`b64`,!0]]),n?.crit,r,i),o=!0;if(a.has(`b64`)&&(o=r.b64,typeof o!=`boolean`))throw new J(`The "b64" (base64url-encode payload) Header Parameter must be a boolean`);let{alg:s}=i;if(typeof s!=`string`||!s)throw new J(`JWS "alg" (Algorithm) Header Parameter missing or invalid`);let c=n&&qy(`algorithms`,n.algorithms);if(c&&!c.has(s))throw new M_(`"alg" (Algorithm) Header Parameter value not allowed`);if(o){if(typeof e.payload!=`string`)throw new J(`JWS Payload must be a string`)}else if(typeof e.payload!=`string`&&!(e.payload instanceof Uint8Array))throw new J(`JWS Payload must be a string or an Uint8Array instance`);let l=!1;typeof t==`function`?(t=await t(r,e),l=!0,Py(s,t,`verify`),Nv(t)&&(t=await Ey(t,s))):Py(s,t,`verify`);let u=v_(V.encode(e.protected??``),V.encode(`.`),typeof e.payload==`string`?V.encode(e.payload):e.payload),d;try{d=W(e.signature)}catch{throw new J(`Failed to base64url decode the signature`)}if(!await kb(s,t,d,u))throw new B_;let f;if(o)try{f=W(e.payload)}catch{throw new J(`Failed to base64url decode the payload`)}else f=typeof e.payload==`string`?V.encode(e.payload):e.payload;let p={payload:f};return e.protected!==void 0&&(p.protectedHeader=r),e.header!==void 0&&(p.unprotectedHeader=e.header),l?{...p,key:t}:p}var Mb=t((()=>{O_(),Ab(),Y(),H(),Tv(),Dv(),Fy(),Ky(),Jy(),Lv(),Dy()}));async function Nb(e,t,n){if(e instanceof Uint8Array&&(e=T_.decode(e)),typeof e!=`string`)throw new J(`Compact JWS must be a string or Uint8Array`);let{0:r,1:i,2:a,length:o}=e.split(`.`);if(o!==3)throw new J(`Invalid Compact JWS`);let s=await jb({payload:i,protected:r,signature:a},t,n),c={payload:s.payload,protectedHeader:s.protectedHeader};return typeof t==`function`?{...c,key:s.key}:c}var Pb=t((()=>{Mb(),Y(),H()}));async function Fb(e,t,n){if(!Q(e))throw new J(`General JWS must be an object`);if(!Array.isArray(e.signatures)||!e.signatures.every(Q))throw new J(`JWS Signatures missing or incorrect type`);for(let r of e.signatures)try{return await jb({header:r.header,payload:e.payload,protected:r.protected,signature:r.signature},t,n)}catch{}throw new B_}var Ib=t((()=>{Mb(),Y(),Dv()})),Lb,Rb=t((()=>{Lb=e=>Math.floor(e.getTime()/1e3)})),zb,Bb,Vb,Hb,Ub,Wb,Gb,Kb=t((()=>{zb=60,Bb=zb*60,Vb=Bb*24,Hb=Vb*7,Ub=Vb*365.25,Wb=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,Gb=e=>{let t=Wb.exec(e);if(!t||t[4]&&t[1])throw TypeError(`Invalid time period format`);let n=parseFloat(t[2]),r=t[3].toLowerCase(),i;switch(r){case`sec`:case`secs`:case`second`:case`seconds`:case`s`:i=Math.round(n);break;case`minute`:case`minutes`:case`min`:case`mins`:case`m`:i=Math.round(n*zb);break;case`hour`:case`hours`:case`hr`:case`hrs`:case`h`:i=Math.round(n*Bb);break;case`day`:case`days`:case`d`:i=Math.round(n*Vb);break;case`week`:case`weeks`:case`w`:i=Math.round(n*Hb);break;default:i=Math.round(n*Ub);break}return t[1]===`-`||t[4]===`ago`?-i:i}})),qb,Jb,Yb,Xb=t((()=>{Y(),H(),Rb(),Kb(),Dv(),qb=e=>e.toLowerCase().replace(/^application\//,``),Jb=(e,t)=>typeof e==`string`?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1,Yb=(e,t,n={})=>{let r;try{r=JSON.parse(T_.decode(t))}catch{}if(!Q(r))throw new P_(`JWT Claims Set must be a top-level JSON object`);let{typ:i}=n;if(i&&(typeof e.typ!=`string`||qb(e.typ)!==qb(i)))throw new A_(`unexpected "typ" JWT header value`,r,`typ`,`check_failed`);let{requiredClaims:a=[],issuer:o,subject:s,audience:c,maxTokenAge:l}=n,u=[...a];l!==void 0&&u.push(`iat`),c!==void 0&&u.push(`aud`),s!==void 0&&u.push(`sub`),o!==void 0&&u.push(`iss`);for(let e of new Set(u.reverse()))if(!(e in r))throw new A_(`missing required "${e}" claim`,r,e,`missing`);if(o&&!(Array.isArray(o)?o:[o]).includes(r.iss))throw new A_(`unexpected "iss" claim value`,r,`iss`,`check_failed`);if(s&&r.sub!==s)throw new A_(`unexpected "sub" claim value`,r,`sub`,`check_failed`);if(c&&!Jb(r.aud,typeof c==`string`?[c]:c))throw new A_(`unexpected "aud" claim value`,r,`aud`,`check_failed`);let d;switch(typeof n.clockTolerance){case`string`:d=Gb(n.clockTolerance);break;case`number`:d=n.clockTolerance;break;case`undefined`:d=0;break;default:throw TypeError(`Invalid clockTolerance option type`)}let{currentDate:f}=n,p=Lb(f||new Date);if((r.iat!==void 0||l)&&typeof r.iat!=`number`)throw new A_(`"iat" claim must be a number`,r,`iat`,`invalid`);if(r.nbf!==void 0){if(typeof r.nbf!=`number`)throw new A_(`"nbf" claim must be a number`,r,`nbf`,`invalid`);if(r.nbf>p+d)throw new A_(`"nbf" claim timestamp check failed`,r,`nbf`,`check_failed`)}if(r.exp!==void 0){if(typeof r.exp!=`number`)throw new A_(`"exp" claim must be a number`,r,`exp`,`invalid`);if(r.exp<=p-d)throw new j_(`"exp" claim timestamp check failed`,r,`exp`,`check_failed`)}if(l){let e=p-r.iat,t=typeof l==`number`?l:Gb(l);if(e-d>t)throw new j_(`"iat" claim timestamp check failed (too far in the past)`,r,`iat`,`check_failed`);if(e<0-d)throw new A_(`"iat" claim timestamp check failed (it should be in the past)`,r,`iat`,`check_failed`)}return r}}));async function Zb(e,t,n){let r=await Nb(e,t,n);if(r.protectedHeader.crit?.includes(`b64`)&&r.protectedHeader.b64===!1)throw new P_(`JWTs MUST NOT use unencoded payload`);let i={payload:Yb(r.protectedHeader,r.payload,n),protectedHeader:r.protectedHeader};return typeof t==`function`?{...i,key:r.key}:i}var Qb=t((()=>{Pb(),Xb(),Y()}));async function $b(e,t,n){let r=await Zy(e,t,n),i=Yb(r.protectedHeader,r.plaintext,n),{protectedHeader:a}=r;if(a.iss!==void 0&&a.iss!==i.iss)throw new A_(`replicated "iss" claim header parameter mismatch`,i,`iss`,`mismatch`);if(a.sub!==void 0&&a.sub!==i.sub)throw new A_(`replicated "sub" claim header parameter mismatch`,i,`sub`,`mismatch`);if(a.aud!==void 0&&JSON.stringify(a.aud)!==JSON.stringify(i.aud))throw new A_(`replicated "aud" claim header parameter mismatch`,i,`aud`,`mismatch`);let o={payload:i,protectedHeader:a};return typeof t==`function`?{...o,key:r.key}:o}var ex=t((()=>{Qy(),Xb(),Y()})),tx,nx=t((()=>{fb(),tx=class{_flattened;constructor(e){this._flattened=new db(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){let n=await this._flattened.encrypt(e,t);return[n.protected,n.encrypted_key,n.iv,n.ciphertext,n.tag].join(`.`)}}})),rx,ix=t((()=>{O_(),Db(),Tv(),Y(),H(),Fy(),Ky(),rx=class{_payload;_protectedHeader;_unprotectedHeader;constructor(e){if(!(e instanceof Uint8Array))throw TypeError(`payload must be an instance of Uint8Array`);this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError(`setUnprotectedHeader can only be called once`);return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new J(`either setProtectedHeader or setUnprotectedHeader must be called before #sign()`);if(!wv(this._protectedHeader,this._unprotectedHeader))throw new J(`JWS Protected and JWS Unprotected Header Parameter names must be disjoint`);let n={...this._protectedHeader,...this._unprotectedHeader},r=Gy(J,new Map([[`b64`,!0]]),t?.crit,this._protectedHeader,n),i=!0;if(r.has(`b64`)&&(i=this._protectedHeader.b64,typeof i!=`boolean`))throw new J(`The "b64" (base64url-encode payload) Header Parameter must be a boolean`);let{alg:a}=n;if(typeof a!=`string`||!a)throw new J(`JWS "alg" (Algorithm) Header Parameter missing or invalid`);Py(a,e,`sign`);let o=this._payload;i&&(o=V.encode(U(o)));let s;s=this._protectedHeader?V.encode(U(JSON.stringify(this._protectedHeader))):V.encode(``);let c={signature:U(await Eb(a,e,v_(s,V.encode(`.`),o))),payload:``};return i&&(c.payload=T_.decode(o)),this._unprotectedHeader&&(c.header=this._unprotectedHeader),this._protectedHeader&&(c.protected=T_.decode(s)),c}}})),ax,ox=t((()=>{ix(),ax=class{_flattened;constructor(e){this._flattened=new rx(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){let n=await this._flattened.sign(e,t);if(n.payload===void 0)throw TypeError(`use the flattened module for creating JWS with b64: false`);return`${n.protected}.${n.payload}.${n.signature}`}}})),sx,cx,lx=t((()=>{ix(),Y(),sx=class{parent;protectedHeader;unprotectedHeader;options;key;constructor(e,t,n){this.parent=e,this.key=t,this.options=n}setProtectedHeader(e){if(this.protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this.protectedHeader=e,this}setUnprotectedHeader(e){if(this.unprotectedHeader)throw TypeError(`setUnprotectedHeader can only be called once`);return this.unprotectedHeader=e,this}addSignature(...e){return this.parent.addSignature(...e)}sign(...e){return this.parent.sign(...e)}done(){return this.parent}},cx=class{_payload;_signatures=[];constructor(e){this._payload=e}addSignature(e,t){let n=new sx(this,e,t);return this._signatures.push(n),n}async sign(){if(!this._signatures.length)throw new J(`at least one signature must be added`);let e={signatures:[],payload:``};for(let t=0;t<this._signatures.length;t++){let n=this._signatures[t],r=new rx(this._payload);r.setProtectedHeader(n.protectedHeader),r.setUnprotectedHeader(n.unprotectedHeader);let{payload:i,...a}=await r.sign(n.key,n.options);if(t===0)e.payload=i;else if(e.payload!==i)throw new J(`inconsistent use of JWS Unencoded Payload (RFC7797)`);e.signatures.push(a)}return e}}}));function ux(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}var dx,fx=t((()=>{Rb(),Dv(),Kb(),dx=class{_payload;constructor(e={}){if(!Q(e))throw TypeError(`JWT Claims Set MUST be an object`);this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return typeof e==`number`?this._payload={...this._payload,nbf:ux(`setNotBefore`,e)}:e instanceof Date?this._payload={...this._payload,nbf:ux(`setNotBefore`,Lb(e))}:this._payload={...this._payload,nbf:Lb(new Date)+Gb(e)},this}setExpirationTime(e){return typeof e==`number`?this._payload={...this._payload,exp:ux(`setExpirationTime`,e)}:e instanceof Date?this._payload={...this._payload,exp:ux(`setExpirationTime`,Lb(e))}:this._payload={...this._payload,exp:Lb(new Date)+Gb(e)},this}setIssuedAt(e){return e===void 0?this._payload={...this._payload,iat:Lb(new Date)}:e instanceof Date?this._payload={...this._payload,iat:ux(`setIssuedAt`,Lb(e))}:typeof e==`string`?this._payload={...this._payload,iat:ux(`setIssuedAt`,Lb(new Date)+Gb(e))}:this._payload={...this._payload,iat:ux(`setIssuedAt`,e)},this}}})),px,mx=t((()=>{ox(),Y(),H(),fx(),px=class extends dx{_protectedHeader;setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,t){let n=new ax(V.encode(JSON.stringify(this._payload)));if(n.setProtectedHeader(this._protectedHeader),Array.isArray(this._protectedHeader?.crit)&&this._protectedHeader.crit.includes(`b64`)&&this._protectedHeader.b64===!1)throw new P_(`JWTs MUST NOT use unencoded payload`);return n.sign(e,t)}}})),hx,gx=t((()=>{nx(),H(),fx(),hx=class extends dx{_cek;_iv;_keyManagementParameters;_protectedHeader;_replicateIssuerAsHeader;_replicateSubjectAsHeader;_replicateAudienceAsHeader;setProtectedHeader(e){if(this._protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this._protectedHeader=e,this}setKeyManagementParameters(e){if(this._keyManagementParameters)throw TypeError(`setKeyManagementParameters can only be called once`);return this._keyManagementParameters=e,this}setContentEncryptionKey(e){if(this._cek)throw TypeError(`setContentEncryptionKey can only be called once`);return this._cek=e,this}setInitializationVector(e){if(this._iv)throw TypeError(`setInitializationVector can only be called once`);return this._iv=e,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(e,t){let n=new tx(V.encode(JSON.stringify(this._payload)));return this._replicateIssuerAsHeader&&(this._protectedHeader={...this._protectedHeader,iss:this._payload.iss}),this._replicateSubjectAsHeader&&(this._protectedHeader={...this._protectedHeader,sub:this._payload.sub}),this._replicateAudienceAsHeader&&(this._protectedHeader={...this._protectedHeader,aud:this._payload.aud}),n.setProtectedHeader(this._protectedHeader),this._iv&&n.setInitializationVector(this._iv),this._cek&&n.setContentEncryptionKey(this._cek),this._keyManagementParameters&&n.setKeyManagementParameters(this._keyManagementParameters),n.encrypt(e,t)}}}));async function _x(e,t){if(!Q(e))throw TypeError(`JWK must be an object`);if(t??=`sha256`,t!==`sha256`&&t!==`sha384`&&t!==`sha512`)throw TypeError(`digestAlgorithm must one of "sha256", "sha384", or "sha512"`);let n;switch(e.kty){case`EC`:yx(e.crv,`"crv" (Curve) Parameter`),yx(e.x,`"x" (X Coordinate) Parameter`),yx(e.y,`"y" (Y Coordinate) Parameter`),n={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case`OKP`:yx(e.crv,`"crv" (Subtype of Key Pair) Parameter`),yx(e.x,`"x" (Public Key) Parameter`),n={crv:e.crv,kty:e.kty,x:e.x};break;case`RSA`:yx(e.e,`"e" (Exponent) Parameter`),yx(e.n,`"n" (Modulus) Parameter`),n={e:e.e,kty:e.kty,n:e.n};break;case`oct`:yx(e.k,`"k" (Key Value) Parameter`),n={k:e.k,kty:e.kty};break;default:throw new K(`"kty" (Key Type) Parameter missing or unsupported`)}let r=V.encode(JSON.stringify(n));return U(await g_(t,r))}async function vx(e,t){t??=`sha256`;let n=await _x(e,t);return`urn:ietf:params:oauth:jwk-thumbprint:sha-${t.slice(-3)}:${n}`}var yx,bx=t((()=>{__(),O_(),Y(),H(),Dv(),yx=(e,t)=>{if(typeof e!=`string`||!e)throw new F_(`${t} missing or invalid`)}}));async function xx(e,t){let n={...e,...t?.header};if(!Q(n.jwk))throw new J(`"jwk" (JSON Web Key) Header Parameter must be a JSON object`);let r=await Ey({...n.jwk,ext:!0},n.alg);if(r instanceof Uint8Array||r.type!==`public`)throw new J(`"jwk" (JSON Web Key) Header Parameter must be a public key`);return r}var Sx=t((()=>{Dy(),Dv(),Y()}));function Cx(e){switch(typeof e==`string`&&e.slice(0,2)){case`RS`:case`PS`:return`RSA`;case`ES`:return`EC`;case`Ed`:return`OKP`;default:throw new K(`Unsupported "alg" value for a JSON Web Key Set`)}}function wx(e){return e&&typeof e==`object`&&Array.isArray(e.keys)&&e.keys.every(Tx)}function Tx(e){return Q(e)}function Ex(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}async function Dx(e,t,n){let r=e.get(t)||e.set(t,{}).get(t);if(r[n]===void 0){let e=await Ey({...t,ext:!0},n);if(e instanceof Uint8Array||e.type!==`public`)throw new I_(`JSON Web Key Set members must be public keys`);r[n]=e}return r[n]}function Ox(e){let t=new kx(e),n=async(e,n)=>t.getKey(e,n);return Object.defineProperties(n,{jwks:{value:()=>Ex(t._jwks),enumerable:!0,configurable:!1,writable:!1}}),n}var kx,Ax=t((()=>{Dy(),Y(),Dv(),kx=class{_jwks;_cached=new WeakMap;constructor(e){if(!wx(e))throw new I_(`JSON Web Key Set malformed`);this._jwks=Ex(e)}async getKey(e,t){let{alg:n,kid:r}={...e,...t?.header},i=Cx(n),a=this._jwks.keys.filter(e=>{let t=i===e.kty;if(t&&typeof r==`string`&&(t=r===e.kid),t&&typeof e.alg==`string`&&(t=n===e.alg),t&&typeof e.use==`string`&&(t=e.use===`sig`),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes(`verify`)),t)switch(n){case`ES256`:t=e.crv===`P-256`;break;case`ES256K`:t=e.crv===`secp256k1`;break;case`ES384`:t=e.crv===`P-384`;break;case`ES512`:t=e.crv===`P-521`;break;case`Ed25519`:t=e.crv===`Ed25519`;break;case`EdDSA`:t=e.crv===`Ed25519`||e.crv===`Ed448`;break}return t}),{0:o,length:s}=a;if(s===0)throw new L_;if(s!==1){let e=new R_,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(let e of a)try{yield await Dx(t,e,n)}catch{}},e}return Dx(this._cached,o,n)}}})),jx,Mx=t((()=>{Y(),H(),jx=async(e,t,n)=>{let r;switch(e.protocol){case`https:`:r=Pl.get;break;case`http:`:r=kl.get;break;default:throw TypeError(`Unsupported URL protocol.`)}let{agent:i,headers:a}=n,o=r(e.href,{agent:i,timeout:t,headers:a}),[s]=await Promise.race([Al(o,`response`),Al(o,`timeout`)]);if(!s)throw o.destroy(),new z_;if(s.statusCode!==200)throw new G(`Expected 200 OK from the JSON Web Key Set HTTP response`);let c=[];for await(let e of s)c.push(e);try{return JSON.parse(T_.decode(v_(...c)))}catch{throw new G(`Failed to parse the JSON Web Key Set HTTP response as JSON`)}}}));function Nx(){return typeof WebSocketPair<`u`||typeof navigator<`u`&&navigator.userAgent===`Cloudflare-Workers`||typeof EdgeRuntime<`u`&&EdgeRuntime===`vercel`}function Px(e,t){return!(typeof e!=`object`||!e||!(`uat`in e)||typeof e.uat!=`number`||Date.now()-e.uat>=t||!(`jwks`in e)||!Q(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,Q))}function Fx(e,t){let n=new Rx(e,t),r=async(e,t)=>n.getKey(e,t);return Object.defineProperties(r,{coolingDown:{get:()=>n.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>n.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>n.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>!!n._pendingFetch,enumerable:!0,configurable:!1},jwks:{value:()=>n._local?.jwks(),enumerable:!0,configurable:!1,writable:!1}}),r}var Ix,Lx,Rx,zx,Bx=t((()=>{Mx(),Y(),Ax(),Dv(),(typeof navigator>`u`||!navigator.userAgent?.startsWith?.(`Mozilla/5.0 `))&&(Ix=`jose/v5.10.0`),Lx=Symbol(),Rx=class{_url;_timeoutDuration;_cooldownDuration;_cacheMaxAge;_jwksTimestamp;_pendingFetch;_options;_local;_cache;constructor(e,t){if(!(e instanceof URL))throw TypeError(`url must be an instance of URL`);this._url=new URL(e.href),this._options={agent:t?.agent,headers:t?.headers},this._timeoutDuration=typeof t?.timeoutDuration==`number`?t?.timeoutDuration:5e3,this._cooldownDuration=typeof t?.cooldownDuration==`number`?t?.cooldownDuration:3e4,this._cacheMaxAge=typeof t?.cacheMaxAge==`number`?t?.cacheMaxAge:6e5,t?.[Lx]!==void 0&&(this._cache=t?.[Lx],Px(t?.[Lx],this._cacheMaxAge)&&(this._jwksTimestamp=this._cache.uat,this._local=Ox(this._cache.jwks)))}coolingDown(){return typeof this._jwksTimestamp==`number`&&Date.now()<this._jwksTimestamp+this._cooldownDuration}fresh(){return typeof this._jwksTimestamp==`number`&&Date.now()<this._jwksTimestamp+this._cacheMaxAge}async getKey(e,t){(!this._local||!this.fresh())&&await this.reload();try{return await this._local(e,t)}catch(n){if(n instanceof L_&&this.coolingDown()===!1)return await this.reload(),this._local(e,t);throw n}}async reload(){this._pendingFetch&&Nx()&&(this._pendingFetch=void 0);let e=new Headers(this._options.headers);Ix&&!e.has(`User-Agent`)&&(e.set(`User-Agent`,Ix),this._options.headers=Object.fromEntries(e.entries())),this._pendingFetch||=jx(this._url,this._timeoutDuration,this._options).then(e=>{this._local=Ox(e),this._cache&&(this._cache.uat=Date.now(),this._cache.jwks=e),this._jwksTimestamp=Date.now(),this._pendingFetch=void 0}).catch(e=>{throw this._pendingFetch=void 0,e}),await this._pendingFetch}},zx=Lx})),Vx,Hx=t((()=>{O_(),H(),Y(),Xb(),fx(),Vx=class extends dx{encode(){return`${U(JSON.stringify({alg:`none`}))}.${U(JSON.stringify(this._payload))}.`}static decode(e,t){if(typeof e!=`string`)throw new P_(`Unsecured JWT must be a string`);let{0:n,1:r,2:i,length:a}=e.split(`.`);if(a!==3||i!==``)throw new P_(`Invalid Unsecured JWT`);let o;try{if(o=JSON.parse(T_.decode(W(n))),o.alg!==`none`)throw Error()}catch{throw new P_(`Invalid Unsecured JWT`)}return{payload:Yb(o,W(r),t),header:o}}}})),Ux=r({decode:()=>Gx,encode:()=>Wx}),Wx,Gx,Kx=t((()=>{O_(),Wx=U,Gx=W}));function qx(e){let t;if(typeof e==`string`){let n=e.split(`.`);(n.length===3||n.length===5)&&([t]=n)}else if(typeof e==`object`&&e)if(`protected`in e)t=e.protected;else throw TypeError(`Token does not contain a Protected Header`);try{if(typeof t!=`string`||!t)throw Error();let e=JSON.parse(T_.decode(Gx(t)));if(!Q(e))throw Error();return e}catch{throw TypeError(`Invalid Token or Protected Header formatting`)}}var Jx=t((()=>{Kx(),H(),Dv()}));function Yx(e){if(typeof e!=`string`)throw new P_(`JWTs must use Compact JWS serialization, JWT must be a string`);let{1:t,length:n}=e.split(`.`);if(n===5)throw new P_(`Only JWTs using Compact JWS serialization can be decoded`);if(n!==3)throw new P_(`Invalid JWT`);if(!t)throw new P_(`JWTs must contain a payload`);let r;try{r=Gx(t)}catch{throw new P_(`Failed to base64url decode the payload`)}let i;try{i=JSON.parse(T_.decode(r))}catch{throw new P_(`Failed to parse the decoded payload as JSON`)}if(!Q(i))throw new P_(`Invalid JWT Claims Set`);return i}var Xx=t((()=>{Kx(),H(),Dv(),Y()}));async function Zx(e,t){let n;switch(e){case`HS256`:case`HS384`:case`HS512`:case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:n=parseInt(e.slice(-3),10);break;case`A128KW`:case`A192KW`:case`A256KW`:case`A128GCMKW`:case`A192GCMKW`:case`A256GCMKW`:case`A128GCM`:case`A192GCM`:case`A256GCM`:n=parseInt(e.slice(1,4),10);break;default:throw new K(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}return pl(bl(new Uint8Array(n>>3)))}async function Qx(e,t){switch(e){case`RS256`:case`RS384`:case`RS512`:case`PS256`:case`PS384`:case`PS512`:case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:case`RSA1_5`:{let e=t?.modulusLength??2048;if(typeof e!=`number`||e<2048)throw new K(`Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used`);return await $x(`rsa`,{modulusLength:e,publicExponent:65537})}case`ES256`:return $x(`ec`,{namedCurve:`P-256`});case`ES256K`:return $x(`ec`,{namedCurve:`secp256k1`});case`ES384`:return $x(`ec`,{namedCurve:`P-384`});case`ES512`:return $x(`ec`,{namedCurve:`P-521`});case`Ed25519`:return $x(`ed25519`);case`EdDSA`:switch(t?.crv){case void 0:case`Ed25519`:return $x(`ed25519`);case`Ed448`:return $x(`ed448`);default:throw new K(`Invalid or unsupported crv option provided, supported values are Ed25519 and Ed448`)}case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:{let e=t?.crv??`P-256`;switch(e){case void 0:case`P-256`:case`P-384`:case`P-521`:return $x(`ec`,{namedCurve:e});case`X25519`:return $x(`x25519`);case`X448`:return $x(`x448`);default:throw new K(`Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448`)}}default:throw new K(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}}var $x,eS=t((()=>{V_(),Y(),$x=El(hl)}));async function tS(e,t){return Qx(e,t)}var nS=t((()=>{eS()}));async function rS(e,t){return Zx(e,t)}var iS=t((()=>{eS()})),aS,oS=t((()=>{aS=`node:crypto`})),sS,cS=t((()=>{oS(),sS=aS})),lS=r({CompactEncrypt:()=>tx,CompactSign:()=>ax,EmbeddedJWK:()=>xx,EncryptJWT:()=>hx,FlattenedEncrypt:()=>db,FlattenedSign:()=>rx,GeneralEncrypt:()=>mb,GeneralSign:()=>cx,SignJWT:()=>px,UnsecuredJWT:()=>Vx,base64url:()=>Ux,calculateJwkThumbprint:()=>_x,calculateJwkThumbprintUri:()=>vx,compactDecrypt:()=>Zy,compactVerify:()=>Nb,createLocalJWKSet:()=>Ox,createRemoteJWKSet:()=>Fx,cryptoRuntime:()=>sS,decodeJwt:()=>Yx,decodeProtectedHeader:()=>qx,errors:()=>k_,experimental_jwksCache:()=>zx,exportJWK:()=>sb,exportPKCS8:()=>ob,exportSPKI:()=>ab,flattenedDecrypt:()=>Yy,flattenedVerify:()=>jb,generalDecrypt:()=>$y,generalVerify:()=>Fb,generateKeyPair:()=>tS,generateSecret:()=>rS,importJWK:()=>Ey,importPKCS8:()=>Ty,importSPKI:()=>Cy,importX509:()=>wy,jwksCache:()=>Lx,jwtDecrypt:()=>$b,jwtVerify:()=>Zb}),uS=t((()=>{Qy(),Xy(),eb(),hb(),Pb(),Mb(),Ib(),Qb(),ex(),nx(),fb(),ox(),ix(),lx(),mx(),gx(),bx(),Sx(),Ax(),Bx(),Hx(),cb(),Dy(),Jx(),Xx(),Y(),nS(),iS(),Kx(),cS()})),dS=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{verifyVercelOidcToken:()=>h}),t.exports=c(l);var u=(uS(),c(lS));let d=`https://oidc.vercel.com`,f=new URL(`https://oidc.vercel.com/.well-known/jwks`),p=[`RS256`],m=(0,u.createRemoteJWKSet)(f);async function h(e,t){let{algorithms:n,projectId:r=process.env.VERCEL_PROJECT_ID,environment:i=process.env.VERCEL_TARGET_ENV||process.env.VERCEL_ENV,ownerId:a,...o}=t??{};if(r===`*`&&a===void 0&&!g(o.audience))throw TypeError(`Expected ownerId or audience to be provided when projectId is '*'.`);let s=await(0,u.jwtVerify)(e,m,{...o,algorithms:n??p});return _(s.payload.iss),v({actual:s.payload.project_id,claim:`project_id`,env:`VERCEL_PROJECT_ID`,expected:r,option:`projectId`}),v({actual:s.payload.environment,claim:`environment`,env:`VERCEL_TARGET_ENV or VERCEL_ENV`,expected:i,option:`environment`}),y({actual:s.payload.owner_id,claim:`owner_id`,expected:a}),s}function g(e){return Array.isArray(e)?e.length>0:e!==void 0}function _(e){if(e!==d&&(typeof e!=`string`||!e.startsWith(`${d}/`)))throw TypeError(`Expected Vercel OIDC token iss claim to be "${d}" or to start with "${d}/".`)}function v({actual:e,claim:t,env:n,expected:r,option:i}){if(r!==`*`){if(r===void 0||r.length===0)throw TypeError(`Expected ${n} to be set or ${i} to be provided. Pass ${i}: '*' to allow any ${t} claim.`);if(!(Array.isArray(r)&&typeof e==`string`&&r.includes(e))&&e!==r)throw TypeError(Array.isArray(r)?`Expected Vercel OIDC token ${t} claim to be one of: ${r.map(e=>`"${e}"`).join(`, `)}.`:`Expected Vercel OIDC token ${t} claim to be "${r}".`)}}function y({actual:e,claim:t,expected:n}){if(n!==void 0&&e!==n)throw TypeError(`Expected Vercel OIDC token ${t} claim to be "${n}".`)}0&&(t.exports={verifyVercelOidcToken:h})})),fS=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{AccessTokenMissingError:()=>m.AccessTokenMissingError,RefreshAccessTokenFailedError:()=>m.RefreshAccessTokenFailedError,exchangeVercelOidcToken:()=>h.exchangeVercelOidcToken,getContext:()=>f.getContext,getVercelOidcToken:()=>u.getVercelOidcToken,getVercelOidcTokenSync:()=>d.getVercelOidcTokenSync,getVercelToken:()=>g.getVercelToken,verifyVercelOidcToken:()=>p.verifyVercelOidcToken}),t.exports=c(l);var u=h_(),d=m_(),f=p_(),p=dS(),m=el(),h=f_(),g=tl();0&&(t.exports={AccessTokenMissingError,RefreshAccessTokenFailedError,exchangeVercelOidcToken,getContext,getVercelOidcToken,getVercelOidcTokenSync,getVercelToken,verifyVercelOidcToken})})),pS=n(u_(),1),mS=fS();async function hS(e){let t=0,n=e.getReader(),r=[];try{for(;;){let{done:e,value:i}=await n.read();if(e)break;r.push(i),t+=i.length}}finally{n.releaseLock()}return Buffer.concat(r,t)}var gS=class{contentType=`application/json`;replacer;reviver;constructor(e={}){this.replacer=e.replacer,this.reviver=e.reviver}serialize(e){return Buffer.from(JSON.stringify(e,this.replacer),`utf8`)}async deserialize(e){let t=await hS(e);return JSON.parse(t.toString(`utf8`),this.reviver)}},_S=class extends Error{constructor(e){super(`Message ${e} not found`),this.name=`MessageNotFoundError`}},vS=class extends Error{constructor(e,t){super(`Message ${e} not available for processing${t?`: ${t}`:``}`),this.name=`MessageNotAvailableError`}},yS=class extends Error{constructor(e,t){super(`Message ${e} is corrupted: ${t}`),this.name=`MessageCorruptedError`}},bS=class extends Error{retryAfter;constructor(e=`Too many requests`,t){super(e),this.name=`TooManyRequestsError`,this.retryAfter=t}},xS=class extends Error{constructor(e=`Missing or invalid authentication token`){super(e),this.name=`UnauthorizedError`}},SS=class extends Error{constructor(e=`Queue environment doesn't match token environment`){super(e),this.name=`ForbiddenError`}},CS=class extends Error{constructor(e){super(e),this.name=`BadRequestError`}},wS=class extends Error{constructor(e=`Unexpected server error`){super(e),this.name=`InternalServerError`}},TS=class extends Error{constructor(e,t=1,n=10){super(`Invalid limit: ${e}. Limit must be between ${t} and ${n}.`),this.name=`InvalidLimitError`}},ES=class extends Error{constructor(e){super(`Message ${e} has already been processed`),this.name=`MessageAlreadyProcessedError`}},DS=class extends Error{idempotencyKey;constructor(e,t){super(e),this.name=`DuplicateMessageError`,this.idempotencyKey=t}},OS=class extends Error{deploymentId;constructor(e,t){super(e),this.name=`ConsumerDiscoveryError`,this.deploymentId=t}},kS=class extends Error{constructor(e=`Consumer registry not configured`){super(e),this.name=`ConsumerRegistryNotConfiguredError`}},AS=300,jS=30,MS=60,NS=10,PS=3e3,FS=3,IS=250;function LS(e){return Math.min(MS,Math.max(NS,e/5))}var RS=class{client;topicName;consumerGroupName;visibilityTimeout;constructor(e,t,n,r={}){this.client=e,this.topicName=t,this.consumerGroupName=n,this.visibilityTimeout=Math.max(jS,r.visibilityTimeoutSeconds??AS)}isClientError(e){return e instanceof vS||e instanceof _S||e instanceof CS||e instanceof xS||e instanceof SS}isNetworkError(e){return e instanceof TypeError}async directiveCallWithRetries(e){let t;for(let n=1;n<=FS;n++)try{return await e()}catch(e){if(t=e,n===FS)throw e;if(e instanceof bS){if(e.retryAfter===void 0)throw e;await new Promise(t=>setTimeout(t,e.retryAfter*1e3));continue}if(!this.isNetworkError(e))throw e;let r=IS*n,i=r/2+r/2*Math.random();await new Promise(e=>setTimeout(e,i))}throw t}startVisibilityExtension(e,t){let n=!0,r=!1,i,a=null,o=LS(this.visibilityTimeout)*1e3,s=o;if(t?.visibilityDeadline){let e=t.visibilityDeadline.getTime()-Date.now();s=e>0?LS(e/1e3)*1e3:0}let c=new Promise(e=>{i=e}),l=()=>{r||(r=!0,i())},u=async()=>{if(!n){l();return}try{await this.client.changeVisibility({queueName:this.topicName,consumerGroup:this.consumerGroupName,receiptHandle:e,visibilityTimeoutSeconds:this.visibilityTimeout}),n?a=setTimeout(()=>u(),o):l()}catch(t){if(this.isClientError(t)){console.error(`Visibility extension failed with client error for receipt handle ${e} (stopping retries):`,t),l();return}console.error(`Failed to extend visibility for receipt handle ${e} (will retry in ${PS/1e3}s):`,t),n?a=setTimeout(()=>u(),PS):l()}};return a=setTimeout(()=>u(),s),async(e=!1)=>{n=!1,a&&=(clearTimeout(a),null),e?await c:l()}}async finalizePayload(e){let t=this.client.getTransport();if(t.finalize&&e!=null)try{await t.finalize(e)}catch(e){console.warn(`Failed to finalize message payload:`,e)}}async processMessage(e,t,n){let r=this.startVisibilityExtension(e.receiptHandle,n),i={messageId:e.messageId,deliveryCount:e.deliveryCount,createdAt:e.createdAt,expiresAt:e.expiresAt??new Date(e.createdAt.getTime()+864e5),topicName:this.topicName,consumerGroup:this.consumerGroupName,region:this.client.getRegion()};try{await t(e.payload,i),await r(),await this.client.acknowledgeMessage({queueName:this.topicName,consumerGroup:this.consumerGroupName,receiptHandle:e.receiptHandle})}catch(t){if(await r(),n?.retry){let r;try{r=n.retry(t,i)}catch(e){console.warn(`retry handler threw:`,e)}if(r){if(`acknowledge`in r&&r.acknowledge){try{await this.directiveCallWithRetries(()=>this.client.acknowledgeMessage({queueName:this.topicName,consumerGroup:this.consumerGroupName,receiptHandle:e.receiptHandle}))}catch(e){console.warn(`Failed to acknowledge message:`,e)}await this.finalizePayload(e.payload);return}if(`afterSeconds`in r&&typeof r.afterSeconds==`number`){try{await this.directiveCallWithRetries(()=>this.client.changeVisibility({queueName:this.topicName,consumerGroup:this.consumerGroupName,receiptHandle:e.receiptHandle,visibilityTimeoutSeconds:r.afterSeconds}))}catch(e){console.warn(`Failed to reschedule message for retry:`,e)}await this.finalizePayload(e.payload);return}}}throw await this.finalizePayload(e.payload),t}}async consumeMessage(e,t,n){await this.processMessage(t,e,n)}async consume(e,t){let n=t?.retry;if(t&&`messageId`in t){let r=await this.client.receiveMessageById({queueName:this.topicName,consumerGroup:this.consumerGroupName,messageId:t.messageId,visibilityTimeoutSeconds:this.visibilityTimeout});return await this.processMessage(r.message,e,{retry:n}),1}else{let r=t&&`limit`in t?t.limit:1,i=0;for await(let t of this.client.receiveMessages({queueName:this.topicName,consumerGroup:this.consumerGroupName,visibilityTimeoutSeconds:this.visibilityTimeout,limit:r}))i++,await this.processMessage(t,e,{retry:n});return i}}get name(){return this.consumerGroupName}get topic(){return this.topicName}},zS=class{client;topicName;constructor(e,t){this.client=e,this.topicName=t}async publish(e,t){let n=await this.client.sendMessage({queueName:this.topicName,payload:e,idempotencyKey:t?.idempotencyKey,retentionSeconds:t?.retentionSeconds,delaySeconds:t?.delaySeconds,headers:t?.headers,telemetry:t?.telemetry});return n.messageId&&$S()&&zC(this.topicName,n.messageId,this.client.getRegion(),t?.delaySeconds,t?.retentionSeconds),{messageId:n.messageId}}consumerGroup(e,t){return new RS(this.client,this.topicName,e,t)}get name(){return this.topicName}},BS=`com.vercel.queue.v1beta`,VS=`com.vercel.queue.v2beta`;function HS(e,t){let n=t.slice(0,-1);return e.startsWith(n)}function US(e){return typeof e==`object`&&!!e}function WS(e,t){if(!t||!t.includes(`application/cloudevents+json`))throw Error(`Invalid content type: expected 'application/cloudevents+json'`);if(!US(e)||!e.type||!e.source||!e.id||!US(e.data))throw Error(`Invalid CloudEvent: missing required fields`);if(e.type!==`com.vercel.queue.v1beta`)throw Error(`Invalid CloudEvent type: expected '${BS}', got '${String(e.type)}'`);let{data:n}=e,r=[];if(`queueName`in n||r.push(`queueName`),`consumerGroup`in n||r.push(`consumerGroup`),`messageId`in n||r.push(`messageId`),r.length>0)throw Error(`Missing required CloudEvent data fields: ${r.join(`, `)}`);return{queueName:String(n.queueName),consumerGroup:String(n.consumerGroup),messageId:String(n.messageId)}}function GS(e,t){if(e instanceof Headers)return e.get(t);let n=e[t];return Array.isArray(n)?n[0]??null:n??null}function KS(e){let t=GS(e,`ce-type`);if(t!==`com.vercel.queue.v2beta`)throw Error(`Invalid CloudEvent type: expected '${VS}', got '${t}'`);let n=GS(e,`ce-vqsqueuename`),r=GS(e,`ce-vqsconsumergroup`),i=GS(e,`ce-vqsmessageid`),a=[];if(n||a.push(`ce-vqsqueuename`),r||a.push(`ce-vqsconsumergroup`),i||a.push(`ce-vqsmessageid`),a.length>0)throw Error(`Missing required CloudEvent headers: ${a.join(`, `)}`);let o=GS(e,`ce-vqsregion`)??void 0;if(o!==void 0&&!/^[a-z]{2,5}[0-9]{1,2}$/.test(o))throw Error(`Invalid ce-vqsregion header: ${JSON.stringify(o)}. Region must match /^[a-z]{2,5}[0-9]{1,2}$/ (e.g. "iad1", "lhr1").`);let s={queueName:n,consumerGroup:r,messageId:i,region:o},c=GS(e,`ce-vqsreceipthandle`);if(!c)return s;let l={...s,receiptHandle:c},u=GS(e,`ce-vqsdeliverycount`);u&&(l.deliveryCount=parseInt(u,10));let d=GS(e,`ce-vqscreatedat`);d&&(l.createdAt=d);let f=GS(e,`ce-vqsexpiresat`);f&&(l.expiresAt=f);let p=GS(e,`content-type`);p&&(l.contentType=p);let m=GS(e,`ce-vqsvisibilitydeadline`);return m&&(l.visibilityDeadline=m),l}function qS(e,t){if(GS(t,`ce-type`)===`com.vercel.queue.v2beta`){let n=KS(t);return`receiptHandle`in n&&(n.parsedPayload=e),n}return WS(e,GS(t,`content-type`))}async function JS(e){if(e.headers.get(`ce-type`)===`com.vercel.queue.v2beta`){let t=KS(e.headers);return`receiptHandle`in t&&e.body&&(t.rawBody=e.body),t}let t;try{t=await e.json()}catch{throw Error(`Failed to parse CloudEvent from request body`)}let n={};return e.headers.forEach((e,t)=>{n[t]=e}),qS(t,n)}async function YS(e,t,n){let{queueName:r,consumerGroup:i,messageId:a}=t;if(!n?.client)throw Error(`HandleCallbackOptions.client is required`);let o=vw(n.client);t.region&&(o=o.withRegion(t.region));let s=new zS(o,r).consumerGroup(i,n?.visibilityTimeoutSeconds===void 0?void 0:{visibilityTimeoutSeconds:n.visibilityTimeoutSeconds});if(`receiptHandle`in t){let r=o.getTransport(),i;if(t.rawBody)i=await r.deserialize(t.rawBody);else if(t.parsedPayload!==void 0)i=t.parsedPayload;else throw Error(`Binary mode callback with receipt handle is missing payload`);let c={messageId:a,payload:i,deliveryCount:t.deliveryCount??1,createdAt:t.createdAt?new Date(t.createdAt):new Date,expiresAt:t.expiresAt?new Date(t.expiresAt):void 0,contentType:t.contentType??r.contentType,receiptHandle:t.receiptHandle},l=t.visibilityDeadline?new Date(t.visibilityDeadline):void 0;await s.consumeMessage(e,c,{visibilityDeadline:l,retry:n?.retry})}else await s.consume(e,{messageId:a,retry:n?.retry})}var $=pS.default.cyan(`[queue]`),XS=pS.default.green(`✓`),ZS=pS.default.red(`✗`),QS=pS.default.yellow(`↻`);function $S(){return process.env.NODE_ENV===`development`&&process.env.VERCEL_DEPLOYMENT_ID===void 0}var eC=Symbol.for(`@vercel/queue.devRouteMappings`);function tC(e){let t=``;for(let n of e)n===`_`?t+=`__`:n===`/`?t+=`_S`:n===`.`?t+=`_D`:/[A-Za-z0-9-]/.test(n)?t+=n:t+=`_`+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`);return t}function nC(){let e=globalThis;if(eC in e)return e[eC]??null;try{let t=rl.join(process.cwd(),`vercel.json`);if(!Ml.existsSync(t))return e[eC]=null,null;let n=JSON.parse(Ml.readFileSync(t,`utf-8`));if(!n.functions)return e[eC]=null,null;let r=[];for(let[e,t]of Object.entries(n.functions))if(t.experimentalTriggers){for(let n of t.experimentalTriggers)if(!(!n.type?.startsWith(`queue/`)||!n.topic)){if(n.type!==`queue/v2beta`){console.warn(`${$} Unsupported trigger type "${n.type}" for topic "${n.topic}" in ${e}. Use "queue/v2beta" instead.`);continue}r.push({filePath:e,topic:n.topic,consumer:tC(e),retryAfterSeconds:n.retryAfterSeconds})}}return e[eC]=r.length>0?r:null,e[eC]}catch(t){return console.warn(`${$} Failed to read vercel.json:`,t),e[eC]=null,null}}function rC(e){let t=nC();return t?t.filter(t=>t.topic.includes(`*`)?HS(e,t.topic):t.topic===e):[]}function iC(e,t){return rC(e).find(e=>e.consumer===t)?.retryAfterSeconds}function aC(e){return/^src\/(app|pages|server)\//.test(e)?e.slice(4):null}function oC(e,t){return e===t||B(e,t)}function sC(e){let t=nC();if(!t)return[];let n=process.cwd(),r;try{r=rl.relative(n,e)}catch{return[]}let i=r.replace(/\\/g,`/`),a=aC(i);return t.filter(e=>oC(i,e.filePath)||a!==null&&oC(a,e.filePath))}function cC(e){let t=e.match(/\((.+?):\d+:\d+\)/);if(t||=e.match(/at\s+(.+?):\d+:\d+/),!t)return null;let n=t[1].trim();if(n===`native`||n.startsWith(`node:`)||n.startsWith(`internal`))return null;if(n.startsWith(`file://`))try{n=new URL(n).pathname}catch{return null}return/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(n)?null:(n.startsWith(`./`)&&(n=n.slice(2)),n)}var lC;function uC(){if(lC)return lC;try{let e=typeof __dirname<`u`?__dirname:rl.dirname(new URL(import.meta.url).pathname);lC=rl.resolve(e,`..`)}catch{lC=``}return lC}function dC(){let e=Error().stack;if(!e)return null;let t=e.split(`
13
- `).slice(1),n=uC();for(let e of t){let t=cC(e);if(!t)continue;let r=rl.isAbsolute(t)?t:rl.resolve(process.cwd(),t),i;try{i=Ml.realpathSync(r)}catch{i=r}if(!(n&&i.startsWith(n)))return i}return null}var fC=Symbol.for(`@vercel/queue.devHandlerRegistry`);function pC(){let e=globalThis;return e[fC]||(e[fC]=new Map),e[fC]}function mC(e,t,n,r){let i=sC(rl.isAbsolute(e)?e:rl.resolve(process.cwd(),e));if(i.length===0)return!1;let a=pC();for(let e of i){let i=e.topic,o=a.get(i)??[],s={consumerGroup:e.consumer,handler:t,client:n,options:r},c=o.findIndex(t=>t.consumerGroup===e.consumer);c>=0?o[c]=s:o.push(s),a.set(i,o)}return!0}function hC(e,t,n,r){let i=r??dC();if(!i){console.warn(`${$} Could not determine caller file path for handler registration.`);return}if(!mC(i,e,t,n)){let e=nC();if(e&&e.length>0)return;let t=process.cwd(),n;try{n=rl.relative(t,i).replace(/\\/g,`/`)}catch{n=i}console.warn(`${$} handleCallback() in ${n} has no matching experimentalTriggers in vercel.json. This handler won't receive messages.
11
+ `)(e,n),a=2),i===-1){let t=e.subarray(n);if(t.length>this.maxHeaderSize)throw new R(`Headers too large: ${t.length} > ${this.maxHeaderSize} bytes`);this.buffer=t;break}let o=e.subarray(n,i);this.currentHeaders=Bh(o);let s=this.createStreamingMessage();t.push(s),n=i+a,this.state=3;continue}if(this.state===0){if(r<this.openingBoundaryLength){if(e.length>this.maxBoundaryBuffer)throw new R(`Initial chunk too large for boundary detection: ${e.length} > ${this.maxBoundaryBuffer}`);this.buffer=e;break}if(this.findOpeningBoundary(e)!==0)throw new R(`Invalid multipart stream: missing initial boundary`);n=this.openingBoundaryLength,this.state=1}}return t}createStreamingMessage(){let e=new Headers(this.currentHeaders),t=new ReadableStream({start:e=>{this.currentPayloadController=e}});return this.currentHeaders=new Headers,{headers:e,payload:t}}writeBody(e){this.currentPayloadController&&this.currentPayloadController.enqueue(e)}finishMessage(){this.currentPayloadController&&=(this.currentPayloadController.close(),null)}closeCurrentPayload(e){if(this.currentPayloadController){try{e?this.currentPayloadController.error(e):this.currentPayloadController.close()}catch{}this.currentPayloadController=null}}};const Gh=(e,t,n)=>{let r=e instanceof RegExp?Kh(e,n):e,i=t instanceof RegExp?Kh(t,n):t,a=r!==null&&i!=null&&qh(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},Kh=(e,t)=>{let n=t.match(e);return n?n[0]:null},qh=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},Jh=`\0SLASH`+Math.random()+`\0`,Yh=`\0OPEN`+Math.random()+`\0`,Xh=`\0CLOSE`+Math.random()+`\0`,Zh=`\0COMMA`+Math.random()+`\0`,Qh=`\0PERIOD`+Math.random()+`\0`,$h=new RegExp(Jh,`g`),eg=new RegExp(Yh,`g`),tg=new RegExp(Xh,`g`),ng=new RegExp(Zh,`g`),rg=new RegExp(Qh,`g`),ig=/\\\\/g,ag=/\\{/g,og=/\\}/g,sg=/\\,/g,cg=/\\\./g;function lg(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function ug(e){return e.replace(ig,Jh).replace(ag,Yh).replace(og,Xh).replace(sg,Zh).replace(cg,Qh)}function dg(e){return e.replace($h,`\\`).replace(eg,`{`).replace(tg,`}`).replace(ng,`,`).replace(rg,`.`)}function fg(e){if(!e)return[``];let t=[],n=Gh(`{`,`}`,e);if(!n)return e.split(`,`);let{pre:r,body:i,post:a}=n,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;let s=fg(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function pg(e,t={}){if(!e)return[];let{max:n=1e5}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),vg(ug(e),n,!0).map(dg)}function mg(e){return`{`+e+`}`}function hg(e){return/^-?0\d/.test(e)}function gg(e,t){return e<=t}function _g(e,t){return e>=t}function vg(e,t,n){let r=[];for(;;){let i=Gh(`{`,`}`,e);if(!i)return[e];let a=i.pre;if(/\$$/.test(i.pre)){let e=i.post.length?vg(i.post,t,!1):[``];for(let n=0;n<e.length&&n<t;n++){let t=a+`{`+i.body+`}`+e[n];r.push(t)}return r}let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),s=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),c=o||s,l=i.body.indexOf(`,`)>=0;if(!c&&!l){if(i.post.match(/,(?!,).*\}/)){e=i.pre+`{`+i.body+Xh+i.post,n=!0;continue}return[e]}let u=i.post.length?vg(i.post,t,!1):[``],d;if(c)d=i.body.split(/\.\./);else if(d=fg(i.body),d.length===1&&d[0]!==void 0&&(d=vg(d[0],t,!1).map(mg),d.length===1))return u.map(e=>i.pre+d[0]+e);let f;if(c&&d[0]!==void 0&&d[1]!==void 0){let e=lg(d[0]),n=lg(d[1]),r=Math.max(d[0].length,d[1].length),i=d.length===3&&d[2]!==void 0?Math.max(Math.abs(lg(d[2])),1):1,a=gg;n<e&&(i*=-1,a=_g);let o=d.some(hg);f=[];for(let c=e;a(c,n)&&f.length<t;c+=i){let e;if(s)e=String.fromCharCode(c),e===`\\`&&(e=``);else if(e=String(c),o){let t=r-e.length;if(t>0){let n=Array(t+1).join(`0`);e=c<0?`-`+n+e.slice(1):n+e}}f.push(e)}}else{f=[];for(let e=0;e<d.length;e++)f.push.apply(f,vg(d[e],t,!1))}for(let e=0;e<f.length;e++)for(let i=0;i<u.length&&r.length<t;i++){let t=a+f[e]+u[i];(!n||c||t)&&r.push(t)}return r}}const yg=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},bg={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},xg=e=>e.replace(/[[\]\\-]/g,`\\$&`),Sg=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),Cg=e=>e.join(``),wg=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(bg))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(xg(d)+`-`+xg(t)):t===d&&r.push(xg(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(xg(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(xg(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let e=r[0].length===2?r[0].slice(-1):r[0];return[Sg(e),!1,u-n,!1]}let f=`[`+(l?`^`:``)+Cg(r)+`]`,p=`[`+(l?``:`^`)+Cg(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},Tg=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\])\]/g,`$1$2`).replace(/\\([^/])/g,`$1`):t?e.replace(/\[([^/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,`$1$2`).replace(/\\([^/{}])/g,`$1`);var Eg;const Dg=new Set([`!`,`?`,`+`,`*`,`@`]),Og=e=>Dg.has(e),kg=e=>Og(e.type),Ag=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),jg=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),Mg=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),Ng=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),Pg=`(?!\\.)`,Fg=new Set([`[`,`.`]),Ig=new Set([`..`,`.`]),Lg=new Set(`().*{}+?[]^$\\!`),Rg=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),zg=`[^/]+?`;let Bg=0;var Vg=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;id=++Bg;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for(`nodejs.util.inspect.custom`)](){return{"@@type":`AST`,id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#r.length,parts:this.#r}}constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#l=this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==``){if(typeof t!=`string`&&!(t instanceof Eg&&t.#i===this))throw Error(`invalid part: `+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#r[t];if(!(n instanceof Eg&&n.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new Eg(this.type,e);for(let e of this.#r)t.copyIn(e);return t}static#f(e,t,n,r,i){let a=r.maxExtglobRecursion??2,o=!1,s=!1,c=-1,l=!1;if(t.type===null){let u=n,d=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,d+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),d+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,d+=n;continue}if(!r.noext&&Og(n)&&e.charAt(u)===`(`&&i<=a){t.push(d),d=``;let a=new Eg(n,t);u=Eg.#f(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new Eg(null,t),f=[],p=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,p+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),p+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,p+=n;continue}if(!r.noext&&Og(n)&&e.charAt(u)===`(`&&(i<=a||t&&t.#h(n))){let a=t&&t.#h(n)?0:1;d.push(p),p=``;let o=new Eg(n,d);d.push(o),u=Eg.#f(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new Eg(null,t);continue}if(n===`)`)return p===``&&t.#r.length===0&&(t.#u=!0),d.push(p),p=``,t.push(...f,d),u;p+=n}return t.type=null,t.#t=void 0,t.#r=[e.substring(n-1)],u}#p(e){return this.#m(e,jg)}#m(e,t=Ag){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null)return!1;let n=e.#r[0];return!n||typeof n!=`object`||n.type===null?!1:this.#h(n.type,t)}#h(e,t=Mg){return!!t.get(this.type)?.includes(e)}#g(e,t){let n=e.#r[0],r=new Eg(null,n,this.options);r.#r.push(``),n.push(r),this.#_(e,t)}#_(e,t){let n=e.#r[0];this.#r.splice(t,1,...n.#r);for(let e of n.#r)typeof e==`object`&&(e.#i=this);this.#l=void 0}#v(e){return!!Ng.get(this.type)?.has(e)}#y(e){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let t=e.#r[0];return!t||typeof t!=`object`||t.type===null?!1:this.#v(t.type)}#b(e){let t=Ng.get(this.type),n=e.#r[0],r=t?.get(n.type);if(!r)return!1;this.#r=n.#r;for(let e of this.#r)typeof e==`object`&&(e.#i=this);this.type=r,this.#l=void 0,this.#u=!1}static fromGlob(e,t={}){let n=new Eg(null,void 0,t);return Eg.#f(e,n,0,t,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#e===this&&(this.#x(),this.#d()),!kg(this)){let n=this.isStart()&&this.isEnd()&&!this.#r.some(e=>typeof e!=`string`),r=this.#r.map(t=>{let[r,i,a,o]=typeof t==`string`?Eg.#C(t,this.#t,n):t.toRegExpSource(e);return this.#t=this.#t||a,this.#n=this.#n||o,r}).join(``),i=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&Ig.has(this.#r[0]))){let n=Fg,a=t&&n.has(r.charAt(0))||r.startsWith(`\\.`)&&n.has(r.charAt(2))||r.startsWith(`\\.\\.`)&&n.has(r.charAt(4)),o=!t&&!e&&n.has(r.charAt(0));i=a?`(?!(?:^|/)\\.\\.?(?:$|/))`:o?Pg:``}let a=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(a=`(?:$|\\/)`),[i+r+a,Tg(r),this.#t=!!this.#t,this.#n]}let n=this.type===`*`||this.type===`+`,r=this.type===`!`?`(?:(?!(?:`:`(?:`,i=this.#S(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,Tg(this.toString()),!1,!1]}let a=!n||e||t?``:this.#S(!0);a===i&&(a=``),a&&(i=`(?:${i})(?:${a})*?`);let o=``;if(this.type===`!`&&this.#u)o=(this.isStart()&&!t?Pg:``)+zg;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?Pg:``)+`[^/]*?)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,Tg(i),this.#t=!!this.#t,this.#n]}#x(){if(kg(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#r.length;e++){let n=this.#r[e];typeof n==`object`&&(n.#x(),this.#m(n)?(t=!1,this.#_(n,e)):this.#p(n)?(t=!1,this.#g(n,e)):this.#y(n)&&(t=!1,this.#b(n)))}}while(!t&&++e<10)}else for(let e of this.#r)typeof e==`object`&&e.#x();this.#l=void 0}#S(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#C(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(r){r=!1,i+=(Lg.has(c)?`\\`:``)+c;continue}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?zg:`[^/]*?`,t=!0;continue}else o=!1;if(c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,o,c]=wg(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}if(c===`?`){i+=`[^/]`,t=!0;continue}i+=Rg(c)}return[i,Tg(e),!!t,a]}};Eg=Vg;const Hg=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),z=(e,t,n={})=>(yg(t),!n.nocomment&&t.charAt(0)===`#`?!1:new h_(t,n).match(e)),Ug=/^\*+([^+@!?*[(]*)$/,Wg=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),Gg=e=>t=>t.endsWith(e),Kg=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),qg=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Jg=/^\*+\.\*+$/,Yg=e=>!e.startsWith(`.`)&&e.includes(`.`),Xg=e=>e!==`.`&&e!==`..`&&e.includes(`.`),Zg=/^\.\*+$/,Qg=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),$g=/^\*+$/,e_=e=>e.length!==0&&!e.startsWith(`.`),t_=e=>e.length!==0&&e!==`.`&&e!==`..`,n_=/^\?+([^+@!?*[(]*)?$/,r_=([e,t=``])=>{let n=s_([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},i_=([e,t=``])=>{let n=c_([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},a_=([e,t=``])=>{let n=c_([e]);return t?e=>n(e)&&e.endsWith(t):n},o_=([e,t=``])=>{let n=s_([e]);return t?e=>n(e)&&e.endsWith(t):n},s_=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},c_=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},l_=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,u_={win32:{sep:`\\`},posix:{sep:`/`}};z.sep=l_===`win32`?u_.win32.sep:u_.posix.sep;const B=Symbol(`globstar **`);z.GLOBSTAR=B,z.filter=(e,t={})=>n=>z(n,e,t);const d_=(e,t={})=>Object.assign({},e,t);z.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return z;let t=z;return Object.assign((n,r,i={})=>t(n,r,d_(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,d_(e,n))}static defaults(n){return t.defaults(d_(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,d_(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,d_(e,r))}},unescape:(n,r={})=>t.unescape(n,d_(e,r)),escape:(n,r={})=>t.escape(n,d_(e,r)),filter:(n,r={})=>t.filter(n,d_(e,r)),defaults:n=>t.defaults(d_(e,n)),makeRe:(n,r={})=>t.makeRe(n,d_(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,d_(e,r)),match:(n,r,i={})=>t.match(n,r,d_(e,i)),sep:t.sep,GLOBSTAR:B})};const f_=(e,t={})=>(yg(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:pg(e,{max:t.braceExpandMax}));z.braceExpand=f_,z.makeRe=(e,t={})=>new h_(e,t).makeRe(),z.match=(e,t,n={})=>{let r=new h_(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};const p_=/[?*]|[+@!]\(.*?\)|\[|\]/,m_=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`);var h_=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){yg(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||l_,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!p_.test(e[2]))&&!p_.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t of e)for(let e=0;e<t.length;e++)t[e]===`**`&&(t[e]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&!(this.isWindows&&/^[a-z]:$/i.test(r))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),a=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),s=!o&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]),c=a?3:n?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[n,a]=[e[c],t[l]];n.toLowerCase()===a.toLowerCase()&&(t[l]=n,i=l,r=c)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(B)?this.#e(e,t,n,r,i):this.#n(e,t,n,r,i)}#e(e,t,n,r,i){let a=t.indexOf(B,i),o=t.lastIndexOf(B),[s,c,l]=n?[t.slice(i,a),t.slice(a+1),[]]:[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#n(t,s,n,0,0))return!1;r+=s.length,i+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#n(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#n(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return n||t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===B?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,g=e.length-u;for(let e of d)e[1]=g-(m[h--]+e[0].length);return!!this.#t(e,d,r,0,n,0,!!u)}#t(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){if(this.#n(e.slice(0,n+c.length),c,i,n,0)&&a<this.maxGlobstarRecursion){let s=this.#t(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let s=e[n];if(s===`.`||s===`..`||!this.options.dot&&s.startsWith(`.`))return!1;n++}return i||null}#n(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===B)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return f_(this.pattern,this.options)}parse(e){yg(e);let t=this.options;if(e===`**`)return B;if(e===``)return``;let n,r=null;(n=e.match($g))?r=t.dot?t_:e_:(n=e.match(Ug))?r=(t.nocase?t.dot?qg:Kg:t.dot?Gg:Wg)(n[1]):(n=e.match(n_))?r=(t.nocase?t.dot?i_:r_:t.dot?a_:o_)(n):(n=e.match(Jg))?r=t.dot?Xg:Yg:(n=e.match(Zg))&&(r=Qg);let i=Vg.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,"test",{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?`[^/]*?`:t.dot?`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`:`(?:(?!(?:\\/|^)\\.).)*?`,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?m_(e):e===B?B:e._src});t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==B||a===B||(a===void 0?i!==void 0&&i!==B?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|\\/`+n+`)?`:i!==B&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=B))});let i=t.filter(e=>e!==B);if(this.partial&&i.length>=1){let e=[];for(let t=1;t<=i.length;t++)e.push(i.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return i.join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.partial&&(i=`^(?:\\/|`+a+i.slice(1,-1)+o+`)$`),this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e of i){let i=r;if(n.matchBase&&e.length===1&&(i=[a]),this.matchOne(i,e,t))return n.flipNegate?!0:!this.negate}return!n.flipNegate&&this.negate}static defaults(e){return z.defaults(e).Minimatch}};z.AST=Vg,z.Minimatch=h_,z.escape=Hg,z.unescape=Tg;var g_=i(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c})),__=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{version:()=>u}),t.exports=c(l);let u=`3.8.0`;0&&(t.exports={version:u})})),v_=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{exchangeVercelOidcToken:()=>p}),t.exports=c(l);var u=__();let d=new class{constructor(e){this.maxEntries=e,this.entries=new Map}get(e){let t=this.entries.get(e);if(t!==void 0){if(t.expiresAt<=Date.now()){this.entries.delete(e);return}return this.entries.delete(e),this.entries.set(e,t),t.token}}set({key:e,token:t,expiresAt:n}){for(this.entries.delete(e),this.entries.set(e,{token:t,expiresAt:n});this.entries.size>this.maxEntries;){let e=this.entries.keys().next().value;if(e===void 0)break;this.entries.delete(e)}}}(1e3);async function f(e){let t=JSON.stringify([e.token,e.audience,e.jti]),n=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(t));return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function p(e){let t=await f(e);if(!e.skipCache){let e=d.get(t);if(e!==void 0)return e}let n=await fetch(`https://oidc.vercel.com/~token`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`,"User-Agent":`@vercel/oidc@${u.version}`},body:JSON.stringify({token:e.token,aud:e.audience,...e.jti?{jti:e.jti}:void 0})});if(!n.ok)throw Error(`Failed to exchange token: ${await m(n)}`);let r;try{r=await n.json()}catch{throw Error(`Failed to exchange token: response was not valid JSON`)}if(!r||typeof r!=`object`||!(`token`in r)||typeof r.token!=`string`)throw Error(`Failed to exchange token: response did not contain a token`);let{token:i}=r,a=`expiry`in r&&typeof r.expiry==`number`?r.expiry:void 0;if(a!==void 0){let e=a*1e3;e>Date.now()&&d.set({key:t,token:i,expiresAt:e})}return i}async function m(e){try{let t=await e.json();if(t&&typeof t==`object`&&`error`in t&&typeof t.error==`string`)return t.error}catch{}return e.statusText||`HTTP ${e.status}`}0&&(t.exports={exchangeVercelOidcToken:p})})),y_=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{SYMBOL_FOR_REQ_CONTEXT:()=>u,getContext:()=>d}),t.exports=c(l);let u=Symbol.for(`@vercel/request-context`);function d(){return globalThis[u]?.get?.()??{}}0&&(t.exports={SYMBOL_FOR_REQ_CONTEXT:u,getContext:d})})),b_=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{getVercelOidcTokenSync:()=>d}),t.exports=c(l);var u=y_();function d(){let e=(0,u.getContext)().headers?.[`x-vercel-oidc-token`]??process.env.VERCEL_OIDC_TOKEN;if(!e)throw Error(`The 'x-vercel-oidc-token' header is missing from the request.`);return e}0&&(t.exports={getVercelOidcTokenSync:d})})),x_=i(((e,t)=>{var r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},c=(e,t,n,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(r({},`__esModule`,{value:!0}),e),u={};s(u,{getVercelOidcToken:()=>m}),t.exports=l(u);var d=v_(),f=b_(),p=Gc();async function m(e){let t=``,r;try{t=(0,f.getVercelOidcTokenSync)()}catch(e){r=e}try{let[{getTokenPayload:r,isExpired:i},{refreshToken:a}]=await Promise.all([await import(`../../_chunks/workflow/token-util-DNwIAn_u.js`).then(e=>n(e.t())),await import(`../../_chunks/workflow/token-DtCUEpJs.js`).then(e=>n(e.default))]);(!t||i(r(t),e?.expirationBufferMs))&&(await a(e),t=(0,f.getVercelOidcTokenSync)())}catch(e){let t=r instanceof Error?r.message:``;throw e instanceof Error&&(t=`${t}
12
+ ${e.message}`),t?new p.VercelOidcTokenError(t):e}return e?.audience&&(t=await(0,d.exchangeVercelOidcToken)({token:t,audience:e.audience,jti:e.jti,skipCache:e.skipCache})),t}0&&(t.exports={getVercelOidcToken:m})})),S_,C_=t((()=>{S_=(e,t)=>tl(e).update(t).digest()}));function w_(...e){let t=e.reduce((e,{length:t})=>e+t,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function T_(e,t){return w_(V.encode(e),new Uint8Array([0]),t)}function E_(e,t,n){if(t<0||t>=M_)throw RangeError(`value must be >= 0 and <= ${M_-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,t&255],n)}function D_(e){let t=Math.floor(e/M_),n=e%M_,r=new Uint8Array(8);return E_(r,t,0),E_(r,n,4),r}function O_(e){let t=new Uint8Array(4);return E_(t,e),t}function k_(e){return w_(O_(e.length),e)}async function A_(e,t,n){let r=Math.ceil((t>>3)/32),i=new Uint8Array(r*32);for(let t=0;t<r;t++){let r=new Uint8Array(4+e.length+n.length);r.set(O_(t+1)),r.set(e,4),r.set(n,4+e.length),i.set(await S_(`sha256`,r),t*32)}return i.slice(0,t>>3)}var V,j_,M_,H=t((()=>{C_(),V=new TextEncoder,j_=new TextDecoder,M_=2**32}));function N_(e){let t=e;return t instanceof Uint8Array&&(t=j_.decode(t)),t}var U,W,P_=t((()=>{H(),U=e=>Cl.from(e).toString(`base64url`),W=e=>new Uint8Array(Cl.from(N_(e),`base64url`))})),F_=r({JOSEAlgNotAllowed:()=>R_,JOSEError:()=>G,JOSENotSupported:()=>K,JWEDecryptionFailed:()=>z_,JWEInvalid:()=>q,JWKInvalid:()=>V_,JWKSInvalid:()=>H_,JWKSMultipleMatchingKeys:()=>W_,JWKSNoMatchingKey:()=>U_,JWKSTimeout:()=>G_,JWSInvalid:()=>J,JWSSignatureVerificationFailed:()=>K_,JWTClaimValidationFailed:()=>I_,JWTExpired:()=>L_,JWTInvalid:()=>B_}),G,I_,L_,R_,K,z_,q,J,B_,V_,H_,U_,W_,G_,K_,Y=t((()=>{G=class extends Error{static code=`ERR_JOSE_GENERIC`;code=`ERR_JOSE_GENERIC`;constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},I_=class extends G{static code=`ERR_JWT_CLAIM_VALIDATION_FAILED`;code=`ERR_JWT_CLAIM_VALIDATION_FAILED`;claim;reason;payload;constructor(e,t,n=`unspecified`,r=`unspecified`){super(e,{cause:{claim:n,reason:r,payload:t}}),this.claim=n,this.reason=r,this.payload=t}},L_=class extends G{static code=`ERR_JWT_EXPIRED`;code=`ERR_JWT_EXPIRED`;claim;reason;payload;constructor(e,t,n=`unspecified`,r=`unspecified`){super(e,{cause:{claim:n,reason:r,payload:t}}),this.claim=n,this.reason=r,this.payload=t}},R_=class extends G{static code=`ERR_JOSE_ALG_NOT_ALLOWED`;code=`ERR_JOSE_ALG_NOT_ALLOWED`},K=class extends G{static code=`ERR_JOSE_NOT_SUPPORTED`;code=`ERR_JOSE_NOT_SUPPORTED`},z_=class extends G{static code=`ERR_JWE_DECRYPTION_FAILED`;code=`ERR_JWE_DECRYPTION_FAILED`;constructor(e=`decryption operation failed`,t){super(e,t)}},q=class extends G{static code=`ERR_JWE_INVALID`;code=`ERR_JWE_INVALID`},J=class extends G{static code=`ERR_JWS_INVALID`;code=`ERR_JWS_INVALID`},B_=class extends G{static code=`ERR_JWT_INVALID`;code=`ERR_JWT_INVALID`},V_=class extends G{static code=`ERR_JWK_INVALID`;code=`ERR_JWK_INVALID`},H_=class extends G{static code=`ERR_JWKS_INVALID`;code=`ERR_JWKS_INVALID`},U_=class extends G{static code=`ERR_JWKS_NO_MATCHING_KEY`;code=`ERR_JWKS_NO_MATCHING_KEY`;constructor(e=`no applicable key found in the JSON Web Key Set`,t){super(e,t)}},W_=class extends G{[Symbol.asyncIterator];static code=`ERR_JWKS_MULTIPLE_MATCHING_KEYS`;code=`ERR_JWKS_MULTIPLE_MATCHING_KEYS`;constructor(e=`multiple matching keys found in the JSON Web Key Set`,t){super(e,t)}},G_=class extends G{static code=`ERR_JWKS_TIMEOUT`;code=`ERR_JWKS_TIMEOUT`;constructor(e=`request timed out`,t){super(e,t)}},K_=class extends G{static code=`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`;code=`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`;constructor(e=`signature verification failed`,t){super(e,t)}}})),q_=t((()=>{}));function J_(e){switch(e){case`A128GCM`:case`A128GCMKW`:case`A192GCM`:case`A192GCMKW`:case`A256GCM`:case`A256GCMKW`:return 96;case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:return 128;default:throw new K(`Unsupported JWE Algorithm: ${e}`)}}var Y_,X_=t((()=>{Y(),q_(),Y_=e=>fl(new Uint8Array(J_(e)>>3))})),Z_,Q_=t((()=>{Y(),X_(),Z_=(e,t)=>{if(t.length<<3!==J_(e))throw new q(`Invalid Initialization Vector length`)}})),$_,ev=t((()=>{$_=e=>hl.types.isKeyObject(e)})),tv,nv=t((()=>{Y(),ev(),tv=(e,t)=>{let n;switch(e){case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:n=parseInt(e.slice(-3),10);break;case`A128GCM`:case`A192GCM`:case`A256GCM`:n=parseInt(e.slice(1,4),10);break;default:throw new K(`Content Encryption Algorithm ${e} is not supported either by JOSE or your javascript runtime`)}if(t instanceof Uint8Array){let e=t.byteLength<<3;if(e!==n)throw new q(`Invalid Content Encryption Key length. Expected ${n} bits, got ${e} bits`);return}if($_(t)&&t.type===`secret`){let e=t.symmetricKeySize<<3;if(e!==n)throw new q(`Invalid Content Encryption Key length. Expected ${n} bits, got ${e} bits`);return}throw TypeError(`Invalid Content Encryption Key type`)}})),rv,iv=t((()=>{rv=pl}));function av(e,t,n,r,i,a){let o=w_(e,t,n,D_(e.length<<3)),s=nl(`sha${r}`,i);return s.update(o),s.digest().slice(0,a>>3)}var ov=t((()=>{H()})),sv,cv,lv=t((()=>{sv=Xc.webcrypto,cv=e=>hl.types.isCryptoKey(e)}));function X(e,t=`algorithm.name`){return TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function uv(e,t){return e.name===t}function dv(e){return parseInt(e.name.slice(4),10)}function fv(e){switch(e){case`ES256`:return`P-256`;case`ES384`:return`P-384`;case`ES512`:return`P-521`;default:throw Error(`unreachable`)}}function pv(e,t){if(t.length&&!t.some(t=>e.usages.includes(t))){let e=`CryptoKey does not support this operation, its usages must include `;if(t.length>2){let n=t.pop();e+=`one of ${t.join(`, `)}, or ${n}.`}else t.length===2?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw TypeError(e)}}function mv(e,t,...n){switch(t){case`HS256`:case`HS384`:case`HS512`:{if(!uv(e.algorithm,`HMAC`))throw X(`HMAC`);let n=parseInt(t.slice(2),10);if(dv(e.algorithm.hash)!==n)throw X(`SHA-${n}`,`algorithm.hash`);break}case`RS256`:case`RS384`:case`RS512`:{if(!uv(e.algorithm,`RSASSA-PKCS1-v1_5`))throw X(`RSASSA-PKCS1-v1_5`);let n=parseInt(t.slice(2),10);if(dv(e.algorithm.hash)!==n)throw X(`SHA-${n}`,`algorithm.hash`);break}case`PS256`:case`PS384`:case`PS512`:{if(!uv(e.algorithm,`RSA-PSS`))throw X(`RSA-PSS`);let n=parseInt(t.slice(2),10);if(dv(e.algorithm.hash)!==n)throw X(`SHA-${n}`,`algorithm.hash`);break}case`EdDSA`:if(e.algorithm.name!==`Ed25519`&&e.algorithm.name!==`Ed448`)throw X(`Ed25519 or Ed448`);break;case`Ed25519`:if(!uv(e.algorithm,`Ed25519`))throw X(`Ed25519`);break;case`ES256`:case`ES384`:case`ES512`:{if(!uv(e.algorithm,`ECDSA`))throw X(`ECDSA`);let n=fv(t);if(e.algorithm.namedCurve!==n)throw X(n,`algorithm.namedCurve`);break}default:throw TypeError(`CryptoKey does not support this operation`)}pv(e,n)}function hv(e,t,...n){switch(t){case`A128GCM`:case`A192GCM`:case`A256GCM`:{if(!uv(e.algorithm,`AES-GCM`))throw X(`AES-GCM`);let n=parseInt(t.slice(1,4),10);if(e.algorithm.length!==n)throw X(n,`algorithm.length`);break}case`A128KW`:case`A192KW`:case`A256KW`:{if(!uv(e.algorithm,`AES-KW`))throw X(`AES-KW`);let n=parseInt(t.slice(1,4),10);if(e.algorithm.length!==n)throw X(n,`algorithm.length`);break}case`ECDH`:switch(e.algorithm.name){case`ECDH`:case`X25519`:case`X448`:break;default:throw X(`ECDH, X25519, or X448`)}break;case`PBES2-HS256+A128KW`:case`PBES2-HS384+A192KW`:case`PBES2-HS512+A256KW`:if(!uv(e.algorithm,`PBKDF2`))throw X(`PBKDF2`);break;case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:{if(!uv(e.algorithm,`RSA-OAEP`))throw X(`RSA-OAEP`);let n=parseInt(t.slice(9),10)||1;if(dv(e.algorithm.hash)!==n)throw X(`SHA-${n}`,`algorithm.hash`);break}default:throw TypeError(`CryptoKey does not support this operation`)}pv(e,n)}var gv=t((()=>{}));function _v(e,t,...n){if(n=n.filter(Boolean),n.length>2){let t=n.pop();e+=`one of type ${n.join(`, `)}, or ${t}.`}else n.length===2?e+=`one of type ${n[0]} or ${n[1]}.`:e+=`of type ${n[0]}.`;return t==null?e+=` Received ${t}`:typeof t==`function`&&t.name?e+=` Received function ${t.name}`:typeof t==`object`&&t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}function vv(e,t,...n){return _v(`Key for the ${e} algorithm must be `,t,...n)}var yv,bv=t((()=>{yv=(e,...t)=>_v(`Key must be `,e,...t)})),xv,Sv,Cv=t((()=>{Sv=e=>(xv||=new Set(cl()),xv.has(e))})),wv,Z,Tv=t((()=>{lv(),ev(),wv=e=>$_(e)||cv(e),Z=[`KeyObject`],(globalThis.CryptoKey||sv?.CryptoKey)&&Z.push(`CryptoKey`)}));function Ev(e,t,n,r,i,a){let o=parseInt(e.slice(1,4),10);$_(t)&&(t=t.export());let s=t.subarray(o>>3),c=t.subarray(0,o>>3),l=parseInt(e.slice(-3),10),u=`aes-${o}-cbc`;if(!Sv(u))throw new K(`alg ${e} is not supported by your javascript runtime`);let d=av(a,r,n,l,c,o),f;try{f=rv(i,d)}catch{}if(!f)throw new z_;let p;try{let e=el(u,s,r);p=w_(e.update(n),e.final())}catch{}if(!p)throw new z_;return p}function Dv(e,t,n,r,i,a){let o=`aes-${parseInt(e.slice(1,4),10)}-gcm`;if(!Sv(o))throw new K(`alg ${e} is not supported by your javascript runtime`);try{let e=el(o,t,r,{authTagLength:16});e.setAuthTag(i),a.byteLength&&e.setAAD(a,{plaintextLength:n.length});let s=e.update(n);return e.final(),s}catch{throw new z_}}var Ov,kv=t((()=>{Q_(),nv(),H(),Y(),iv(),ov(),lv(),gv(),ev(),bv(),Cv(),Tv(),Ov=(e,t,n,r,i,a)=>{let o;if(cv(t))hv(t,e,`decrypt`),o=Zc.from(t);else if(t instanceof Uint8Array||$_(t))o=t;else throw TypeError(yv(t,...Z,`Uint8Array`));if(!r)throw new q(`JWE Initialization Vector missing`);if(!i)throw new q(`JWE Authentication Tag missing`);switch(tv(e,o),Z_(e,r),e){case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:return Ev(e,o,n,r,i,a);case`A128GCM`:case`A192GCM`:case`A256GCM`:return Dv(e,o,n,r,i,a);default:throw new K(`Unsupported JWE Content Encryption Algorithm`)}}})),Av,jv=t((()=>{Av=(...e)=>{let t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let n;for(let e of t){let t=Object.keys(e);if(!n||n.size===0){n=new Set(t);continue}for(let e of t){if(n.has(e))return!1;n.add(e)}}return!0}}));function Mv(e){return typeof e==`object`&&!!e}function Q(e){if(!Mv(e)||Object.prototype.toString.call(e)!==`[object Object]`)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}var Nv=t((()=>{}));function Pv(e,t){if(e.symmetricKeySize<<3!==parseInt(t.slice(1,4),10))throw TypeError(`Invalid key size for alg: ${t}`)}function Fv(e,t,n){if($_(e))return e;if(e instanceof Uint8Array)return al(e);if(cv(e))return hv(e,t,n),Zc.from(e);throw TypeError(yv(e,...Z,`Uint8Array`))}var Iv,Lv,Rv=t((()=>{Y(),H(),lv(),gv(),ev(),bv(),Cv(),Tv(),Iv=(e,t,n)=>{let r=`aes${parseInt(e.slice(1,4),10)}-wrap`;if(!Sv(r))throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`);let i=Fv(t,e,`wrapKey`);Pv(i,e);let a=$c(r,i,Cl.alloc(8,166));return w_(a.update(n),a.final())},Lv=(e,t,n)=>{let r=`aes${parseInt(e.slice(1,4),10)}-wrap`;if(!Sv(r))throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`);let i=Fv(t,e,`unwrapKey`);Pv(i,e);let a=el(r,i,Cl.alloc(8,166));return w_(a.update(n),a.final())}}));function zv(e){return Q(e)&&typeof e.kty==`string`}function Bv(e){return e.kty!==`oct`&&typeof e.d==`string`}function Vv(e){return e.kty!==`oct`&&e.d===void 0}function Hv(e){return zv(e)&&e.kty===`oct`&&typeof e.k==`string`}var Uv=t((()=>{Nv()})),Wv,Gv,Kv=t((()=>{Y(),lv(),ev(),bv(),Tv(),Uv(),Wv=e=>{switch(e){case`prime256v1`:return`P-256`;case`secp384r1`:return`P-384`;case`secp521r1`:return`P-521`;case`secp256k1`:return`secp256k1`;default:throw new K(`Unsupported key curve for this operation`)}},Gv=(e,t)=>{let n;if(cv(e))n=Zc.from(e);else if($_(e))n=e;else if(zv(e))return e.crv;else throw TypeError(yv(e,...Z));if(n.type===`secret`)throw TypeError(`only "private" or "public" type keys can be used for this operation`);switch(n.asymmetricKeyType){case`ed25519`:case`ed448`:return`Ed${n.asymmetricKeyType.slice(2)}`;case`x25519`:case`x448`:return`X${n.asymmetricKeyType.slice(1)}`;case`ec`:{let e=n.asymmetricKeyDetails.namedCurve;return t?e:Wv(e)}default:throw TypeError(`Invalid asymmetric key type for this operation`)}}}));async function qv(e,t,n,r,i=new Uint8Array,a=new Uint8Array){let o;if(cv(e))hv(e,`ECDH`),o=Zc.from(e);else if($_(e))o=e;else throw TypeError(yv(e,...Z));let s;if(cv(t))hv(t,`ECDH`,`deriveBits`),s=Zc.from(t);else if($_(t))s=t;else throw TypeError(yv(t,...Z));let c=w_(k_(V.encode(n)),k_(i),k_(a),O_(r));return A_(ol({privateKey:s,publicKey:o}),r,c)}async function Jv(e){let t;if(cv(e))t=Zc.from(e);else if($_(e))t=e;else throw TypeError(yv(e,...Z));switch(t.asymmetricKeyType){case`x25519`:return Yv(`x25519`);case`x448`:return Yv(`x448`);case`ec`:{let e=Gv(t);return Yv(`ec`,{namedCurve:e})}default:throw new K(`Invalid or unsupported EPK`)}}var Yv,Xv,Zv=t((()=>{Kv(),H(),Y(),lv(),gv(),ev(),bv(),Tv(),Yv=vl(sl),Xv=e=>[`P-256`,`P-384`,`P-521`,`X25519`,`X448`].includes(Gv(e))}));function Qv(e){if(!(e instanceof Uint8Array)||e.length<8)throw new q(`PBES2 Salt Input must be 8 or more octets`)}var $v=t((()=>{Y()}));function ey(e,t){if($_(e))return e.export();if(e instanceof Uint8Array)return e;if(cv(e))return hv(e,t,`deriveBits`,`deriveKey`),Zc.from(e).export();throw TypeError(yv(e,...Z,`Uint8Array`))}var ty,ny,ry,iy=t((()=>{q_(),H(),P_(),Rv(),$v(),lv(),gv(),ev(),bv(),Tv(),ty=vl(ll),ny=async(e,t,n,r=2048,i=fl(new Uint8Array(16)))=>{Qv(i);let a=T_(e,i),o=parseInt(e.slice(13,16),10)>>3,s=ey(t,e),c=await ty(s,a,r,o,`sha${e.slice(8,11)}`);return{encryptedKey:await Iv(e.slice(-6),c,n),p2c:r,p2s:U(i)}},ry=async(e,t,n,r,i)=>{Qv(i);let a=T_(e,i),o=parseInt(e.slice(13,16),10)>>3,s=ey(t,e),c=await ty(s,a,r,o,`sha${e.slice(8,11)}`);return Lv(e.slice(-6),c,n)}})),ay,oy=t((()=>{ay=(e,t)=>{let n;try{n=e instanceof Zc?e.asymmetricKeyDetails?.modulusLength:Buffer.from(e.n,`base64url`).byteLength<<3}catch{}if(typeof n!=`number`||n<2048)throw TypeError(`${t} requires key modulusLength to be 2048 bits or larger`)}}));function sy(e,t,...n){if($_(e))return e;if(cv(e))return hv(e,t,...n),Zc.from(e);throw TypeError(yv(e,...Z))}var cy,ly,uy,dy,fy,py,my=t((()=>{oy(),lv(),gv(),ev(),bv(),Tv(),cy=(e,t)=>{if(e.asymmetricKeyType!==`rsa`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be rsa`);ay(e,t)},ly=gl(()=>Qc.RSA_PKCS1_PADDING,`The RSA1_5 "alg" (JWE Algorithm) is deprecated and will be removed in the next major revision.`),uy=e=>{switch(e){case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:return Qc.RSA_PKCS1_OAEP_PADDING;case`RSA1_5`:return ly();default:return}},dy=e=>{switch(e){case`RSA-OAEP`:return`sha1`;case`RSA-OAEP-256`:return`sha256`;case`RSA-OAEP-384`:return`sha384`;case`RSA-OAEP-512`:return`sha512`;default:return}},fy=(e,t,n)=>{let r=uy(e),i=dy(e),a=sy(t,e,`wrapKey`,`encrypt`);return cy(a,e),dl({key:a,oaepHash:i,padding:r},n)},py=(e,t,n)=>{let r=uy(e),i=dy(e),a=sy(t,e,`unwrapKey`,`decrypt`);return cy(a,e),ul({key:a,oaepHash:i,padding:r},n)}})),hy,gy=t((()=>{hy={}}));function _y(e){switch(e){case`A128GCM`:return 128;case`A192GCM`:return 192;case`A256GCM`:case`A128CBC-HS256`:return 256;case`A192CBC-HS384`:return 384;case`A256CBC-HS512`:return 512;default:throw new K(`Unsupported JWE Algorithm: ${e}`)}}var vy,yy=t((()=>{Y(),q_(),vy=e=>fl(new Uint8Array(_y(e)>>3))})),by,xy,Sy,Cy,wy,Ty,Ey=t((()=>{lv(),ev(),bv(),Tv(),by=(e,t,n)=>{let r;if(cv(n)){if(!n.extractable)throw TypeError(`CryptoKey is not extractable`);r=Zc.from(n)}else if($_(n))r=n;else throw TypeError(yv(n,...Z));if(r.type!==e)throw TypeError(`key is not a ${e} key`);return r.export({format:`pem`,type:t})},xy=e=>by(`public`,`spki`,e),Sy=e=>by(`private`,`pkcs8`,e),Cy=e=>rl({key:Cl.from(e.replace(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,``),`base64`),type:`pkcs8`,format:`der`}),wy=e=>il({key:Cl.from(e.replace(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,``),`base64`),type:`spki`,format:`der`}),Ty=e=>il({key:e,type:`spki`,format:`pem`})})),Dy,Oy=t((()=>{Dy=e=>e.d?rl({format:`jwk`,key:e}):il({format:`jwk`,key:e})}));async function ky(e,t,n){if(typeof e!=`string`||e.indexOf(`-----BEGIN PUBLIC KEY-----`)!==0)throw TypeError(`"spki" must be SPKI formatted string`);return wy(e,t,n)}async function Ay(e,t,n){if(typeof e!=`string`||e.indexOf(`-----BEGIN CERTIFICATE-----`)!==0)throw TypeError(`"x509" must be X.509 formatted string`);return Ty(e,t,n)}async function jy(e,t,n){if(typeof e!=`string`||e.indexOf(`-----BEGIN PRIVATE KEY-----`)!==0)throw TypeError(`"pkcs8" must be PKCS#8 formatted string`);return Cy(e,t,n)}async function My(e,t){if(!Q(e))throw TypeError(`JWK must be an object`);switch(t||=e.alg,e.kty){case`oct`:if(typeof e.k!=`string`||!e.k)throw TypeError(`missing "k" (Key Value) Parameter value`);return W(e.k);case`RSA`:if(`oth`in e&&e.oth!==void 0)throw new K(`RSA JWK "oth" (Other Primes Info) Parameter value is not supported`);case`EC`:case`OKP`:return Dy({...e,alg:t});default:throw new K(`Unsupported "kty" (Key Type) Parameter value`)}}var Ny=t((()=>{P_(),Ey(),Oy(),Y(),Nv()}));function Py(e,t,n,r){t.startsWith(`HS`)||t===`dir`||t.startsWith(`PBES2`)||/^A\d{3}(?:GCM)?KW$/.test(t)?Ly(t,n,r,e):Ry(t,n,r,e)}var Fy,Iy,Ly,Ry,zy,By,Vy=t((()=>{bv(),Tv(),Uv(),Fy=e=>e?.[Symbol.toStringTag],Iy=(e,t,n)=>{if(t.use!==void 0&&t.use!==`sig`)throw TypeError(`Invalid key for this operation, when present its use must be sig`);if(t.key_ops!==void 0&&t.key_ops.includes?.(n)!==!0)throw TypeError(`Invalid key for this operation, when present its key_ops must include ${n}`);if(t.alg!==void 0&&t.alg!==e)throw TypeError(`Invalid key for this operation, when present its alg must be ${e}`);return!0},Ly=(e,t,n,r)=>{if(!(t instanceof Uint8Array)){if(r&&zv(t)){if(Hv(t)&&Iy(e,t,n))return;throw TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`)}if(!wv(t))throw TypeError(vv(e,t,...Z,`Uint8Array`,r?`JSON Web Key`:null));if(t.type!==`secret`)throw TypeError(`${Fy(t)} instances for symmetric algorithms must be of type "secret"`)}},Ry=(e,t,n,r)=>{if(r&&zv(t))switch(n){case`sign`:if(Bv(t)&&Iy(e,t,n))return;throw TypeError(`JSON Web Key for this operation be a private JWK`);case`verify`:if(Vv(t)&&Iy(e,t,n))return;throw TypeError(`JSON Web Key for this operation be a public JWK`)}if(!wv(t))throw TypeError(vv(e,t,...Z,r?`JSON Web Key`:null));if(t.type===`secret`)throw TypeError(`${Fy(t)} instances for asymmetric algorithms must not be of type "secret"`);if(n===`sign`&&t.type===`public`)throw TypeError(`${Fy(t)} instances for asymmetric algorithm signing must be of type "private"`);if(n===`decrypt`&&t.type===`public`)throw TypeError(`${Fy(t)} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&n===`verify`&&t.type===`private`)throw TypeError(`${Fy(t)} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&n===`encrypt`&&t.type===`private`)throw TypeError(`${Fy(t)} instances for asymmetric algorithm encryption must be of type "public"`)},zy=Py.bind(void 0,!1),By=Py.bind(void 0,!0)}));function Hy(e,t,n,r,i){let a=parseInt(e.slice(1,4),10);$_(n)&&(n=n.export());let o=n.subarray(a>>3),s=n.subarray(0,a>>3),c=`aes-${a}-cbc`;if(!Sv(c))throw new K(`alg ${e} is not supported by your javascript runtime`);let l=$c(c,o,r),u=w_(l.update(t),l.final());return{ciphertext:u,tag:av(i,r,u,parseInt(e.slice(-3),10),s,a),iv:r}}function Uy(e,t,n,r,i){let a=`aes-${parseInt(e.slice(1,4),10)}-gcm`;if(!Sv(a))throw new K(`alg ${e} is not supported by your javascript runtime`);let o=$c(a,n,r,{authTagLength:16});i.byteLength&&o.setAAD(i,{plaintextLength:t.length});let s=o.update(t);return o.final(),{ciphertext:s,tag:o.getAuthTag(),iv:r}}var Wy,Gy=t((()=>{Q_(),nv(),H(),ov(),lv(),gv(),ev(),bv(),X_(),Y(),Cv(),Tv(),Wy=(e,t,n,r,i)=>{let a;if(cv(n))hv(n,e,`encrypt`),a=Zc.from(n);else if(n instanceof Uint8Array||$_(n))a=n;else throw TypeError(yv(n,...Z,`Uint8Array`));switch(tv(e,a),r?Z_(e,r):r=Y_(e),e){case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:return Hy(e,t,a,r,i);case`A128GCM`:case`A192GCM`:case`A256GCM`:return Uy(e,t,a,r,i);default:throw new K(`Unsupported JWE Content Encryption Algorithm`)}}}));async function Ky(e,t,n,r){let i=await Wy(e.slice(0,7),n,t,r,new Uint8Array);return{encryptedKey:i.ciphertext,iv:U(i.iv),tag:U(i.tag)}}async function qy(e,t,n,r,i){return Ov(e.slice(0,7),t,n,r,i,new Uint8Array)}var Jy=t((()=>{Gy(),kv(),P_()}));async function Yy(e,t,n,r,i){switch(zy(e,t,`decrypt`),t=await hy.normalizePrivateKey?.(t,e)||t,e){case`dir`:if(n!==void 0)throw new q(`Encountered unexpected JWE Encrypted Key`);return t;case`ECDH-ES`:if(n!==void 0)throw new q(`Encountered unexpected JWE Encrypted Key`);case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:{if(!Q(r.epk))throw new q(`JOSE Header "epk" (Ephemeral Public Key) missing or invalid`);if(!Xv(t))throw new K(`ECDH with the provided key is not allowed or not supported by your javascript runtime`);let i=await My(r.epk,e),a,o;if(r.apu!==void 0){if(typeof r.apu!=`string`)throw new q(`JOSE Header "apu" (Agreement PartyUInfo) invalid`);try{a=W(r.apu)}catch{throw new q(`Failed to base64url decode the apu`)}}if(r.apv!==void 0){if(typeof r.apv!=`string`)throw new q(`JOSE Header "apv" (Agreement PartyVInfo) invalid`);try{o=W(r.apv)}catch{throw new q(`Failed to base64url decode the apv`)}}let s=await qv(i,t,e===`ECDH-ES`?r.enc:e,e===`ECDH-ES`?_y(r.enc):parseInt(e.slice(-5,-2),10),a,o);if(e===`ECDH-ES`)return s;if(n===void 0)throw new q(`JWE Encrypted Key missing`);return Lv(e.slice(-6),s,n)}case`RSA1_5`:case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:if(n===void 0)throw new q(`JWE Encrypted Key missing`);return py(e,t,n);case`PBES2-HS256+A128KW`:case`PBES2-HS384+A192KW`:case`PBES2-HS512+A256KW`:{if(n===void 0)throw new q(`JWE Encrypted Key missing`);if(typeof r.p2c!=`number`)throw new q(`JOSE Header "p2c" (PBES2 Count) missing or invalid`);let a=i?.maxPBES2Count||1e4;if(r.p2c>a)throw new q(`JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds`);if(typeof r.p2s!=`string`)throw new q(`JOSE Header "p2s" (PBES2 Salt) missing or invalid`);let o;try{o=W(r.p2s)}catch{throw new q(`Failed to base64url decode the p2s`)}return ry(e,t,n,r.p2c,o)}case`A128KW`:case`A192KW`:case`A256KW`:if(n===void 0)throw new q(`JWE Encrypted Key missing`);return Lv(e,t,n);case`A128GCMKW`:case`A192GCMKW`:case`A256GCMKW`:{if(n===void 0)throw new q(`JWE Encrypted Key missing`);if(typeof r.iv!=`string`)throw new q(`JOSE Header "iv" (Initialization Vector) missing or invalid`);if(typeof r.tag!=`string`)throw new q(`JOSE Header "tag" (Authentication Tag) missing or invalid`);let i;try{i=W(r.iv)}catch{throw new q(`Failed to base64url decode the iv`)}let a;try{a=W(r.tag)}catch{throw new q(`Failed to base64url decode the tag`)}return qy(e,t,n,i,a)}default:throw new K(`Invalid or unsupported "alg" (JWE Algorithm) header value`)}}var Xy=t((()=>{Rv(),Zv(),iy(),my(),P_(),gy(),Y(),yy(),Ny(),Vy(),Nv(),Jy()}));function Zy(e,t,n,r,i){if(i.crit!==void 0&&r?.crit===void 0)throw new e(`"crit" (Critical) Header Parameter MUST be integrity protected`);if(!r||r.crit===void 0)return new Set;if(!Array.isArray(r.crit)||r.crit.length===0||r.crit.some(e=>typeof e!=`string`||e.length===0))throw new e(`"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present`);let a;a=n===void 0?t:new Map([...Object.entries(n),...t.entries()]);for(let t of r.crit){if(!a.has(t))throw new K(`Extension Header Parameter "${t}" is not recognized`);if(i[t]===void 0)throw new e(`Extension Header Parameter "${t}" is missing`);if(a.get(t)&&r[t]===void 0)throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(r.crit)}var Qy=t((()=>{Y()})),$y,eb=t((()=>{$y=(e,t)=>{if(t!==void 0&&(!Array.isArray(t)||t.some(e=>typeof e!=`string`)))throw TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)}}));async function tb(e,t,n){if(!Q(e))throw new q(`Flattened JWE must be an object`);if(e.protected===void 0&&e.header===void 0&&e.unprotected===void 0)throw new q(`JOSE Header missing`);if(e.iv!==void 0&&typeof e.iv!=`string`)throw new q(`JWE Initialization Vector incorrect type`);if(typeof e.ciphertext!=`string`)throw new q(`JWE Ciphertext missing or incorrect type`);if(e.tag!==void 0&&typeof e.tag!=`string`)throw new q(`JWE Authentication Tag incorrect type`);if(e.protected!==void 0&&typeof e.protected!=`string`)throw new q(`JWE Protected Header incorrect type`);if(e.encrypted_key!==void 0&&typeof e.encrypted_key!=`string`)throw new q(`JWE Encrypted Key incorrect type`);if(e.aad!==void 0&&typeof e.aad!=`string`)throw new q(`JWE AAD incorrect type`);if(e.header!==void 0&&!Q(e.header))throw new q(`JWE Shared Unprotected Header incorrect type`);if(e.unprotected!==void 0&&!Q(e.unprotected))throw new q(`JWE Per-Recipient Unprotected Header incorrect type`);let r;if(e.protected)try{let t=W(e.protected);r=JSON.parse(j_.decode(t))}catch{throw new q(`JWE Protected Header is invalid`)}if(!Av(r,e.header,e.unprotected))throw new q(`JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint`);let i={...r,...e.header,...e.unprotected};if(Zy(q,new Map,n?.crit,r,i),i.zip!==void 0)throw new K(`JWE "zip" (Compression Algorithm) Header Parameter is not supported.`);let{alg:a,enc:o}=i;if(typeof a!=`string`||!a)throw new q(`missing JWE Algorithm (alg) in JWE Header`);if(typeof o!=`string`||!o)throw new q(`missing JWE Encryption Algorithm (enc) in JWE Header`);let s=n&&$y(`keyManagementAlgorithms`,n.keyManagementAlgorithms),c=n&&$y(`contentEncryptionAlgorithms`,n.contentEncryptionAlgorithms);if(s&&!s.has(a)||!s&&a.startsWith(`PBES2`))throw new R_(`"alg" (Algorithm) Header Parameter value not allowed`);if(c&&!c.has(o))throw new R_(`"enc" (Encryption Algorithm) Header Parameter value not allowed`);let l;if(e.encrypted_key!==void 0)try{l=W(e.encrypted_key)}catch{throw new q(`Failed to base64url decode the encrypted_key`)}let u=!1;typeof t==`function`&&(t=await t(r,e),u=!0);let d;try{d=await Yy(a,t,l,i,n)}catch(e){if(e instanceof TypeError||e instanceof q||e instanceof K)throw e;d=vy(o)}let f,p;if(e.iv!==void 0)try{f=W(e.iv)}catch{throw new q(`Failed to base64url decode the iv`)}if(e.tag!==void 0)try{p=W(e.tag)}catch{throw new q(`Failed to base64url decode the tag`)}let m=V.encode(e.protected??``),h;h=e.aad===void 0?m:w_(m,V.encode(`.`),V.encode(e.aad));let g;try{g=W(e.ciphertext)}catch{throw new q(`Failed to base64url decode the ciphertext`)}let _={plaintext:await Ov(o,d,g,f,p,h)};if(e.protected!==void 0&&(_.protectedHeader=r),e.aad!==void 0)try{_.additionalAuthenticatedData=W(e.aad)}catch{throw new q(`Failed to base64url decode the aad`)}return e.unprotected!==void 0&&(_.sharedUnprotectedHeader=e.unprotected),e.header!==void 0&&(_.unprotectedHeader=e.header),u?{..._,key:t}:_}var nb=t((()=>{P_(),kv(),Y(),jv(),Nv(),Xy(),H(),yy(),Qy(),eb()}));async function rb(e,t,n){if(e instanceof Uint8Array&&(e=j_.decode(e)),typeof e!=`string`)throw new q(`Compact JWE must be a string or Uint8Array`);let{0:r,1:i,2:a,3:o,4:s,length:c}=e.split(`.`);if(c!==5)throw new q(`Invalid Compact JWE`);let l=await tb({ciphertext:o,iv:a||void 0,protected:r,tag:s||void 0,encrypted_key:i||void 0},t,n),u={plaintext:l.plaintext,protectedHeader:l.protectedHeader};return typeof t==`function`?{...u,key:l.key}:u}var ib=t((()=>{nb(),Y(),H()}));async function ab(e,t,n){if(!Q(e))throw new q(`General JWE must be an object`);if(!Array.isArray(e.recipients)||!e.recipients.every(Q))throw new q(`JWE Recipients missing or incorrect type`);if(!e.recipients.length)throw new q(`JWE Recipients has no members`);for(let r of e.recipients)try{return await tb({aad:e.aad,ciphertext:e.ciphertext,encrypted_key:r.encrypted_key,header:r.header,iv:e.iv,protected:e.protected,tag:e.tag,unprotected:e.unprotected},t,n)}catch{}throw new z_}var ob=t((()=>{nb(),Y(),Nv()})),sb,cb=t((()=>{sb=Symbol()})),lb,ub=t((()=>{P_(),Y(),lv(),ev(),bv(),Tv(),lb=e=>{let t;if(cv(e)){if(!e.extractable)throw TypeError(`CryptoKey is not extractable`);t=Zc.from(e)}else if($_(e))t=e;else if(e instanceof Uint8Array)return{kty:`oct`,k:U(e)};else throw TypeError(yv(e,...Z,`Uint8Array`));if(t.type!==`secret`&&![`rsa`,`ec`,`ed25519`,`x25519`,`ed448`,`x448`].includes(t.asymmetricKeyType))throw new K(`Unsupported key asymmetricKeyType`);return t.export({format:`jwk`})}}));async function db(e){return xy(e)}async function fb(e){return Sy(e)}async function pb(e){return lb(e)}var mb=t((()=>{Ey(),ub()}));async function hb(e,t,n,r,i={}){let a,o,s;switch(zy(e,n,`encrypt`),n=await hy.normalizePublicKey?.(n,e)||n,e){case`dir`:s=n;break;case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:{if(!Xv(n))throw new K(`ECDH with the provided key is not allowed or not supported by your javascript runtime`);let{apu:c,apv:l}=i,{epk:u}=i;u||=(await Jv(n)).privateKey;let{x:d,y:f,crv:p,kty:m}=await pb(u),h=await qv(n,u,e===`ECDH-ES`?t:e,e===`ECDH-ES`?_y(t):parseInt(e.slice(-5,-2),10),c,l);if(o={epk:{x:d,crv:p,kty:m}},m===`EC`&&(o.epk.y=f),c&&(o.apu=U(c)),l&&(o.apv=U(l)),e===`ECDH-ES`){s=h;break}s=r||vy(t),a=await Iv(e.slice(-6),h,s);break}case`RSA1_5`:case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:s=r||vy(t),a=await fy(e,n,s);break;case`PBES2-HS256+A128KW`:case`PBES2-HS384+A192KW`:case`PBES2-HS512+A256KW`:{s=r||vy(t);let{p2c:c,p2s:l}=i;({encryptedKey:a,...o}=await ny(e,n,s,c,l));break}case`A128KW`:case`A192KW`:case`A256KW`:s=r||vy(t),a=await Iv(e,n,s);break;case`A128GCMKW`:case`A192GCMKW`:case`A256GCMKW`:{s=r||vy(t);let{iv:c}=i;({encryptedKey:a,...o}=await Ky(e,n,s,c));break}default:throw new K(`Invalid or unsupported "alg" (JWE Algorithm) header value`)}return{cek:s,encryptedKey:a,parameters:o}}var gb=t((()=>{Rv(),Zv(),iy(),my(),P_(),gy(),yy(),Y(),mb(),Vy(),Jy()})),_b,vb=t((()=>{P_(),cb(),Gy(),gb(),Y(),jv(),H(),Qy(),_b=class{_plaintext;_protectedHeader;_sharedUnprotectedHeader;_unprotectedHeader;_aad;_cek;_iv;_keyManagementParameters;constructor(e){if(!(e instanceof Uint8Array))throw TypeError(`plaintext must be an instance of Uint8Array`);this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw TypeError(`setKeyManagementParameters can only be called once`);return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw TypeError(`setSharedUnprotectedHeader can only be called once`);return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError(`setUnprotectedHeader can only be called once`);return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw TypeError(`setContentEncryptionKey can only be called once`);return this._cek=e,this}setInitializationVector(e){if(this._iv)throw TypeError(`setInitializationVector can only be called once`);return this._iv=e,this}async encrypt(e,t){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new q(`either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()`);if(!Av(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new q(`JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint`);let n={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(Zy(q,new Map,t?.crit,this._protectedHeader,n),n.zip!==void 0)throw new K(`JWE "zip" (Compression Algorithm) Header Parameter is not supported.`);let{alg:r,enc:i}=n;if(typeof r!=`string`||!r)throw new q(`JWE "alg" (Algorithm) Header Parameter missing or invalid`);if(typeof i!=`string`||!i)throw new q(`JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid`);let a;if(this._cek&&(r===`dir`||r===`ECDH-ES`))throw TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${r}`);let o;{let n;({cek:o,encryptedKey:a,parameters:n}=await hb(r,i,e,this._cek,this._keyManagementParameters)),n&&(t&&sb in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...n}:this.setUnprotectedHeader(n):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...n}:this.setProtectedHeader(n))}let s,c,l;c=this._protectedHeader?V.encode(U(JSON.stringify(this._protectedHeader))):V.encode(``),this._aad?(l=U(this._aad),s=w_(c,V.encode(`.`),V.encode(l))):s=c;let{ciphertext:u,tag:d,iv:f}=await Wy(i,this._plaintext,o,this._iv,s),p={ciphertext:U(u)};return f&&(p.iv=U(f)),d&&(p.tag=U(d)),a&&(p.encrypted_key=U(a)),l&&(p.aad=l),this._protectedHeader&&(p.protected=j_.decode(c)),this._sharedUnprotectedHeader&&(p.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(p.header=this._unprotectedHeader),p}}})),yb,bb,xb=t((()=>{vb(),cb(),Y(),yy(),jv(),gb(),P_(),Qy(),yb=class{parent;unprotectedHeader;key;options;constructor(e,t,n){this.parent=e,this.key=t,this.options=n}setUnprotectedHeader(e){if(this.unprotectedHeader)throw TypeError(`setUnprotectedHeader can only be called once`);return this.unprotectedHeader=e,this}addRecipient(...e){return this.parent.addRecipient(...e)}encrypt(...e){return this.parent.encrypt(...e)}done(){return this.parent}},bb=class{_plaintext;_recipients=[];_protectedHeader;_unprotectedHeader;_aad;constructor(e){this._plaintext=e}addRecipient(e,t){let n=new yb(this,e,{crit:t?.crit});return this._recipients.push(n),n}setProtectedHeader(e){if(this._protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError(`setSharedUnprotectedHeader can only be called once`);return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}async encrypt(){if(!this._recipients.length)throw new q(`at least one recipient must be added`);if(this._recipients.length===1){let[e]=this._recipients,t=await new _b(this._plaintext).setAdditionalAuthenticatedData(this._aad).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(e.unprotectedHeader).encrypt(e.key,{...e.options}),n={ciphertext:t.ciphertext,iv:t.iv,recipients:[{}],tag:t.tag};return t.aad&&(n.aad=t.aad),t.protected&&(n.protected=t.protected),t.unprotected&&(n.unprotected=t.unprotected),t.encrypted_key&&(n.recipients[0].encrypted_key=t.encrypted_key),t.header&&(n.recipients[0].header=t.header),n}let e;for(let t=0;t<this._recipients.length;t++){let n=this._recipients[t];if(!Av(this._protectedHeader,this._unprotectedHeader,n.unprotectedHeader))throw new q(`JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint`);let r={...this._protectedHeader,...this._unprotectedHeader,...n.unprotectedHeader},{alg:i}=r;if(typeof i!=`string`||!i)throw new q(`JWE "alg" (Algorithm) Header Parameter missing or invalid`);if(i===`dir`||i===`ECDH-ES`)throw new q(`"dir" and "ECDH-ES" alg may only be used with a single recipient`);if(typeof r.enc!=`string`||!r.enc)throw new q(`JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid`);if(!e)e=r.enc;else if(e!==r.enc)throw new q(`JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients`);if(Zy(q,new Map,n.options.crit,this._protectedHeader,r),r.zip!==void 0)throw new K(`JWE "zip" (Compression Algorithm) Header Parameter is not supported.`)}let t=vy(e),n={ciphertext:``,iv:``,recipients:[],tag:``};for(let r=0;r<this._recipients.length;r++){let i=this._recipients[r],a={};n.recipients.push(a);let o={...this._protectedHeader,...this._unprotectedHeader,...i.unprotectedHeader}.alg.startsWith(`PBES2`)?2048+r:void 0;if(r===0){let e=await new _b(this._plaintext).setAdditionalAuthenticatedData(this._aad).setContentEncryptionKey(t).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(i.unprotectedHeader).setKeyManagementParameters({p2c:o}).encrypt(i.key,{...i.options,[sb]:!0});n.ciphertext=e.ciphertext,n.iv=e.iv,n.tag=e.tag,e.aad&&(n.aad=e.aad),e.protected&&(n.protected=e.protected),e.unprotected&&(n.unprotected=e.unprotected),a.encrypted_key=e.encrypted_key,e.header&&(a.header=e.header);continue}let{encryptedKey:s,parameters:c}=await hb(i.unprotectedHeader?.alg||this._protectedHeader?.alg||this._unprotectedHeader?.alg,e,i.key,t,{p2c:o});a.encrypted_key=U(s),(i.unprotectedHeader||c)&&(a.header={...i.unprotectedHeader,...c})}return n}}}));function Sb(e){switch(e){case`PS256`:case`RS256`:case`ES256`:case`ES256K`:return`sha256`;case`PS384`:case`RS384`:case`ES384`:return`sha384`;case`PS512`:case`RS512`:case`ES512`:return`sha512`;case`Ed25519`:case`EdDSA`:return;default:throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var Cb=t((()=>{Y()}));function wb(e,t){let n,r,i;if(t instanceof Zc)n=t.asymmetricKeyType,r=t.asymmetricKeyDetails;else switch(i=!0,t.kty){case`RSA`:n=`rsa`;break;case`EC`:n=`ec`;break;case`OKP`:if(t.crv===`Ed25519`){n=`ed25519`;break}if(t.crv===`Ed448`){n=`ed448`;break}throw TypeError(`Invalid key for this operation, its crv must be Ed25519 or Ed448`);default:throw TypeError(`Invalid key for this operation, its kty must be RSA, OKP, or EC`)}let a;switch(e){case`Ed25519`:if(n!==`ed25519`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be ed25519`);break;case`EdDSA`:if(![`ed25519`,`ed448`].includes(n))throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be ed25519 or ed448`);break;case`RS256`:case`RS384`:case`RS512`:if(n!==`rsa`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be rsa`);ay(t,e);break;case`PS256`:case`PS384`:case`PS512`:if(n===`rsa-pss`){let{hashAlgorithm:t,mgf1HashAlgorithm:n,saltLength:i}=r,a=parseInt(e.slice(-3),10);if(t!==void 0&&(t!==`sha${a}`||n!==t))throw TypeError(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}`);if(i!==void 0&&i>a>>3)throw TypeError(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}`)}else if(n!==`rsa`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be rsa or rsa-pss`);ay(t,e),a={padding:Qc.RSA_PKCS1_PSS_PADDING,saltLength:Qc.RSA_PSS_SALTLEN_DIGEST};break;case`ES256`:case`ES256K`:case`ES384`:case`ES512`:{if(n!==`ec`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be ec`);let r=Gv(t),i=Tb.get(e);if(r!==i)throw TypeError(`Invalid key curve for the algorithm, its curve must be ${i}, got ${r}`);a={dsaEncoding:`ieee-p1363`};break}default:throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`)}return i?{format:`jwk`,key:t,...a}:a?{...a,key:t}:t}var Tb,Eb=t((()=>{Kv(),Y(),oy(),Tb=new Map([[`ES256`,`P-256`],[`ES256K`,`secp256k1`],[`ES384`,`P-384`],[`ES512`,`P-521`]])}));function Db(e){switch(e){case`HS256`:return`sha256`;case`HS384`:return`sha384`;case`HS512`:return`sha512`;default:throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var Ob=t((()=>{Y()}));function kb(e,t,n){if(t instanceof Uint8Array){if(!e.startsWith(`HS`))throw TypeError(yv(t,...Z));return al(t)}if(t instanceof Zc)return t;if(cv(t))return mv(t,e,n),Zc.from(t);if(zv(t))return e.startsWith(`HS`)?al(Buffer.from(t.k,`base64url`)):t;throw TypeError(yv(t,...Z,`Uint8Array`,`JSON Web Key`))}var Ab=t((()=>{lv(),gv(),bv(),Tv(),Uv()})),jb,Mb,Nb=t((()=>{Cb(),Ob(),Eb(),Ab(),jb=vl(Xc.sign),Mb=async(e,t,n)=>{let r=kb(e,t,`sign`);if(e.startsWith(`HS`)){let t=Xc.createHmac(Db(e),r);return t.update(n),t.digest()}return jb(Sb(e),n,wb(e,r))}})),Pb,Fb,Ib=t((()=>{Cb(),Eb(),Nb(),Ab(),Pb=vl(Xc.verify),Fb=async(e,t,n,r)=>{let i=kb(e,t,`verify`);if(e.startsWith(`HS`)){let t=await Mb(e,i,r),a=n;try{return Xc.timingSafeEqual(a,t)}catch{return!1}}let a=Sb(e),o=wb(e,i);try{return await Pb(a,r,o,n)}catch{return!1}}}));async function Lb(e,t,n){if(!Q(e))throw new J(`Flattened JWS must be an object`);if(e.protected===void 0&&e.header===void 0)throw new J(`Flattened JWS must have either of the "protected" or "header" members`);if(e.protected!==void 0&&typeof e.protected!=`string`)throw new J(`JWS Protected Header incorrect type`);if(e.payload===void 0)throw new J(`JWS Payload missing`);if(typeof e.signature!=`string`)throw new J(`JWS Signature missing or incorrect type`);if(e.header!==void 0&&!Q(e.header))throw new J(`JWS Unprotected Header incorrect type`);let r={};if(e.protected)try{let t=W(e.protected);r=JSON.parse(j_.decode(t))}catch{throw new J(`JWS Protected Header is invalid`)}if(!Av(r,e.header))throw new J(`JWS Protected and JWS Unprotected Header Parameter names must be disjoint`);let i={...r,...e.header},a=Zy(J,new Map([[`b64`,!0]]),n?.crit,r,i),o=!0;if(a.has(`b64`)&&(o=r.b64,typeof o!=`boolean`))throw new J(`The "b64" (base64url-encode payload) Header Parameter must be a boolean`);let{alg:s}=i;if(typeof s!=`string`||!s)throw new J(`JWS "alg" (Algorithm) Header Parameter missing or invalid`);let c=n&&$y(`algorithms`,n.algorithms);if(c&&!c.has(s))throw new R_(`"alg" (Algorithm) Header Parameter value not allowed`);if(o){if(typeof e.payload!=`string`)throw new J(`JWS Payload must be a string`)}else if(typeof e.payload!=`string`&&!(e.payload instanceof Uint8Array))throw new J(`JWS Payload must be a string or an Uint8Array instance`);let l=!1;typeof t==`function`?(t=await t(r,e),l=!0,By(s,t,`verify`),zv(t)&&(t=await My(t,s))):By(s,t,`verify`);let u=w_(V.encode(e.protected??``),V.encode(`.`),typeof e.payload==`string`?V.encode(e.payload):e.payload),d;try{d=W(e.signature)}catch{throw new J(`Failed to base64url decode the signature`)}if(!await Fb(s,t,d,u))throw new K_;let f;if(o)try{f=W(e.payload)}catch{throw new J(`Failed to base64url decode the payload`)}else f=typeof e.payload==`string`?V.encode(e.payload):e.payload;let p={payload:f};return e.protected!==void 0&&(p.protectedHeader=r),e.header!==void 0&&(p.unprotectedHeader=e.header),l?{...p,key:t}:p}var Rb=t((()=>{P_(),Ib(),Y(),H(),jv(),Nv(),Vy(),Qy(),eb(),Uv(),Ny()}));async function zb(e,t,n){if(e instanceof Uint8Array&&(e=j_.decode(e)),typeof e!=`string`)throw new J(`Compact JWS must be a string or Uint8Array`);let{0:r,1:i,2:a,length:o}=e.split(`.`);if(o!==3)throw new J(`Invalid Compact JWS`);let s=await Lb({payload:i,protected:r,signature:a},t,n),c={payload:s.payload,protectedHeader:s.protectedHeader};return typeof t==`function`?{...c,key:s.key}:c}var Bb=t((()=>{Rb(),Y(),H()}));async function Vb(e,t,n){if(!Q(e))throw new J(`General JWS must be an object`);if(!Array.isArray(e.signatures)||!e.signatures.every(Q))throw new J(`JWS Signatures missing or incorrect type`);for(let r of e.signatures)try{return await Lb({header:r.header,payload:e.payload,protected:r.protected,signature:r.signature},t,n)}catch{}throw new K_}var Hb=t((()=>{Rb(),Y(),Nv()})),Ub,Wb=t((()=>{Ub=e=>Math.floor(e.getTime()/1e3)})),Gb,Kb,qb,Jb,Yb,Xb,Zb,Qb=t((()=>{Gb=60,Kb=Gb*60,qb=Kb*24,Jb=qb*7,Yb=qb*365.25,Xb=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,Zb=e=>{let t=Xb.exec(e);if(!t||t[4]&&t[1])throw TypeError(`Invalid time period format`);let n=parseFloat(t[2]),r=t[3].toLowerCase(),i;switch(r){case`sec`:case`secs`:case`second`:case`seconds`:case`s`:i=Math.round(n);break;case`minute`:case`minutes`:case`min`:case`mins`:case`m`:i=Math.round(n*Gb);break;case`hour`:case`hours`:case`hr`:case`hrs`:case`h`:i=Math.round(n*Kb);break;case`day`:case`days`:case`d`:i=Math.round(n*qb);break;case`week`:case`weeks`:case`w`:i=Math.round(n*Jb);break;default:i=Math.round(n*Yb);break}return t[1]===`-`||t[4]===`ago`?-i:i}})),$b,ex,tx,nx=t((()=>{Y(),H(),Wb(),Qb(),Nv(),$b=e=>e.toLowerCase().replace(/^application\//,``),ex=(e,t)=>typeof e==`string`?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1,tx=(e,t,n={})=>{let r;try{r=JSON.parse(j_.decode(t))}catch{}if(!Q(r))throw new B_(`JWT Claims Set must be a top-level JSON object`);let{typ:i}=n;if(i&&(typeof e.typ!=`string`||$b(e.typ)!==$b(i)))throw new I_(`unexpected "typ" JWT header value`,r,`typ`,`check_failed`);let{requiredClaims:a=[],issuer:o,subject:s,audience:c,maxTokenAge:l}=n,u=[...a];l!==void 0&&u.push(`iat`),c!==void 0&&u.push(`aud`),s!==void 0&&u.push(`sub`),o!==void 0&&u.push(`iss`);for(let e of new Set(u.reverse()))if(!(e in r))throw new I_(`missing required "${e}" claim`,r,e,`missing`);if(o&&!(Array.isArray(o)?o:[o]).includes(r.iss))throw new I_(`unexpected "iss" claim value`,r,`iss`,`check_failed`);if(s&&r.sub!==s)throw new I_(`unexpected "sub" claim value`,r,`sub`,`check_failed`);if(c&&!ex(r.aud,typeof c==`string`?[c]:c))throw new I_(`unexpected "aud" claim value`,r,`aud`,`check_failed`);let d;switch(typeof n.clockTolerance){case`string`:d=Zb(n.clockTolerance);break;case`number`:d=n.clockTolerance;break;case`undefined`:d=0;break;default:throw TypeError(`Invalid clockTolerance option type`)}let{currentDate:f}=n,p=Ub(f||new Date);if((r.iat!==void 0||l)&&typeof r.iat!=`number`)throw new I_(`"iat" claim must be a number`,r,`iat`,`invalid`);if(r.nbf!==void 0){if(typeof r.nbf!=`number`)throw new I_(`"nbf" claim must be a number`,r,`nbf`,`invalid`);if(r.nbf>p+d)throw new I_(`"nbf" claim timestamp check failed`,r,`nbf`,`check_failed`)}if(r.exp!==void 0){if(typeof r.exp!=`number`)throw new I_(`"exp" claim must be a number`,r,`exp`,`invalid`);if(r.exp<=p-d)throw new L_(`"exp" claim timestamp check failed`,r,`exp`,`check_failed`)}if(l){let e=p-r.iat,t=typeof l==`number`?l:Zb(l);if(e-d>t)throw new L_(`"iat" claim timestamp check failed (too far in the past)`,r,`iat`,`check_failed`);if(e<0-d)throw new I_(`"iat" claim timestamp check failed (it should be in the past)`,r,`iat`,`check_failed`)}return r}}));async function rx(e,t,n){let r=await zb(e,t,n);if(r.protectedHeader.crit?.includes(`b64`)&&r.protectedHeader.b64===!1)throw new B_(`JWTs MUST NOT use unencoded payload`);let i={payload:tx(r.protectedHeader,r.payload,n),protectedHeader:r.protectedHeader};return typeof t==`function`?{...i,key:r.key}:i}var ix=t((()=>{Bb(),nx(),Y()}));async function ax(e,t,n){let r=await rb(e,t,n),i=tx(r.protectedHeader,r.plaintext,n),{protectedHeader:a}=r;if(a.iss!==void 0&&a.iss!==i.iss)throw new I_(`replicated "iss" claim header parameter mismatch`,i,`iss`,`mismatch`);if(a.sub!==void 0&&a.sub!==i.sub)throw new I_(`replicated "sub" claim header parameter mismatch`,i,`sub`,`mismatch`);if(a.aud!==void 0&&JSON.stringify(a.aud)!==JSON.stringify(i.aud))throw new I_(`replicated "aud" claim header parameter mismatch`,i,`aud`,`mismatch`);let o={payload:i,protectedHeader:a};return typeof t==`function`?{...o,key:r.key}:o}var ox=t((()=>{ib(),nx(),Y()})),sx,cx=t((()=>{vb(),sx=class{_flattened;constructor(e){this._flattened=new _b(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){let n=await this._flattened.encrypt(e,t);return[n.protected,n.encrypted_key,n.iv,n.ciphertext,n.tag].join(`.`)}}})),lx,ux=t((()=>{P_(),Nb(),jv(),Y(),H(),Vy(),Qy(),lx=class{_payload;_protectedHeader;_unprotectedHeader;constructor(e){if(!(e instanceof Uint8Array))throw TypeError(`payload must be an instance of Uint8Array`);this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError(`setUnprotectedHeader can only be called once`);return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new J(`either setProtectedHeader or setUnprotectedHeader must be called before #sign()`);if(!Av(this._protectedHeader,this._unprotectedHeader))throw new J(`JWS Protected and JWS Unprotected Header Parameter names must be disjoint`);let n={...this._protectedHeader,...this._unprotectedHeader},r=Zy(J,new Map([[`b64`,!0]]),t?.crit,this._protectedHeader,n),i=!0;if(r.has(`b64`)&&(i=this._protectedHeader.b64,typeof i!=`boolean`))throw new J(`The "b64" (base64url-encode payload) Header Parameter must be a boolean`);let{alg:a}=n;if(typeof a!=`string`||!a)throw new J(`JWS "alg" (Algorithm) Header Parameter missing or invalid`);By(a,e,`sign`);let o=this._payload;i&&(o=V.encode(U(o)));let s;s=this._protectedHeader?V.encode(U(JSON.stringify(this._protectedHeader))):V.encode(``);let c={signature:U(await Mb(a,e,w_(s,V.encode(`.`),o))),payload:``};return i&&(c.payload=j_.decode(o)),this._unprotectedHeader&&(c.header=this._unprotectedHeader),this._protectedHeader&&(c.protected=j_.decode(s)),c}}})),dx,fx=t((()=>{ux(),dx=class{_flattened;constructor(e){this._flattened=new lx(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){let n=await this._flattened.sign(e,t);if(n.payload===void 0)throw TypeError(`use the flattened module for creating JWS with b64: false`);return`${n.protected}.${n.payload}.${n.signature}`}}})),px,mx,hx=t((()=>{ux(),Y(),px=class{parent;protectedHeader;unprotectedHeader;options;key;constructor(e,t,n){this.parent=e,this.key=t,this.options=n}setProtectedHeader(e){if(this.protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this.protectedHeader=e,this}setUnprotectedHeader(e){if(this.unprotectedHeader)throw TypeError(`setUnprotectedHeader can only be called once`);return this.unprotectedHeader=e,this}addSignature(...e){return this.parent.addSignature(...e)}sign(...e){return this.parent.sign(...e)}done(){return this.parent}},mx=class{_payload;_signatures=[];constructor(e){this._payload=e}addSignature(e,t){let n=new px(this,e,t);return this._signatures.push(n),n}async sign(){if(!this._signatures.length)throw new J(`at least one signature must be added`);let e={signatures:[],payload:``};for(let t=0;t<this._signatures.length;t++){let n=this._signatures[t],r=new lx(this._payload);r.setProtectedHeader(n.protectedHeader),r.setUnprotectedHeader(n.unprotectedHeader);let{payload:i,...a}=await r.sign(n.key,n.options);if(t===0)e.payload=i;else if(e.payload!==i)throw new J(`inconsistent use of JWS Unencoded Payload (RFC7797)`);e.signatures.push(a)}return e}}}));function gx(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}var _x,vx=t((()=>{Wb(),Nv(),Qb(),_x=class{_payload;constructor(e={}){if(!Q(e))throw TypeError(`JWT Claims Set MUST be an object`);this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return typeof e==`number`?this._payload={...this._payload,nbf:gx(`setNotBefore`,e)}:e instanceof Date?this._payload={...this._payload,nbf:gx(`setNotBefore`,Ub(e))}:this._payload={...this._payload,nbf:Ub(new Date)+Zb(e)},this}setExpirationTime(e){return typeof e==`number`?this._payload={...this._payload,exp:gx(`setExpirationTime`,e)}:e instanceof Date?this._payload={...this._payload,exp:gx(`setExpirationTime`,Ub(e))}:this._payload={...this._payload,exp:Ub(new Date)+Zb(e)},this}setIssuedAt(e){return e===void 0?this._payload={...this._payload,iat:Ub(new Date)}:e instanceof Date?this._payload={...this._payload,iat:gx(`setIssuedAt`,Ub(e))}:typeof e==`string`?this._payload={...this._payload,iat:gx(`setIssuedAt`,Ub(new Date)+Zb(e))}:this._payload={...this._payload,iat:gx(`setIssuedAt`,e)},this}}})),yx,bx=t((()=>{fx(),Y(),H(),vx(),yx=class extends _x{_protectedHeader;setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,t){let n=new dx(V.encode(JSON.stringify(this._payload)));if(n.setProtectedHeader(this._protectedHeader),Array.isArray(this._protectedHeader?.crit)&&this._protectedHeader.crit.includes(`b64`)&&this._protectedHeader.b64===!1)throw new B_(`JWTs MUST NOT use unencoded payload`);return n.sign(e,t)}}})),xx,Sx=t((()=>{cx(),H(),vx(),xx=class extends _x{_cek;_iv;_keyManagementParameters;_protectedHeader;_replicateIssuerAsHeader;_replicateSubjectAsHeader;_replicateAudienceAsHeader;setProtectedHeader(e){if(this._protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this._protectedHeader=e,this}setKeyManagementParameters(e){if(this._keyManagementParameters)throw TypeError(`setKeyManagementParameters can only be called once`);return this._keyManagementParameters=e,this}setContentEncryptionKey(e){if(this._cek)throw TypeError(`setContentEncryptionKey can only be called once`);return this._cek=e,this}setInitializationVector(e){if(this._iv)throw TypeError(`setInitializationVector can only be called once`);return this._iv=e,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(e,t){let n=new sx(V.encode(JSON.stringify(this._payload)));return this._replicateIssuerAsHeader&&(this._protectedHeader={...this._protectedHeader,iss:this._payload.iss}),this._replicateSubjectAsHeader&&(this._protectedHeader={...this._protectedHeader,sub:this._payload.sub}),this._replicateAudienceAsHeader&&(this._protectedHeader={...this._protectedHeader,aud:this._payload.aud}),n.setProtectedHeader(this._protectedHeader),this._iv&&n.setInitializationVector(this._iv),this._cek&&n.setContentEncryptionKey(this._cek),this._keyManagementParameters&&n.setKeyManagementParameters(this._keyManagementParameters),n.encrypt(e,t)}}}));async function Cx(e,t){if(!Q(e))throw TypeError(`JWK must be an object`);if(t??=`sha256`,t!==`sha256`&&t!==`sha384`&&t!==`sha512`)throw TypeError(`digestAlgorithm must one of "sha256", "sha384", or "sha512"`);let n;switch(e.kty){case`EC`:Tx(e.crv,`"crv" (Curve) Parameter`),Tx(e.x,`"x" (X Coordinate) Parameter`),Tx(e.y,`"y" (Y Coordinate) Parameter`),n={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case`OKP`:Tx(e.crv,`"crv" (Subtype of Key Pair) Parameter`),Tx(e.x,`"x" (Public Key) Parameter`),n={crv:e.crv,kty:e.kty,x:e.x};break;case`RSA`:Tx(e.e,`"e" (Exponent) Parameter`),Tx(e.n,`"n" (Modulus) Parameter`),n={e:e.e,kty:e.kty,n:e.n};break;case`oct`:Tx(e.k,`"k" (Key Value) Parameter`),n={k:e.k,kty:e.kty};break;default:throw new K(`"kty" (Key Type) Parameter missing or unsupported`)}let r=V.encode(JSON.stringify(n));return U(await S_(t,r))}async function wx(e,t){t??=`sha256`;let n=await Cx(e,t);return`urn:ietf:params:oauth:jwk-thumbprint:sha-${t.slice(-3)}:${n}`}var Tx,Ex=t((()=>{C_(),P_(),Y(),H(),Nv(),Tx=(e,t)=>{if(typeof e!=`string`||!e)throw new V_(`${t} missing or invalid`)}}));async function Dx(e,t){let n={...e,...t?.header};if(!Q(n.jwk))throw new J(`"jwk" (JSON Web Key) Header Parameter must be a JSON object`);let r=await My({...n.jwk,ext:!0},n.alg);if(r instanceof Uint8Array||r.type!==`public`)throw new J(`"jwk" (JSON Web Key) Header Parameter must be a public key`);return r}var Ox=t((()=>{Ny(),Nv(),Y()}));function kx(e){switch(typeof e==`string`&&e.slice(0,2)){case`RS`:case`PS`:return`RSA`;case`ES`:return`EC`;case`Ed`:return`OKP`;default:throw new K(`Unsupported "alg" value for a JSON Web Key Set`)}}function Ax(e){return e&&typeof e==`object`&&Array.isArray(e.keys)&&e.keys.every(jx)}function jx(e){return Q(e)}function Mx(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}async function Nx(e,t,n){let r=e.get(t)||e.set(t,{}).get(t);if(r[n]===void 0){let e=await My({...t,ext:!0},n);if(e instanceof Uint8Array||e.type!==`public`)throw new H_(`JSON Web Key Set members must be public keys`);r[n]=e}return r[n]}function Px(e){let t=new Fx(e),n=async(e,n)=>t.getKey(e,n);return Object.defineProperties(n,{jwks:{value:()=>Mx(t._jwks),enumerable:!0,configurable:!1,writable:!1}}),n}var Fx,Ix=t((()=>{Ny(),Y(),Nv(),Fx=class{_jwks;_cached=new WeakMap;constructor(e){if(!Ax(e))throw new H_(`JSON Web Key Set malformed`);this._jwks=Mx(e)}async getKey(e,t){let{alg:n,kid:r}={...e,...t?.header},i=kx(n),a=this._jwks.keys.filter(e=>{let t=i===e.kty;if(t&&typeof r==`string`&&(t=r===e.kid),t&&typeof e.alg==`string`&&(t=n===e.alg),t&&typeof e.use==`string`&&(t=e.use===`sig`),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes(`verify`)),t)switch(n){case`ES256`:t=e.crv===`P-256`;break;case`ES256K`:t=e.crv===`secp256k1`;break;case`ES384`:t=e.crv===`P-384`;break;case`ES512`:t=e.crv===`P-521`;break;case`Ed25519`:t=e.crv===`Ed25519`;break;case`EdDSA`:t=e.crv===`Ed25519`||e.crv===`Ed448`;break}return t}),{0:o,length:s}=a;if(s===0)throw new U_;if(s!==1){let e=new W_,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(let e of a)try{yield await Nx(t,e,n)}catch{}},e}return Nx(this._cached,o,n)}}})),Lx,Rx=t((()=>{Y(),H(),Lx=async(e,t,n)=>{let r;switch(e.protocol){case`https:`:r=El.get;break;case`http:`:r=xl.get;break;default:throw TypeError(`Unsupported URL protocol.`)}let{agent:i,headers:a}=n,o=r(e.href,{agent:i,timeout:t,headers:a}),[s]=await Promise.race([Sl(o,`response`),Sl(o,`timeout`)]);if(!s)throw o.destroy(),new G_;if(s.statusCode!==200)throw new G(`Expected 200 OK from the JSON Web Key Set HTTP response`);let c=[];for await(let e of s)c.push(e);try{return JSON.parse(j_.decode(w_(...c)))}catch{throw new G(`Failed to parse the JSON Web Key Set HTTP response as JSON`)}}}));function zx(){return typeof WebSocketPair<`u`||typeof navigator<`u`&&navigator.userAgent===`Cloudflare-Workers`||typeof EdgeRuntime<`u`&&EdgeRuntime===`vercel`}function Bx(e,t){return!(typeof e!=`object`||!e||!(`uat`in e)||typeof e.uat!=`number`||Date.now()-e.uat>=t||!(`jwks`in e)||!Q(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,Q))}function Vx(e,t){let n=new Wx(e,t),r=async(e,t)=>n.getKey(e,t);return Object.defineProperties(r,{coolingDown:{get:()=>n.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>n.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>n.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>!!n._pendingFetch,enumerable:!0,configurable:!1},jwks:{value:()=>n._local?.jwks(),enumerable:!0,configurable:!1,writable:!1}}),r}var Hx,Ux,Wx,Gx,Kx=t((()=>{Rx(),Y(),Ix(),Nv(),(typeof navigator>`u`||!navigator.userAgent?.startsWith?.(`Mozilla/5.0 `))&&(Hx=`jose/v5.10.0`),Ux=Symbol(),Wx=class{_url;_timeoutDuration;_cooldownDuration;_cacheMaxAge;_jwksTimestamp;_pendingFetch;_options;_local;_cache;constructor(e,t){if(!(e instanceof URL))throw TypeError(`url must be an instance of URL`);this._url=new URL(e.href),this._options={agent:t?.agent,headers:t?.headers},this._timeoutDuration=typeof t?.timeoutDuration==`number`?t?.timeoutDuration:5e3,this._cooldownDuration=typeof t?.cooldownDuration==`number`?t?.cooldownDuration:3e4,this._cacheMaxAge=typeof t?.cacheMaxAge==`number`?t?.cacheMaxAge:6e5,t?.[Ux]!==void 0&&(this._cache=t?.[Ux],Bx(t?.[Ux],this._cacheMaxAge)&&(this._jwksTimestamp=this._cache.uat,this._local=Px(this._cache.jwks)))}coolingDown(){return typeof this._jwksTimestamp==`number`&&Date.now()<this._jwksTimestamp+this._cooldownDuration}fresh(){return typeof this._jwksTimestamp==`number`&&Date.now()<this._jwksTimestamp+this._cacheMaxAge}async getKey(e,t){(!this._local||!this.fresh())&&await this.reload();try{return await this._local(e,t)}catch(n){if(n instanceof U_&&this.coolingDown()===!1)return await this.reload(),this._local(e,t);throw n}}async reload(){this._pendingFetch&&zx()&&(this._pendingFetch=void 0);let e=new Headers(this._options.headers);Hx&&!e.has(`User-Agent`)&&(e.set(`User-Agent`,Hx),this._options.headers=Object.fromEntries(e.entries())),this._pendingFetch||=Lx(this._url,this._timeoutDuration,this._options).then(e=>{this._local=Px(e),this._cache&&(this._cache.uat=Date.now(),this._cache.jwks=e),this._jwksTimestamp=Date.now(),this._pendingFetch=void 0}).catch(e=>{throw this._pendingFetch=void 0,e}),await this._pendingFetch}},Gx=Ux})),qx,Jx=t((()=>{P_(),H(),Y(),nx(),vx(),qx=class extends _x{encode(){return`${U(JSON.stringify({alg:`none`}))}.${U(JSON.stringify(this._payload))}.`}static decode(e,t){if(typeof e!=`string`)throw new B_(`Unsecured JWT must be a string`);let{0:n,1:r,2:i,length:a}=e.split(`.`);if(a!==3||i!==``)throw new B_(`Invalid Unsecured JWT`);let o;try{if(o=JSON.parse(j_.decode(W(n))),o.alg!==`none`)throw Error()}catch{throw new B_(`Invalid Unsecured JWT`)}return{payload:tx(o,W(r),t),header:o}}}})),Yx=r({decode:()=>Zx,encode:()=>Xx}),Xx,Zx,Qx=t((()=>{P_(),Xx=U,Zx=W}));function $x(e){let t;if(typeof e==`string`){let n=e.split(`.`);(n.length===3||n.length===5)&&([t]=n)}else if(typeof e==`object`&&e)if(`protected`in e)t=e.protected;else throw TypeError(`Token does not contain a Protected Header`);try{if(typeof t!=`string`||!t)throw Error();let e=JSON.parse(j_.decode(Zx(t)));if(!Q(e))throw Error();return e}catch{throw TypeError(`Invalid Token or Protected Header formatting`)}}var eS=t((()=>{Qx(),H(),Nv()}));function tS(e){if(typeof e!=`string`)throw new B_(`JWTs must use Compact JWS serialization, JWT must be a string`);let{1:t,length:n}=e.split(`.`);if(n===5)throw new B_(`Only JWTs using Compact JWS serialization can be decoded`);if(n!==3)throw new B_(`Invalid JWT`);if(!t)throw new B_(`JWTs must contain a payload`);let r;try{r=Zx(t)}catch{throw new B_(`Failed to base64url decode the payload`)}let i;try{i=JSON.parse(j_.decode(r))}catch{throw new B_(`Failed to parse the decoded payload as JSON`)}if(!Q(i))throw new B_(`Invalid JWT Claims Set`);return i}var nS=t((()=>{Qx(),H(),Nv(),Y()}));async function rS(e,t){let n;switch(e){case`HS256`:case`HS384`:case`HS512`:case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:n=parseInt(e.slice(-3),10);break;case`A128KW`:case`A192KW`:case`A256KW`:case`A128GCMKW`:case`A192GCMKW`:case`A256GCMKW`:case`A128GCM`:case`A192GCM`:case`A256GCM`:n=parseInt(e.slice(1,4),10);break;default:throw new K(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}return al(fl(new Uint8Array(n>>3)))}async function iS(e,t){switch(e){case`RS256`:case`RS384`:case`RS512`:case`PS256`:case`PS384`:case`PS512`:case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:case`RSA1_5`:{let e=t?.modulusLength??2048;if(typeof e!=`number`||e<2048)throw new K(`Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used`);return await aS(`rsa`,{modulusLength:e,publicExponent:65537})}case`ES256`:return aS(`ec`,{namedCurve:`P-256`});case`ES256K`:return aS(`ec`,{namedCurve:`secp256k1`});case`ES384`:return aS(`ec`,{namedCurve:`P-384`});case`ES512`:return aS(`ec`,{namedCurve:`P-521`});case`Ed25519`:return aS(`ed25519`);case`EdDSA`:switch(t?.crv){case void 0:case`Ed25519`:return aS(`ed25519`);case`Ed448`:return aS(`ed448`);default:throw new K(`Invalid or unsupported crv option provided, supported values are Ed25519 and Ed448`)}case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:{let e=t?.crv??`P-256`;switch(e){case void 0:case`P-256`:case`P-384`:case`P-521`:return aS(`ec`,{namedCurve:e});case`X25519`:return aS(`x25519`);case`X448`:return aS(`x448`);default:throw new K(`Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448`)}}default:throw new K(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}}var aS,oS=t((()=>{q_(),Y(),aS=vl(sl)}));async function sS(e,t){return iS(e,t)}var cS=t((()=>{oS()}));async function lS(e,t){return rS(e,t)}var uS=t((()=>{oS()})),dS,fS=t((()=>{dS=`node:crypto`})),pS,mS=t((()=>{fS(),pS=dS})),hS=r({CompactEncrypt:()=>sx,CompactSign:()=>dx,EmbeddedJWK:()=>Dx,EncryptJWT:()=>xx,FlattenedEncrypt:()=>_b,FlattenedSign:()=>lx,GeneralEncrypt:()=>bb,GeneralSign:()=>mx,SignJWT:()=>yx,UnsecuredJWT:()=>qx,base64url:()=>Yx,calculateJwkThumbprint:()=>Cx,calculateJwkThumbprintUri:()=>wx,compactDecrypt:()=>rb,compactVerify:()=>zb,createLocalJWKSet:()=>Px,createRemoteJWKSet:()=>Vx,cryptoRuntime:()=>pS,decodeJwt:()=>tS,decodeProtectedHeader:()=>$x,errors:()=>F_,experimental_jwksCache:()=>Gx,exportJWK:()=>pb,exportPKCS8:()=>fb,exportSPKI:()=>db,flattenedDecrypt:()=>tb,flattenedVerify:()=>Lb,generalDecrypt:()=>ab,generalVerify:()=>Vb,generateKeyPair:()=>sS,generateSecret:()=>lS,importJWK:()=>My,importPKCS8:()=>jy,importSPKI:()=>ky,importX509:()=>Ay,jwksCache:()=>Ux,jwtDecrypt:()=>ax,jwtVerify:()=>rx}),gS=t((()=>{ib(),nb(),ob(),xb(),Bb(),Rb(),Hb(),ix(),ox(),cx(),vb(),fx(),ux(),hx(),bx(),Sx(),Ex(),Ox(),Ix(),Kx(),Jx(),mb(),Ny(),eS(),nS(),Y(),cS(),uS(),Qx(),mS()})),_S=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{verifyVercelOidcToken:()=>h}),t.exports=c(l);var u=(gS(),c(hS));let d=`https://oidc.vercel.com`,f=new URL(`https://oidc.vercel.com/.well-known/jwks`),p=[`RS256`],m=(0,u.createRemoteJWKSet)(f);async function h(e,t){let{algorithms:n,projectId:r=process.env.VERCEL_PROJECT_ID,environment:i=process.env.VERCEL_TARGET_ENV||process.env.VERCEL_ENV,ownerId:a,...o}=t??{};if(r===`*`&&a===void 0&&!g(o.audience))throw TypeError(`Expected ownerId or audience to be provided when projectId is '*'.`);let s=await(0,u.jwtVerify)(e,m,{...o,algorithms:n??p});return _(s.payload.iss),v({actual:s.payload.project_id,claim:`project_id`,env:`VERCEL_PROJECT_ID`,expected:r,option:`projectId`}),v({actual:s.payload.environment,claim:`environment`,env:`VERCEL_TARGET_ENV or VERCEL_ENV`,expected:i,option:`environment`}),y({actual:s.payload.owner_id,claim:`owner_id`,expected:a}),s}function g(e){return Array.isArray(e)?e.length>0:e!==void 0}function _(e){if(e!==d&&(typeof e!=`string`||!e.startsWith(`${d}/`)))throw TypeError(`Expected Vercel OIDC token iss claim to be "${d}" or to start with "${d}/".`)}function v({actual:e,claim:t,env:n,expected:r,option:i}){if(r!==`*`){if(r===void 0||r.length===0)throw TypeError(`Expected ${n} to be set or ${i} to be provided. Pass ${i}: '*' to allow any ${t} claim.`);if(!(Array.isArray(r)&&typeof e==`string`&&r.includes(e))&&e!==r)throw TypeError(Array.isArray(r)?`Expected Vercel OIDC token ${t} claim to be one of: ${r.map(e=>`"${e}"`).join(`, `)}.`:`Expected Vercel OIDC token ${t} claim to be "${r}".`)}}function y({actual:e,claim:t,expected:n}){if(n!==void 0&&e!==n)throw TypeError(`Expected Vercel OIDC token ${t} claim to be "${n}".`)}0&&(t.exports={verifyVercelOidcToken:h})})),vS=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{AccessTokenMissingError:()=>m.AccessTokenMissingError,RefreshAccessTokenFailedError:()=>m.RefreshAccessTokenFailedError,exchangeVercelOidcToken:()=>h.exchangeVercelOidcToken,getContext:()=>f.getContext,getVercelOidcToken:()=>u.getVercelOidcToken,getVercelOidcTokenSync:()=>d.getVercelOidcTokenSync,getVercelToken:()=>g.getVercelToken,verifyVercelOidcToken:()=>p.verifyVercelOidcToken}),t.exports=c(l);var u=x_(),d=b_(),f=y_(),p=_S(),m=Kc(),h=v_(),g=qc();0&&(t.exports={AccessTokenMissingError,RefreshAccessTokenFailedError,exchangeVercelOidcToken,getContext,getVercelOidcToken,getVercelOidcTokenSync,getVercelToken,verifyVercelOidcToken})})),yS=n(g_(),1),bS=vS();async function xS(e){let t=0,n=e.getReader(),r=[];try{for(;;){let{done:e,value:i}=await n.read();if(e)break;r.push(i),t+=i.length}}finally{n.releaseLock()}return Buffer.concat(r,t)}var SS=class{contentType=`application/json`;replacer;reviver;constructor(e={}){this.replacer=e.replacer,this.reviver=e.reviver}serialize(e){return Buffer.from(JSON.stringify(e,this.replacer),`utf8`)}async deserialize(e){let t=await xS(e);return JSON.parse(t.toString(`utf8`),this.reviver)}},CS=class extends Error{constructor(e){super(`Message ${e} not found`),this.name=`MessageNotFoundError`}},wS=class extends Error{constructor(e,t){super(`Message ${e} not available for processing${t?`: ${t}`:``}`),this.name=`MessageNotAvailableError`}},TS=class extends Error{constructor(e,t){super(`Message ${e} is corrupted: ${t}`),this.name=`MessageCorruptedError`}},ES=class extends Error{retryAfter;constructor(e=`Too many requests`,t){super(e),this.name=`TooManyRequestsError`,this.retryAfter=t}},DS=class extends Error{constructor(e=`Missing or invalid authentication token`){super(e),this.name=`UnauthorizedError`}},OS=class extends Error{constructor(e=`Queue environment doesn't match token environment`){super(e),this.name=`ForbiddenError`}},kS=class extends Error{constructor(e){super(e),this.name=`BadRequestError`}},AS=class extends Error{constructor(e=`Unexpected server error`){super(e),this.name=`InternalServerError`}},jS=class extends Error{constructor(e,t=1,n=10){super(`Invalid limit: ${e}. Limit must be between ${t} and ${n}.`),this.name=`InvalidLimitError`}},MS=class extends Error{constructor(e){super(`Message ${e} has already been processed`),this.name=`MessageAlreadyProcessedError`}},NS=class extends Error{idempotencyKey;constructor(e,t){super(e),this.name=`DuplicateMessageError`,this.idempotencyKey=t}},PS=class extends Error{deploymentId;constructor(e,t){super(e),this.name=`ConsumerDiscoveryError`,this.deploymentId=t}},FS=class extends Error{constructor(e=`Consumer registry not configured`){super(e),this.name=`ConsumerRegistryNotConfiguredError`}},IS=300,LS=30,RS=60,zS=10,BS=3e3,VS=3,HS=250;function US(e){return Math.min(RS,Math.max(zS,e/5))}var WS=class{client;topicName;consumerGroupName;visibilityTimeout;constructor(e,t,n,r={}){this.client=e,this.topicName=t,this.consumerGroupName=n,this.visibilityTimeout=Math.max(LS,r.visibilityTimeoutSeconds??IS)}isClientError(e){return e instanceof wS||e instanceof CS||e instanceof kS||e instanceof DS||e instanceof OS}isNetworkError(e){return e instanceof TypeError}async directiveCallWithRetries(e){let t;for(let n=1;n<=VS;n++)try{return await e()}catch(e){if(t=e,n===VS)throw e;if(e instanceof ES){if(e.retryAfter===void 0)throw e;await new Promise(t=>setTimeout(t,e.retryAfter*1e3));continue}if(!this.isNetworkError(e))throw e;let r=HS*n,i=r/2+r/2*Math.random();await new Promise(e=>setTimeout(e,i))}throw t}startVisibilityExtension(e,t){let n=!0,r=!1,i,a=null,o=US(this.visibilityTimeout)*1e3,s=o;if(t?.visibilityDeadline){let e=t.visibilityDeadline.getTime()-Date.now();s=e>0?US(e/1e3)*1e3:0}let c=new Promise(e=>{i=e}),l=()=>{r||(r=!0,i())},u=async()=>{if(!n){l();return}try{await this.client.changeVisibility({queueName:this.topicName,consumerGroup:this.consumerGroupName,receiptHandle:e,visibilityTimeoutSeconds:this.visibilityTimeout}),n?a=setTimeout(()=>u(),o):l()}catch(t){if(this.isClientError(t)){console.error(`Visibility extension failed with client error for receipt handle ${e} (stopping retries):`,t),l();return}console.error(`Failed to extend visibility for receipt handle ${e} (will retry in ${BS/1e3}s):`,t),n?a=setTimeout(()=>u(),BS):l()}};return a=setTimeout(()=>u(),s),async(e=!1)=>{n=!1,a&&=(clearTimeout(a),null),e?await c:l()}}async finalizePayload(e){let t=this.client.getTransport();if(t.finalize&&e!=null)try{await t.finalize(e)}catch(e){console.warn(`Failed to finalize message payload:`,e)}}async processMessage(e,t,n){let r=this.startVisibilityExtension(e.receiptHandle,n),i={messageId:e.messageId,deliveryCount:e.deliveryCount,createdAt:e.createdAt,expiresAt:e.expiresAt??new Date(e.createdAt.getTime()+864e5),topicName:this.topicName,consumerGroup:this.consumerGroupName,region:this.client.getRegion()};try{await t(e.payload,i),await r(),await this.client.acknowledgeMessage({queueName:this.topicName,consumerGroup:this.consumerGroupName,receiptHandle:e.receiptHandle})}catch(t){if(await r(),n?.retry){let r;try{r=n.retry(t,i)}catch(e){console.warn(`retry handler threw:`,e)}if(r){if(`acknowledge`in r&&r.acknowledge){try{await this.directiveCallWithRetries(()=>this.client.acknowledgeMessage({queueName:this.topicName,consumerGroup:this.consumerGroupName,receiptHandle:e.receiptHandle}))}catch(e){console.warn(`Failed to acknowledge message:`,e)}await this.finalizePayload(e.payload);return}if(`afterSeconds`in r&&typeof r.afterSeconds==`number`){try{await this.directiveCallWithRetries(()=>this.client.changeVisibility({queueName:this.topicName,consumerGroup:this.consumerGroupName,receiptHandle:e.receiptHandle,visibilityTimeoutSeconds:r.afterSeconds}))}catch(e){console.warn(`Failed to reschedule message for retry:`,e)}await this.finalizePayload(e.payload);return}}}throw await this.finalizePayload(e.payload),t}}async consumeMessage(e,t,n){await this.processMessage(t,e,n)}async consume(e,t){let n=t?.retry;if(t&&`messageId`in t){let r=await this.client.receiveMessageById({queueName:this.topicName,consumerGroup:this.consumerGroupName,messageId:t.messageId,visibilityTimeoutSeconds:this.visibilityTimeout});return await this.processMessage(r.message,e,{retry:n}),1}else{let r=t&&`limit`in t?t.limit:1,i=0;for await(let t of this.client.receiveMessages({queueName:this.topicName,consumerGroup:this.consumerGroupName,visibilityTimeoutSeconds:this.visibilityTimeout,limit:r}))i++,await this.processMessage(t,e,{retry:n});return i}}get name(){return this.consumerGroupName}get topic(){return this.topicName}},GS=class{client;topicName;constructor(e,t){this.client=e,this.topicName=t}async publish(e,t){let n=await this.client.sendMessage({queueName:this.topicName,payload:e,idempotencyKey:t?.idempotencyKey,retentionSeconds:t?.retentionSeconds,delaySeconds:t?.delaySeconds,headers:t?.headers,telemetry:t?.telemetry});return n.messageId&&aC()&&GC(this.topicName,n.messageId,this.client.getRegion(),t?.delaySeconds,t?.retentionSeconds),{messageId:n.messageId}}consumerGroup(e,t){return new WS(this.client,this.topicName,e,t)}get name(){return this.topicName}},KS=`com.vercel.queue.v1beta`,qS=`com.vercel.queue.v2beta`;function JS(e,t){let n=t.slice(0,-1);return e.startsWith(n)}function YS(e){return typeof e==`object`&&!!e}function XS(e,t){if(!t||!t.includes(`application/cloudevents+json`))throw Error(`Invalid content type: expected 'application/cloudevents+json'`);if(!YS(e)||!e.type||!e.source||!e.id||!YS(e.data))throw Error(`Invalid CloudEvent: missing required fields`);if(e.type!==`com.vercel.queue.v1beta`)throw Error(`Invalid CloudEvent type: expected '${KS}', got '${String(e.type)}'`);let{data:n}=e,r=[];if(`queueName`in n||r.push(`queueName`),`consumerGroup`in n||r.push(`consumerGroup`),`messageId`in n||r.push(`messageId`),r.length>0)throw Error(`Missing required CloudEvent data fields: ${r.join(`, `)}`);return{queueName:String(n.queueName),consumerGroup:String(n.consumerGroup),messageId:String(n.messageId)}}function ZS(e,t){if(e instanceof Headers)return e.get(t);let n=e[t];return Array.isArray(n)?n[0]??null:n??null}function QS(e){let t=ZS(e,`ce-type`);if(t!==`com.vercel.queue.v2beta`)throw Error(`Invalid CloudEvent type: expected '${qS}', got '${t}'`);let n=ZS(e,`ce-vqsqueuename`),r=ZS(e,`ce-vqsconsumergroup`),i=ZS(e,`ce-vqsmessageid`),a=[];if(n||a.push(`ce-vqsqueuename`),r||a.push(`ce-vqsconsumergroup`),i||a.push(`ce-vqsmessageid`),a.length>0)throw Error(`Missing required CloudEvent headers: ${a.join(`, `)}`);let o=ZS(e,`ce-vqsregion`)??void 0;if(o!==void 0&&!/^[a-z]{2,5}[0-9]{1,2}$/.test(o))throw Error(`Invalid ce-vqsregion header: ${JSON.stringify(o)}. Region must match /^[a-z]{2,5}[0-9]{1,2}$/ (e.g. "iad1", "lhr1").`);let s={queueName:n,consumerGroup:r,messageId:i,region:o},c=ZS(e,`ce-vqsreceipthandle`);if(!c)return s;let l={...s,receiptHandle:c},u=ZS(e,`ce-vqsdeliverycount`);u&&(l.deliveryCount=parseInt(u,10));let d=ZS(e,`ce-vqscreatedat`);d&&(l.createdAt=d);let f=ZS(e,`ce-vqsexpiresat`);f&&(l.expiresAt=f);let p=ZS(e,`content-type`);p&&(l.contentType=p);let m=ZS(e,`ce-vqsvisibilitydeadline`);return m&&(l.visibilityDeadline=m),l}function $S(e,t){if(ZS(t,`ce-type`)===`com.vercel.queue.v2beta`){let n=QS(t);return`receiptHandle`in n&&(n.parsedPayload=e),n}return XS(e,ZS(t,`content-type`))}async function eC(e){if(e.headers.get(`ce-type`)===`com.vercel.queue.v2beta`){let t=QS(e.headers);return`receiptHandle`in t&&e.body&&(t.rawBody=e.body),t}let t;try{t=await e.json()}catch{throw Error(`Failed to parse CloudEvent from request body`)}let n={};return e.headers.forEach((e,t)=>{n[t]=e}),$S(t,n)}async function tC(e,t,n){let{queueName:r,consumerGroup:i,messageId:a}=t;if(!n?.client)throw Error(`HandleCallbackOptions.client is required`);let o=ww(n.client);t.region&&(o=o.withRegion(t.region));let s=new GS(o,r).consumerGroup(i,n?.visibilityTimeoutSeconds===void 0?void 0:{visibilityTimeoutSeconds:n.visibilityTimeoutSeconds});if(`receiptHandle`in t){let r=o.getTransport(),i;if(t.rawBody)i=await r.deserialize(t.rawBody);else if(t.parsedPayload!==void 0)i=t.parsedPayload;else throw Error(`Binary mode callback with receipt handle is missing payload`);let c={messageId:a,payload:i,deliveryCount:t.deliveryCount??1,createdAt:t.createdAt?new Date(t.createdAt):new Date,expiresAt:t.expiresAt?new Date(t.expiresAt):void 0,contentType:t.contentType??r.contentType,receiptHandle:t.receiptHandle},l=t.visibilityDeadline?new Date(t.visibilityDeadline):void 0;await s.consumeMessage(e,c,{visibilityDeadline:l,retry:n?.retry})}else await s.consume(e,{messageId:a,retry:n?.retry})}var $=yS.default.cyan(`[queue]`),nC=yS.default.green(`✓`),rC=yS.default.red(`✗`),iC=yS.default.yellow(`↻`);function aC(){return process.env.NODE_ENV===`development`&&process.env.VERCEL_DEPLOYMENT_ID===void 0}var oC=Symbol.for(`@vercel/queue.devRouteMappings`);function sC(e){let t=``;for(let n of e)n===`_`?t+=`__`:n===`/`?t+=`_S`:n===`.`?t+=`_D`:/[A-Za-z0-9-]/.test(n)?t+=n:t+=`_`+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`);return t}function cC(){let e=globalThis;if(oC in e)return e[oC]??null;try{let t=Yc.join(process.cwd(),`vercel.json`);if(!wl.existsSync(t))return e[oC]=null,null;let n=JSON.parse(wl.readFileSync(t,`utf-8`));if(!n.functions)return e[oC]=null,null;let r=[];for(let[e,t]of Object.entries(n.functions))if(t.experimentalTriggers){for(let n of t.experimentalTriggers)if(!(!n.type?.startsWith(`queue/`)||!n.topic)){if(n.type!==`queue/v2beta`){console.warn(`${$} Unsupported trigger type "${n.type}" for topic "${n.topic}" in ${e}. Use "queue/v2beta" instead.`);continue}r.push({filePath:e,topic:n.topic,consumer:sC(e),retryAfterSeconds:n.retryAfterSeconds})}}return e[oC]=r.length>0?r:null,e[oC]}catch(t){return console.warn(`${$} Failed to read vercel.json:`,t),e[oC]=null,null}}function lC(e){let t=cC();return t?t.filter(t=>t.topic.includes(`*`)?JS(e,t.topic):t.topic===e):[]}function uC(e,t){return lC(e).find(e=>e.consumer===t)?.retryAfterSeconds}function dC(e){return/^src\/(app|pages|server)\//.test(e)?e.slice(4):null}function fC(e,t){return e===t||z(e,t)}function pC(e){let t=cC();if(!t)return[];let n=process.cwd(),r;try{r=Yc.relative(n,e)}catch{return[]}let i=r.replace(/\\/g,`/`),a=dC(i);return t.filter(e=>fC(i,e.filePath)||a!==null&&fC(a,e.filePath))}function mC(e){let t=e.match(/\((.+?):\d+:\d+\)/);if(t||=e.match(/at\s+(.+?):\d+:\d+/),!t)return null;let n=t[1].trim();if(n===`native`||n.startsWith(`node:`)||n.startsWith(`internal`))return null;if(n.startsWith(`file://`))try{n=new URL(n).pathname}catch{return null}return/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(n)?null:(n.startsWith(`./`)&&(n=n.slice(2)),n)}var hC;function gC(){if(hC)return hC;try{let e=typeof __dirname<`u`?__dirname:Yc.dirname(new URL(import.meta.url).pathname);hC=Yc.resolve(e,`..`)}catch{hC=``}return hC}function _C(){let e=Error().stack;if(!e)return null;let t=e.split(`
13
+ `).slice(1),n=gC();for(let e of t){let t=mC(e);if(!t)continue;let r=Yc.isAbsolute(t)?t:Yc.resolve(process.cwd(),t),i;try{i=wl.realpathSync(r)}catch{i=r}if(!(n&&i.startsWith(n)))return i}return null}var vC=Symbol.for(`@vercel/queue.devHandlerRegistry`);function yC(){let e=globalThis;return e[vC]||(e[vC]=new Map),e[vC]}function bC(e,t,n,r){let i=pC(Yc.isAbsolute(e)?e:Yc.resolve(process.cwd(),e));if(i.length===0)return!1;let a=yC();for(let e of i){let i=e.topic,o=a.get(i)??[],s={consumerGroup:e.consumer,handler:t,client:n,options:r},c=o.findIndex(t=>t.consumerGroup===e.consumer);c>=0?o[c]=s:o.push(s),a.set(i,o)}return!0}function xC(e,t,n,r){let i=r??_C();if(!i){console.warn(`${$} Could not determine caller file path for handler registration.`);return}if(!bC(i,e,t,n)){let e=cC();if(e&&e.length>0)return;let t=process.cwd(),n;try{n=Yc.relative(t,i).replace(/\\/g,`/`)}catch{n=i}console.warn(`${$} handleCallback() in ${n} has no matching experimentalTriggers in vercel.json. This handler won't receive messages.
14
14
 
15
15
  Add a trigger to vercel.json:
16
16
  "${n}": {
17
17
  "experimentalTriggers": [{ "type": "queue/v2beta", "topic": "your-topic" }]
18
- }`)}}function gC(e){let t=pC(),n=[];for(let[r,i]of t)(r.includes(`*`)?HS(e,r):r===e)&&n.push(...i);return n}var _C=50,vC=5e3,yC=2,bC=250,xC=[`PORT`,`NEXT_PORT`,`NEXTJS_PORT`,`NUXT_PORT`,`NITRO_PORT`,`SVELTEKIT_PORT`,`VITE_PORT`,`DEV_PORT`,`npm_config_port`],SC=[`__NEXT_PRIVATE_ORIGIN`,`NUXT_PUBLIC_SITE_URL`,`URL`];function CC(e){return e instanceof Error?e.message:String(e)}function wC(e){return e instanceof _S||e instanceof Error&&e.name===`MessageNotFoundError`}function TC(e){if(!e)return null;let t=Number.parseInt(e,10);return!Number.isFinite(t)||t<1||t>65535?null:t}function EC(e){if(!e)return null;try{let t=new URL(e).port;return TC(t)}catch{return null}}function DC(){let e=[],t=new Set,n=n=>{n&&!t.has(n)&&(t.add(n),e.push(n))};for(let e of xC)n(TC(process.env[e]));for(let e of SC)n(EC(process.env[e]));return e}function OC(e){return new Promise(t=>{let n=Nl.connect({host:`localhost`,port:e}),r=!1,i=e=>{r||(r=!0,n.destroy(),t(e))};n.once(`connect`,()=>i(!0)),n.once(`error`,()=>i(!1)),n.setTimeout(bC,()=>i(!1))})}async function kC(e,t,n){let r=0,i=_C;for(;;)try{await YS(e,t,n);return}catch(e){if(wC(e)&&r<vC){await new Promise(e=>setTimeout(e,i)),r+=i,i=Math.min(i*yC,vC-r);continue}throw e}}function AC(e){let t=e.replace(/^src\/app\//,`/`).replace(/^src\/pages\//,`/`).replace(/^src\/server\//,`/`).replace(/^src\/routes\//,`/`).replace(/^app\//,`/`).replace(/^pages\//,`/`).replace(/^server\//,`/`).replace(/\/route\.(ts|mts|js|mjs|tsx|jsx)$/,``).replace(/\/\+server\.(ts|mts|js|mjs|tsx|jsx)$/,``).replace(/\.(ts|mts|js|mjs|tsx|jsx)$/,``);return t.startsWith(`/`)||(t=`/`+t),t}async function jC(e,t={}){let n={triedPorts:DC(),listeningPorts:[],unavailablePorts:[],importFailures:[],primeFailures:[]},r=rC(e);if(r.length===0)return n;let i=t.refreshRegistered===!0;for(let e of n.triedPorts)await OC(e)?n.listeningPorts.push(e):n.unavailablePorts.push(e);for(let t of r){let r=NC(e,t.consumer);if(!(r&&!i)){if(!r){let r=rl.resolve(process.cwd(),t.filePath);try{await import(r)}catch(e){n.importFailures.push({filePath:t.filePath,reason:CC(e)})}if(NC(e,t.consumer))continue}for(let r of n.listeningPorts){let i=`http://localhost:${r}${AC(t.filePath)}`;try{let r=await fetch(i,{method:`POST`,headers:{"x-vercel-queue-prime":`1`,"x-vercel-queue-prime-file":t.filePath}});try{await r.text()}catch{}if(NC(e,t.consumer))break;n.primeFailures.push({filePath:t.filePath,url:i,reason:`HTTP ${r.status}${r.statusText?` ${r.statusText}`:``}`.trim()})}catch(e){n.primeFailures.push({filePath:t.filePath,url:i,reason:CC(e)})}}}}return n}function MC(e,t,n){let r=t.map(e=>e.filePath),i=n.listeningPorts[0]??n.triedPorts[0],a=i?t.map(e=>`http://localhost:${i}${AC(e.filePath)}`):[],o;if(n.triedPorts.length===0)o=`No local dev port detected from env. Set PORT (or NEXT_PORT/NUXT_PORT/VITE_PORT).`;else if(n.listeningPorts.length===0)o=`Detected env ports: [${n.triedPorts.join(`, `)}], but none are listening.`;else{let e=n.unavailablePorts.length>0?` Not listening: [${n.unavailablePorts.join(`, `)}].`:``;o=`Detected env ports: [${n.triedPorts.join(`, `)}]. Listening: [${n.listeningPorts.join(`, `)}].`+e}let s=n.importFailures.length>0?`
18
+ }`)}}function SC(e){let t=yC(),n=[];for(let[r,i]of t)(r.includes(`*`)?JS(e,r):r===e)&&n.push(...i);return n}var CC=50,wC=5e3,TC=2,EC=250,DC=[`PORT`,`NEXT_PORT`,`NEXTJS_PORT`,`NUXT_PORT`,`NITRO_PORT`,`SVELTEKIT_PORT`,`VITE_PORT`,`DEV_PORT`,`npm_config_port`],OC=[`__NEXT_PRIVATE_ORIGIN`,`NUXT_PUBLIC_SITE_URL`,`URL`];function kC(e){return e instanceof Error?e.message:String(e)}function AC(e){return e instanceof CS||e instanceof Error&&e.name===`MessageNotFoundError`}function jC(e){if(!e)return null;let t=Number.parseInt(e,10);return!Number.isFinite(t)||t<1||t>65535?null:t}function MC(e){if(!e)return null;try{let t=new URL(e).port;return jC(t)}catch{return null}}function NC(){let e=[],t=new Set,n=n=>{n&&!t.has(n)&&(t.add(n),e.push(n))};for(let e of DC)n(jC(process.env[e]));for(let e of OC)n(MC(process.env[e]));return e}function PC(e){return new Promise(t=>{let n=Tl.connect({host:`localhost`,port:e}),r=!1,i=e=>{r||(r=!0,n.destroy(),t(e))};n.once(`connect`,()=>i(!0)),n.once(`error`,()=>i(!1)),n.setTimeout(EC,()=>i(!1))})}async function FC(e,t,n){let r=0,i=CC;for(;;)try{await tC(e,t,n);return}catch(e){if(AC(e)&&r<wC){await new Promise(e=>setTimeout(e,i)),r+=i,i=Math.min(i*TC,wC-r);continue}throw e}}function IC(e){let t=e.replace(/^src\/app\//,`/`).replace(/^src\/pages\//,`/`).replace(/^src\/server\//,`/`).replace(/^src\/routes\//,`/`).replace(/^app\//,`/`).replace(/^pages\//,`/`).replace(/^server\//,`/`).replace(/\/route\.(ts|mts|js|mjs|tsx|jsx)$/,``).replace(/\/\+server\.(ts|mts|js|mjs|tsx|jsx)$/,``).replace(/\.(ts|mts|js|mjs|tsx|jsx)$/,``);return t.startsWith(`/`)||(t=`/`+t),t}async function LC(e,t={}){let n={triedPorts:NC(),listeningPorts:[],unavailablePorts:[],importFailures:[],primeFailures:[]},r=lC(e);if(r.length===0)return n;let i=t.refreshRegistered===!0;for(let e of n.triedPorts)await PC(e)?n.listeningPorts.push(e):n.unavailablePorts.push(e);for(let t of r){let r=zC(e,t.consumer);if(!(r&&!i)){if(!r){let r=Yc.resolve(process.cwd(),t.filePath);try{await import(r)}catch(e){n.importFailures.push({filePath:t.filePath,reason:kC(e)})}if(zC(e,t.consumer))continue}for(let r of n.listeningPorts){let i=`http://localhost:${r}${IC(t.filePath)}`;try{let r=await fetch(i,{method:`POST`,headers:{"x-vercel-queue-prime":`1`,"x-vercel-queue-prime-file":t.filePath}});try{await r.text()}catch{}if(zC(e,t.consumer))break;n.primeFailures.push({filePath:t.filePath,url:i,reason:`HTTP ${r.status}${r.statusText?` ${r.statusText}`:``}`.trim()})}catch(e){n.primeFailures.push({filePath:t.filePath,url:i,reason:kC(e)})}}}}return n}function RC(e,t,n){let r=t.map(e=>e.filePath),i=n.listeningPorts[0]??n.triedPorts[0],a=i?t.map(e=>`http://localhost:${i}${IC(e.filePath)}`):[],o;if(n.triedPorts.length===0)o=`No local dev port detected from env. Set PORT (or NEXT_PORT/NUXT_PORT/VITE_PORT).`;else if(n.listeningPorts.length===0)o=`Detected env ports: [${n.triedPorts.join(`, `)}], but none are listening.`;else{let e=n.unavailablePorts.length>0?` Not listening: [${n.unavailablePorts.join(`, `)}].`:``;o=`Detected env ports: [${n.triedPorts.join(`, `)}]. Listening: [${n.listeningPorts.join(`, `)}].`+e}let s=n.importFailures.length>0?`
19
19
  Import failures: `+n.importFailures.slice(0,2).map(e=>`${e.filePath} (${e.reason})`).join(`; `):``,c=n.primeFailures.length>0?`
20
20
  Prime failures: `+n.primeFailures.slice(0,3).map(e=>`${e.url} (${e.reason})`).join(`; `):``;return`${$} No registered handler for topic "${e}". vercel.json maps this topic to [${r.join(`, `)}] but auto-loading failed.
21
21
  ${o}${s}${c}
22
22
  Ensure your dev server is running, set PORT if needed, and confirm mapped route files call handleCallback()/handleNodeCallback() at module scope.
23
- `+(a.length>0?`Try opening: ${a.join(` or `)}`:`Set PORT (or NEXT_PORT/NUXT_PORT/VITE_PORT) and try sending again.`)}function NC(e,t){return gC(e).some(e=>e.consumerGroup===t)}var PC=10,FC=2,IC=10,LC=86400;function RC(e,t){let n=Math.min(Math.max(t,0),PC);console.log(`${$} ${QS} Scheduling re-delivery in ${n}s: topic="${e.topicName}" consumer="${e.consumerGroup}" messageId="${e.messageId}"`),setTimeout(async()=>{let t=e.deliveryCount+1,n=new Date(e.createdAt.getTime()+e.retentionSeconds*1e3);if(Date.now()>=n.getTime()){console.log(`${$} Message expired, stopping retries: topic="${e.topicName}" messageId="${e.messageId}"`);return}if(t>IC){console.log(`${$} Max re-deliveries (${IC}) reached: topic="${e.topicName}" messageId="${e.messageId}"`);return}let r={messageId:e.messageId,deliveryCount:t,createdAt:e.createdAt,expiresAt:n,topicName:e.topicName,consumerGroup:e.consumerGroup,region:e.region};console.log(`${$} Re-delivering: topic="${e.topicName}" consumer="${e.consumerGroup}" messageId="${e.messageId}" deliveryCount=${t}`);let i=!0,a=null,o=!1;try{await e.handler(e.payload,r)}catch(t){if(i=!1,e.retry){let n;try{n=e.retry(t,r)}catch(e){console.warn(`${$} retry handler threw:`,e)}n&&`afterSeconds`in n?a=n.afterSeconds:n&&`acknowledge`in n&&(o=!0)}o||console.error(`${$} ${ZS} Handler error on re-delivery: topic="${e.topicName}" messageId="${e.messageId}"`,t)}if(i)console.log(`${$} ${XS} Message processed on re-delivery: topic="${e.topicName}" consumer="${e.consumerGroup}" messageId="${e.messageId}"`);else if(o)console.log(`${$} ${XS} Message acknowledged (will not retry): topic="${e.topicName}" consumer="${e.consumerGroup}" messageId="${e.messageId}"`);else{let n=a??e.defaultRetryDelayS;RC({...e,deliveryCount:t},n)}},n*1e3)}function zC(e,t,n,r,i){if(r&&r>0){console.log(`${$} Message sent with delay: topic="${e}" messageId="${t}" delay=${r}s`),setTimeout(()=>{zC(e,t,n,void 0,i)},r*1e3);return}console.log(`${$} Message sent: topic="${e}" messageId="${t}"`),(async()=>{let r=gC(e),a=null;if(r.length>0?(await jC(e,{refreshRegistered:!0}),r=gC(e)):(a=await jC(e),r=gC(e)),r.length===0){let t=rC(e);if(t.length>0){let n=a??{triedPorts:DC(),listeningPorts:[],unavailablePorts:[],importFailures:[],primeFailures:[]};console.warn(MC(e,t,n))}else console.warn(`${$} No registered handler for topic "${e}".
24
- Ensure vercel.json has a matching experimentalTriggers entry and the route file calls handleCallback().`);return}let o=r.map(e=>e.consumerGroup);console.log(`${$} Invoking handlers for topic="${e}" messageId="${t}" \u2192 consumers: [${o.join(`, `)}]`);let s=i??LC;for(let i of r){let r,a=new Date,o=1,c=!0,l=null,u=!1,d=async(e,t)=>{r=e,a=t.createdAt,o=t.deliveryCount;try{await i.handler(e,t)}catch(e){throw c=!1,e}},f=i.options?.retry?(e,t)=>{let n=i.options.retry(e,t);return n&&`afterSeconds`in n?l=n.afterSeconds:n&&`acknowledge`in n&&(u=!0),n}:void 0,p={queueName:e,consumerGroup:i.consumerGroup,messageId:t,region:n},m={client:i.client,visibilityTimeoutSeconds:i.options?.visibilityTimeoutSeconds,retry:f},h=Math.min(iC(e,i.consumerGroup)??FC,PC),g=()=>({handler:i.handler,retry:i.options?.retry,payload:r,topicName:e,consumerGroup:i.consumerGroup,messageId:t,region:n,createdAt:a,retentionSeconds:s,deliveryCount:o,defaultRetryDelayS:h});try{if(await kC(d,p,m),c)console.log(`${$} ${XS} Message processed: topic="${e}" consumer="${i.consumerGroup}" messageId="${t}"`);else if(u)console.log(`${$} ${XS} Message acknowledged (will not retry): topic="${e}" consumer="${i.consumerGroup}" messageId="${t}"`);else if(l!==null){let e=Math.min(l,PC);RC(g(),e)}}catch(n){console.error(`${$} ${ZS} Handler failed: topic="${e}" consumer="${i.consumerGroup}" messageId="${t}"`,n),c||RC(g(),h)}}})()}function BC(){let e=globalThis;delete e[eC],delete e[fC]}(process.env.NODE_ENV===`test`||process.env.VITEST)&&(globalThis.__clearDevState=BC,globalThis.__filePathToConsumerGroup=tC,globalThis.__filePathToUrlPath=AC,globalThis.__matchesFunctionsPattern=oC,globalThis.__stripSrcPrefix=aC);function VC(e,t){let n={...e?.metadata,...t?.metadata};return{isEnabled:t?.isEnabled??e?.isEnabled??!0,tracer:e?.tracer,metadata:Object.keys(n).length>0?n:void 0}}var HC;function UC(){return HC||=import(`../../_chunks/workflow/src-Cj3P1ChQ.js`).then(e=>n(e.t(),1)).then(e=>e,()=>null),HC}function WC(){let e=process.env.VERCEL_QUEUE_TRACE_PROPAGATION?.toLowerCase();return e===`off`||e===`0`||e===`false`}var GC=[`traceparent`,`tracestate`,`baggage`];async function KC(e,t){if(WC()||t&&!t.isEnabled)return;let n=await UC();if(n)try{let t={};n.propagation.inject(n.context.active(),t);for(let n of GC){let r=t[n];r!==void 0&&e.set(n,r)}}catch{}}function qC(e,t,n){try{t.setStatus({code:e.SpanStatusCode.ERROR,message:n instanceof Error?n.message:String(n)})}catch{}}function JC(e){try{e.end()}catch{}}async function YC(e,t,n){if(WC()||n&&!n.isEnabled)return t(null);let r=await UC();if(!r)return t(null);let i=null;try{let t=n?.tracer??r.trace.getTracer(`@vercel/queue`),a={"messaging.system":`vercel-queue`,"messaging.destination.name":e};if(n?.metadata)for(let[e,t]of Object.entries(n.metadata))a[`vqs.metadata.${e}`]=t;let o=t.startSpan(`vqs.send`,{kind:r.SpanKind.PRODUCER,attributes:a});i={span:o,ctx:r.trace.setSpan(r.context.active(),o)}}catch{}if(!i)return t(null);let{span:a,ctx:o}=i;try{return await r.context.with(o,()=>t({setMessageId(e){try{a.setAttribute(`messaging.message.id`,e)}catch{}}}))}catch(e){throw qC(r,a,e),e}finally{JC(a)}}var XC=`x-vercel-queue-traceparent`,ZC=`x-vercel-queue-tracestate`,QC=`x-vercel-queue-baggage`;async function $C(e,t,n){if(WC()||n&&!n.isEnabled)return t();let r=await UC();if(!r)return t();let i=null;try{let t=ew(r,tw(e)),a=n?.tracer??r.trace.getTracer(`@vercel/queue`),o={"messaging.system":`vercel-queue`,"messaging.operation":`process`};if(n?.metadata)for(let[e,t]of Object.entries(n.metadata))o[`vqs.metadata.${e}`]=t;let s=a.startSpan(`vqs.process`,{kind:r.SpanKind.CONSUMER,attributes:o,links:t});i={span:s,ctx:r.trace.setSpan(r.context.active(),s)}}catch{}if(!i)return t();let{span:a,ctx:o}=i;try{return await r.context.with(o,t)}catch(e){throw qC(r,a,e),e}finally{JC(a)}}function ew(e,t){let n=t[XC];if(!n)return[];let r={traceparent:n},i=t[ZC];i&&(r.tracestate=i);let a=t[QC];a&&(r.baggage=a);let o=e.propagation.extract(e.ROOT_CONTEXT,r),s=e.trace.getSpanContext(o);return!s||!e.trace.isSpanContextValid(s)?[]:[{context:s}]}function tw(e){let t={};if(e instanceof Headers)return e.forEach((e,n)=>{t[n.toLowerCase()]=e}),t;for(let[n,r]of Object.entries(e)){let e=Array.isArray(r)?r[0]:r;e!==void 0&&(t[n.toLowerCase()]=e)}return t}function nw(){return process.env.VERCEL_QUEUE_DEBUG===`1`||process.env.VERCEL_QUEUE_DEBUG===`true`}async function rw(e){let t=e.getReader();try{for(;;){let{done:e}=await t.read();if(e)break}}finally{t.releaseLock()}}function iw(e){if(!e)return;let t=Number(e);if(Number.isFinite(t)&&t>=0)return t;let n=Date.parse(e);if(!Number.isNaN(n))return Math.max(0,(n-Date.now())/1e3)}function aw(e,t,n,r,i=`Invalid parameters`,a){throw e===400?new CS(n||i):e===429?new bS(n||`Too many requests: ${r}`,iw(a)):e===401?new xS(n||void 0):e===403?new SS(n||void 0):e>=500?new wS(n||`Server error: ${e} ${t}`):Error(`Failed to ${r}: ${e} ${t}`)}function ow(e){let t=e.get(`Vqs-Message-Id`),n=e.get(`Vqs-Delivery-Count`)||`0`,r=e.get(`Vqs-Timestamp`),i=e.get(`Content-Type`)||`application/octet-stream`,a=e.get(`Vqs-Receipt-Handle`),o=e.get(`Vqs-Expires-At`);if(!t||!r||!a)return null;let s=parseInt(n,10);return Number.isNaN(s)?null:{messageId:t,deliveryCount:s,createdAt:new Date(r),expiresAt:o?new Date(o):void 0,contentType:i,receiptHandle:a}}var sw=/^[a-z]{2,5}[0-9]{1,2}$/;function cw(e){if(!sw.test(e))throw Error(`Invalid region code: ${JSON.stringify(e)}. Region must match the pattern /^[a-z]{2,5}[0-9]{1,2}$/ (e.g. "iad1", "lhr1").`)}var lw=e=>new URL(`https://${e}.vercel-queue.com`);function uw(e,t){return(t??lw)(e)}var dw=`/api/v3/topic`,fw=class e{baseUrl;customHeaders;providedToken;resolvedDeploymentId;pinSends;explicitlyUnpinned;transport;region;baseUrlResolver;dispatcher;telemetry;constructor(e){cw(e.region),this.region=e.region,this.baseUrlResolver=e.resolveBaseUrl,this.baseUrl=uw(this.region,this.baseUrlResolver),this.customHeaders=e.headers||{},this.providedToken=e.token,this.transport=e.transport||new gS,this.dispatcher=e.dispatcher,this.telemetry=e.telemetry,e.deploymentId===null?(this.pinSends=!1,this.explicitlyUnpinned=!0):(this.resolvedDeploymentId=e.deploymentId||process.env.VERCEL_DEPLOYMENT_ID,this.pinSends=!0,this.explicitlyUnpinned=!1)}withRegion(t){return new e({region:t,resolveBaseUrl:this.baseUrlResolver,token:this.providedToken,headers:{...this.customHeaders},deploymentId:this.explicitlyUnpinned?null:this.resolvedDeploymentId,transport:this.transport,dispatcher:this.dispatcher,telemetry:this.telemetry})}getRegion(){return this.region}getTransport(){return this.transport}getTelemetry(){return this.telemetry}requireDeploymentId(){if(!($S()||this.explicitlyUnpinned||this.resolvedDeploymentId))throw Error(`No deployment ID available. VERCEL_DEPLOYMENT_ID is not set.
23
+ `+(a.length>0?`Try opening: ${a.join(` or `)}`:`Set PORT (or NEXT_PORT/NUXT_PORT/VITE_PORT) and try sending again.`)}function zC(e,t){return SC(e).some(e=>e.consumerGroup===t)}var BC=10,VC=2,HC=10,UC=86400;function WC(e,t){let n=Math.min(Math.max(t,0),BC);console.log(`${$} ${iC} Scheduling re-delivery in ${n}s: topic="${e.topicName}" consumer="${e.consumerGroup}" messageId="${e.messageId}"`),setTimeout(async()=>{let t=e.deliveryCount+1,n=new Date(e.createdAt.getTime()+e.retentionSeconds*1e3);if(Date.now()>=n.getTime()){console.log(`${$} Message expired, stopping retries: topic="${e.topicName}" messageId="${e.messageId}"`);return}if(t>HC){console.log(`${$} Max re-deliveries (${HC}) reached: topic="${e.topicName}" messageId="${e.messageId}"`);return}let r={messageId:e.messageId,deliveryCount:t,createdAt:e.createdAt,expiresAt:n,topicName:e.topicName,consumerGroup:e.consumerGroup,region:e.region};console.log(`${$} Re-delivering: topic="${e.topicName}" consumer="${e.consumerGroup}" messageId="${e.messageId}" deliveryCount=${t}`);let i=!0,a=null,o=!1;try{await e.handler(e.payload,r)}catch(t){if(i=!1,e.retry){let n;try{n=e.retry(t,r)}catch(e){console.warn(`${$} retry handler threw:`,e)}n&&`afterSeconds`in n?a=n.afterSeconds:n&&`acknowledge`in n&&(o=!0)}o||console.error(`${$} ${rC} Handler error on re-delivery: topic="${e.topicName}" messageId="${e.messageId}"`,t)}if(i)console.log(`${$} ${nC} Message processed on re-delivery: topic="${e.topicName}" consumer="${e.consumerGroup}" messageId="${e.messageId}"`);else if(o)console.log(`${$} ${nC} Message acknowledged (will not retry): topic="${e.topicName}" consumer="${e.consumerGroup}" messageId="${e.messageId}"`);else{let n=a??e.defaultRetryDelayS;WC({...e,deliveryCount:t},n)}},n*1e3)}function GC(e,t,n,r,i){if(r&&r>0){console.log(`${$} Message sent with delay: topic="${e}" messageId="${t}" delay=${r}s`),setTimeout(()=>{GC(e,t,n,void 0,i)},r*1e3);return}console.log(`${$} Message sent: topic="${e}" messageId="${t}"`),(async()=>{let r=SC(e),a=null;if(r.length>0?(await LC(e,{refreshRegistered:!0}),r=SC(e)):(a=await LC(e),r=SC(e)),r.length===0){let t=lC(e);if(t.length>0){let n=a??{triedPorts:NC(),listeningPorts:[],unavailablePorts:[],importFailures:[],primeFailures:[]};console.warn(RC(e,t,n))}else console.warn(`${$} No registered handler for topic "${e}".
24
+ Ensure vercel.json has a matching experimentalTriggers entry and the route file calls handleCallback().`);return}let o=r.map(e=>e.consumerGroup);console.log(`${$} Invoking handlers for topic="${e}" messageId="${t}" \u2192 consumers: [${o.join(`, `)}]`);let s=i??UC;for(let i of r){let r,a=new Date,o=1,c=!0,l=null,u=!1,d=async(e,t)=>{r=e,a=t.createdAt,o=t.deliveryCount;try{await i.handler(e,t)}catch(e){throw c=!1,e}},f=i.options?.retry?(e,t)=>{let n=i.options.retry(e,t);return n&&`afterSeconds`in n?l=n.afterSeconds:n&&`acknowledge`in n&&(u=!0),n}:void 0,p={queueName:e,consumerGroup:i.consumerGroup,messageId:t,region:n},m={client:i.client,visibilityTimeoutSeconds:i.options?.visibilityTimeoutSeconds,retry:f},h=Math.min(uC(e,i.consumerGroup)??VC,BC),g=()=>({handler:i.handler,retry:i.options?.retry,payload:r,topicName:e,consumerGroup:i.consumerGroup,messageId:t,region:n,createdAt:a,retentionSeconds:s,deliveryCount:o,defaultRetryDelayS:h});try{if(await FC(d,p,m),c)console.log(`${$} ${nC} Message processed: topic="${e}" consumer="${i.consumerGroup}" messageId="${t}"`);else if(u)console.log(`${$} ${nC} Message acknowledged (will not retry): topic="${e}" consumer="${i.consumerGroup}" messageId="${t}"`);else if(l!==null){let e=Math.min(l,BC);WC(g(),e)}}catch(n){console.error(`${$} ${rC} Handler failed: topic="${e}" consumer="${i.consumerGroup}" messageId="${t}"`,n),c||WC(g(),h)}}})()}function KC(){let e=globalThis;delete e[oC],delete e[vC]}(process.env.NODE_ENV===`test`||process.env.VITEST)&&(globalThis.__clearDevState=KC,globalThis.__filePathToConsumerGroup=sC,globalThis.__filePathToUrlPath=IC,globalThis.__matchesFunctionsPattern=fC,globalThis.__stripSrcPrefix=dC);function qC(e,t){let n={...e?.metadata,...t?.metadata};return{isEnabled:t?.isEnabled??e?.isEnabled??!0,tracer:e?.tracer,metadata:Object.keys(n).length>0?n:void 0}}var JC;function YC(){return JC||=import(`../../_chunks/workflow/src-Cj3P1ChQ.js`).then(e=>n(e.t(),1)).then(e=>e,()=>null),JC}function XC(){let e=process.env.VERCEL_QUEUE_TRACE_PROPAGATION?.toLowerCase();return e===`off`||e===`0`||e===`false`}var ZC=[`traceparent`,`tracestate`,`baggage`];async function QC(e,t){if(XC()||t&&!t.isEnabled)return;let n=await YC();if(n)try{let t={};n.propagation.inject(n.context.active(),t);for(let n of ZC){let r=t[n];r!==void 0&&e.set(n,r)}}catch{}}function $C(e,t,n){try{t.setStatus({code:e.SpanStatusCode.ERROR,message:n instanceof Error?n.message:String(n)})}catch{}}function ew(e){try{e.end()}catch{}}async function tw(e,t,n){if(XC()||n&&!n.isEnabled)return t(null);let r=await YC();if(!r)return t(null);let i=null;try{let t=n?.tracer??r.trace.getTracer(`@vercel/queue`),a={"messaging.system":`vercel-queue`,"messaging.destination.name":e};if(n?.metadata)for(let[e,t]of Object.entries(n.metadata))a[`vqs.metadata.${e}`]=t;let o=t.startSpan(`vqs.send`,{kind:r.SpanKind.PRODUCER,attributes:a});i={span:o,ctx:r.trace.setSpan(r.context.active(),o)}}catch{}if(!i)return t(null);let{span:a,ctx:o}=i;try{return await r.context.with(o,()=>t({setMessageId(e){try{a.setAttribute(`messaging.message.id`,e)}catch{}}}))}catch(e){throw $C(r,a,e),e}finally{ew(a)}}var nw=`x-vercel-queue-traceparent`,rw=`x-vercel-queue-tracestate`,iw=`x-vercel-queue-baggage`;async function aw(e,t,n){if(XC()||n&&!n.isEnabled)return t();let r=await YC();if(!r)return t();let i=null;try{let t=ow(r,sw(e)),a=n?.tracer??r.trace.getTracer(`@vercel/queue`),o={"messaging.system":`vercel-queue`,"messaging.operation":`process`};if(n?.metadata)for(let[e,t]of Object.entries(n.metadata))o[`vqs.metadata.${e}`]=t;let s=a.startSpan(`vqs.process`,{kind:r.SpanKind.CONSUMER,attributes:o,links:t});i={span:s,ctx:r.trace.setSpan(r.context.active(),s)}}catch{}if(!i)return t();let{span:a,ctx:o}=i;try{return await r.context.with(o,t)}catch(e){throw $C(r,a,e),e}finally{ew(a)}}function ow(e,t){let n=t[nw];if(!n)return[];let r={traceparent:n},i=t[rw];i&&(r.tracestate=i);let a=t[iw];a&&(r.baggage=a);let o=e.propagation.extract(e.ROOT_CONTEXT,r),s=e.trace.getSpanContext(o);return!s||!e.trace.isSpanContextValid(s)?[]:[{context:s}]}function sw(e){let t={};if(e instanceof Headers)return e.forEach((e,n)=>{t[n.toLowerCase()]=e}),t;for(let[n,r]of Object.entries(e)){let e=Array.isArray(r)?r[0]:r;e!==void 0&&(t[n.toLowerCase()]=e)}return t}function cw(){return process.env.VERCEL_QUEUE_DEBUG===`1`||process.env.VERCEL_QUEUE_DEBUG===`true`}async function lw(e){let t=e.getReader();try{for(;;){let{done:e}=await t.read();if(e)break}}finally{t.releaseLock()}}function uw(e){if(!e)return;let t=Number(e);if(Number.isFinite(t)&&t>=0)return t;let n=Date.parse(e);if(!Number.isNaN(n))return Math.max(0,(n-Date.now())/1e3)}function dw(e,t,n,r,i=`Invalid parameters`,a){throw e===400?new kS(n||i):e===429?new ES(n||`Too many requests: ${r}`,uw(a)):e===401?new DS(n||void 0):e===403?new OS(n||void 0):e>=500?new AS(n||`Server error: ${e} ${t}`):Error(`Failed to ${r}: ${e} ${t}`)}function fw(e){let t=e.get(`Vqs-Message-Id`),n=e.get(`Vqs-Delivery-Count`)||`0`,r=e.get(`Vqs-Timestamp`),i=e.get(`Content-Type`)||`application/octet-stream`,a=e.get(`Vqs-Receipt-Handle`),o=e.get(`Vqs-Expires-At`);if(!t||!r||!a)return null;let s=parseInt(n,10);return Number.isNaN(s)?null:{messageId:t,deliveryCount:s,createdAt:new Date(r),expiresAt:o?new Date(o):void 0,contentType:i,receiptHandle:a}}var pw=/^[a-z]{2,5}[0-9]{1,2}$/;function mw(e){if(!pw.test(e))throw Error(`Invalid region code: ${JSON.stringify(e)}. Region must match the pattern /^[a-z]{2,5}[0-9]{1,2}$/ (e.g. "iad1", "lhr1").`)}var hw=e=>new URL(`https://${e}.vercel-queue.com`);function gw(e,t){return(t??hw)(e)}var _w=`/api/v3/topic`,vw=class e{baseUrl;customHeaders;providedToken;resolvedDeploymentId;pinSends;explicitlyUnpinned;transport;region;baseUrlResolver;dispatcher;telemetry;constructor(e){mw(e.region),this.region=e.region,this.baseUrlResolver=e.resolveBaseUrl,this.baseUrl=gw(this.region,this.baseUrlResolver),this.customHeaders=e.headers||{},this.providedToken=e.token,this.transport=e.transport||new SS,this.dispatcher=e.dispatcher,this.telemetry=e.telemetry,e.deploymentId===null?(this.pinSends=!1,this.explicitlyUnpinned=!0):(this.resolvedDeploymentId=e.deploymentId||process.env.VERCEL_DEPLOYMENT_ID,this.pinSends=!0,this.explicitlyUnpinned=!1)}withRegion(t){return new e({region:t,resolveBaseUrl:this.baseUrlResolver,token:this.providedToken,headers:{...this.customHeaders},deploymentId:this.explicitlyUnpinned?null:this.resolvedDeploymentId,transport:this.transport,dispatcher:this.dispatcher,telemetry:this.telemetry})}getRegion(){return this.region}getTransport(){return this.transport}getTelemetry(){return this.telemetry}requireDeploymentId(){if(!(aC()||this.explicitlyUnpinned||this.resolvedDeploymentId))throw Error(`No deployment ID available. VERCEL_DEPLOYMENT_ID is not set.
25
25
 
26
26
  This usually means the code is running outside a Vercel deployment (e.g. during build or in a non-Vercel environment).
27
27
 
28
28
  To fix this, create a client with an explicit deploymentId:
29
29
  new QueueClient({ deploymentId: "dpl_xxx" })
30
30
  Or explicitly opt out of deployment pinning:
31
- new QueueClient({ deploymentId: null })`)}getSendDeploymentId(){if(!$S())return this.requireDeploymentId(),this.pinSends?this.resolvedDeploymentId:void 0}getConsumeDeploymentId(){if(!$S())return this.requireDeploymentId(),this.resolvedDeploymentId}async getToken(){if(this.providedToken)return this.providedToken;try{return await(0,mS.getVercelOidcToken)()}catch(e){let t=e instanceof Error?e.message:String(e);throw Error($S()?`Failed to get OIDC token for local development.
31
+ new QueueClient({ deploymentId: null })`)}getSendDeploymentId(){if(!aC())return this.requireDeploymentId(),this.pinSends?this.resolvedDeploymentId:void 0}getConsumeDeploymentId(){if(!aC())return this.requireDeploymentId(),this.resolvedDeploymentId}async getToken(){if(this.providedToken)return this.providedToken;try{return await(0,bS.getVercelOidcToken)()}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(aC()?`Failed to get OIDC token for local development.
32
32
 
33
33
  To fix this, pull your environment variables with Vercel CLI:
34
34
  \`vercel env pull\`
@@ -39,4 +39,4 @@ To fix this, either:
39
39
  - Deploy to Vercel (OIDC tokens are provisioned automatically)
40
40
  - Provide a token explicitly: \`new QueueClient({ token: '...' })\`
41
41
 
42
- Cause: ${t}`)}}buildUrl(e,...t){let n=encodeURIComponent(e),r=t.map(e=>encodeURIComponent(e)),i=r.length>0?`/`+r.join(`/`):``,a=this.baseUrl.pathname.replace(/\/+$/,``);return`${this.baseUrl.origin}${a}${dw}/${n}${i}`}async fetch(e,t){let n=t.method||`GET`;if(nw()){let r={method:n,url:e,headers:t.headers},i=t.body;i!=null&&(i instanceof ArrayBuffer||i instanceof Uint8Array?r.bodySize=i.byteLength:typeof i==`string`?r.bodySize=i.length:r.bodyType=typeof i),console.debug(`[VQS Debug] Request:`,JSON.stringify(r,null,2))}t.headers.set(`User-Agent`,`@vercel/queue/0.4.0`),t.headers.set(`Vqs-Client-Ts`,new Date().toISOString());let r=this.dispatcher?{...t,dispatcher:this.dispatcher}:t,i=await fetch(e,r);if(nw()){let t={method:n,url:e,status:i.status,statusText:i.statusText,headers:i.headers};console.debug(`[VQS Debug] Response:`,JSON.stringify(t,null,2))}return i}async sendMessage(e){let t=this.transport,{queueName:n,payload:r,idempotencyKey:i,retentionSeconds:a,delaySeconds:o,headers:s,telemetry:c}=e,l=new Headers;if(this.customHeaders)for(let[e,t]of Object.entries(this.customHeaders))l.append(e,t);if(s){let e=new Set([`authorization`,`content-type`]),t=t=>{let n=t.toLowerCase();return e.has(n)?!0:n.startsWith(`vqs-`)};for(let[e,n]of Object.entries(s))!t(e)&&n!==void 0&&l.append(e,n)}l.set(`Authorization`,`Bearer ${await this.getToken()}`),l.set(`Content-Type`,t.contentType);let u=this.getSendDeploymentId();u&&l.set(`Vqs-Deployment-Id`,u),i&&l.set(`Vqs-Idempotency-Key`,i),a!==void 0&&l.set(`Vqs-Retention-Seconds`,a.toString()),o!==void 0&&l.set(`Vqs-Delay-Seconds`,o.toString());let d=t.serialize(r),f=Buffer.isBuffer(d)?new Uint8Array(d):d,p=VC(this.telemetry,c);return YC(n,async e=>{await KC(l,p);let t=await this.fetch(this.buildUrl(n),{method:`POST`,body:f,headers:l});if(!t.ok){let e=await t.text();if(t.status===409)throw new DS(e||`Duplicate idempotency key detected`,i);if(t.status===502)throw new OS(e||`Consumer discovery failed`,u);if(t.status===503)throw new kS(e||`Consumer registry not configured`);aw(t.status,t.statusText,e,`send message`)}if(t.status===202)return await t.text(),{messageId:null};let r=await t.json();return e&&r.messageId&&e.setMessageId(r.messageId),r},p)}async*receiveMessages(e){let t=this.transport,{queueName:n,consumerGroup:r,visibilityTimeoutSeconds:i,limit:a}=e;if(a!==void 0&&(a<1||a>10))throw new TS(a);let o=new Headers({Authorization:`Bearer ${await this.getToken()}`,Accept:`multipart/mixed`,...this.customHeaders});i!==void 0&&o.set(`Vqs-Visibility-Timeout-Seconds`,i.toString()),a!==void 0&&o.set(`Vqs-Max-Messages`,a.toString());let s=this.getConsumeDeploymentId();s&&o.set(`Vqs-Deployment-Id`,s);let c=await this.fetch(this.buildUrl(n,`consumer`,r),{method:`POST`,headers:o});if(c.status===204){await c.text();return}if(!c.ok){let e=await c.text();aw(c.status,c.statusText,e,`receive messages`)}for await(let e of Ih(c))try{let n=ow(e.headers);if(!n){console.warn(`Missing required queue headers in multipart part`),await rw(e.payload);continue}let r=await t.deserialize(e.payload);yield{...n,payload:r}}catch(t){console.warn(`Failed to process multipart message:`,t),await rw(e.payload)}}async receiveMessageById(e){let t=this.transport,{queueName:n,consumerGroup:r,messageId:i,visibilityTimeoutSeconds:a}=e,o=new Headers({Authorization:`Bearer ${await this.getToken()}`,Accept:`multipart/mixed`,...this.customHeaders});a!==void 0&&o.set(`Vqs-Visibility-Timeout-Seconds`,a.toString());let s=this.getConsumeDeploymentId();s&&o.set(`Vqs-Deployment-Id`,s);let c=await this.fetch(this.buildUrl(n,`consumer`,r,`id`,i),{method:`POST`,headers:o});if(!c.ok){let e=await c.text();if(c.status===404)throw new _S(i);if(c.status===409){let t={};try{t=JSON.parse(e)}catch{}throw t.originalMessageId?new vS(i,`This message was a duplicate - use originalMessageId: ${t.originalMessageId}`):new vS(i)}if(c.status===410)throw new ES(i);aw(c.status,c.statusText,e,`receive message by ID`)}for await(let e of Ih(c)){let n=ow(e.headers);if(!n)throw await rw(e.payload),new yS(i,`Missing required queue headers in response`);let r=await t.deserialize(e.payload);return{message:{...n,payload:r}}}throw new _S(i)}async acknowledgeMessage(e){let{queueName:t,consumerGroup:n,receiptHandle:r}=e,i=new Headers({Authorization:`Bearer ${await this.getToken()}`,...this.customHeaders}),a=this.getConsumeDeploymentId();a&&i.set(`Vqs-Deployment-Id`,a);let o=await this.fetch(this.buildUrl(t,`consumer`,n,`lease`,r),{method:`DELETE`,headers:i});if(!o.ok){let e=await o.text();if(o.status===404)throw new _S(r);if(o.status===409)throw new vS(r,e||`Invalid receipt handle, message not in correct state, or already processed`);aw(o.status,o.statusText,e,`acknowledge message`,`Missing or invalid receipt handle`,o.headers?.get(`Retry-After`)??null)}return await o.text(),{acknowledged:!0}}async changeVisibility(e){let{queueName:t,consumerGroup:n,receiptHandle:r,visibilityTimeoutSeconds:i}=e,a=new Headers({Authorization:`Bearer ${await this.getToken()}`,"Content-Type":`application/json`,...this.customHeaders}),o=this.getConsumeDeploymentId();o&&a.set(`Vqs-Deployment-Id`,o);let s=await this.fetch(this.buildUrl(t,`consumer`,n,`lease`,r),{method:`PATCH`,headers:a,body:JSON.stringify({visibilityTimeoutSeconds:i})});if(!s.ok){let e=await s.text();if(s.status===404)throw new _S(r);if(s.status===409)throw new vS(r,e||`Invalid receipt handle, message not in correct state, or already processed`);aw(s.status,s.statusText,e,`change visibility`,`Missing receipt handle or invalid visibility timeout`,s.headers?.get(`Retry-After`)??null)}return await s.text(),{success:!0}}},pw=new WeakMap,mw=Symbol.for(`@vercel/queue.apiClient`);function hw(e,t){pw.set(e,t),Object.defineProperty(e,mw,{value:t,writable:!1,enumerable:!1,configurable:!1})}function gw(e){let t=pw.get(e);if(t)return t;let n=e[mw];if(typeof n==`object`&&n){let t=n;return pw.set(e,t),t}throw Error(`QueueClient not initialized. This may happen when multiple bundled copies of @vercel/queue are loaded in local dev.`)}function _w(e){return`request`in e?e.request:e}function vw(e){return gw(e)}var yw=`iad1`;function bw(e){return e||process.env.VERCEL_REGION||($S()||console.warn(`[QueueClient] Region not detected \u2014 defaulting to "${yw}". On Vercel this is set automatically via VERCEL_REGION. To silence this warning, pass region explicitly: new QueueClient({ region: "iad1" })`),yw)}var xw=class{constructor(e={}){let t=bw(e.region);hw(this,new fw({...e,region:t}))}send=async(e,t,n)=>{let r=gw(this),i=await r.sendMessage({queueName:e,payload:t,idempotencyKey:n?.idempotencyKey,retentionSeconds:n?.retentionSeconds,delaySeconds:n?.delaySeconds,headers:n?.headers,telemetry:n?.telemetry});return i.messageId&&$S()&&zC(e,i.messageId,r.getRegion(),n?.delaySeconds,n?.retentionSeconds),{messageId:i.messageId}};handleCallback=(e,t)=>{$S()&&hC(e,this,t);let n=VC(gw(this).getTelemetry?.());return async r=>{let i=_w(r);if($S()&&i.headers.get(`x-vercel-queue-prime`)===`1`){let n=i.headers.get(`x-vercel-queue-prime-file`);return n&&hC(e,this,t,n),Response.json({status:`primed`})}try{let r=await JS(i);return await $C(i.headers,()=>YS(e,r,{client:this,visibilityTimeoutSeconds:t?.visibilityTimeoutSeconds,retry:t?.retry}),n),Response.json({status:`success`})}catch(e){return console.error(`Queue callback error:`,e),e instanceof Error&&(e.message.includes(`Invalid content type`)||e.message.includes(`Invalid CloudEvent`)||e.message.includes(`Missing required CloudEvent`)||e.message.includes(`Failed to parse CloudEvent`)||e.message.includes(`Binary mode callback`))?Response.json({error:e.message},{status:400}):Response.json({error:`Failed to process queue message`},{status:500})}}};handleNodeCallback=(e,t)=>{$S()&&hC(e,this,t);let n=VC(gw(this).getTelemetry?.());return async(r,i)=>{if(r.method!==`POST`){i.status(200).end();return}let a=r.headers[`x-vercel-queue-prime`];if($S()&&a===`1`){let n=r.headers[`x-vercel-queue-prime-file`],a=Array.isArray(n)?n[0]:n;a&&hC(e,this,t,a),i.status(200).json({status:`primed`});return}try{let a=qS(r.body,r.headers);await $C(r.headers,()=>YS(e,a,{client:this,visibilityTimeoutSeconds:t?.visibilityTimeoutSeconds,retry:t?.retry}),n),i.status(200).json({status:`success`})}catch(e){if(console.error(`Queue callback error:`,e),e instanceof Error&&(e.message.includes(`Invalid content type`)||e.message.includes(`Invalid CloudEvent`)||e.message.includes(`Missing required CloudEvent`)||e.message.includes(`Failed to parse CloudEvent`)||e.message.includes(`Binary mode callback`))){i.status(400).json({error:e.message});return}i.status(500).json({error:`Failed to process queue message`})}}}};function Sw(e){return`${e} requires VERCEL_DEPLOYMENT_ID, which Vercel sets in every deployment, so this process is not running inside one. The Vercel world is only selected automatically when that variable is set, so it was requested explicitly here — most often by WORKFLOW_TARGET_WORLD=vercel in a process that is not a deployment, such as a production server started locally or in CI. To use the local filesystem world instead, set WORKFLOW_TARGET_WORLD=local or unset it.`}var Cw=class{contentType=`application/cbor`;serialize(e){return Buffer.from(bp(e))}async deserialize(e){let t=[],n=e.getReader();for(;;){let{done:e,value:r}=await n.read();if(e)break;r&&t.push(r)}return qf(Buffer.concat(t))}},ww=class{contentType=`application/json`;serialize(e){return Buffer.from(JSON.stringify(e))}async deserialize(e){let t=[],n=e.getReader();for(;;){let{done:e,value:r}=await n.read();if(e)break;r&&t.push(r)}return JSON.parse(Buffer.concat(t).toString())}},Tw=class{contentType=`application/cbor`;serialize(e){return Buffer.from(bp(e))}async deserialize(e){let t=[],n=e.getReader();for(;;){let{done:e,value:r}=await n.read();if(e)break;r&&t.push(r)}let r=Buffer.concat(t);try{return qf(r)}catch{return JSON.parse(r.toString())}}};const Ew=new Dl,Dw=dc({payload:ba,queueName:li,deploymentId:qt().optional()}),Ow=Number(process.env.VERCEL_QUEUE_MAX_DELAY_SECONDS||82800);function kw(e){let t=Math.min(Math.max(1,2**(e-1)),900),n=Math.floor(Math.random()*(Math.ceil(t*.25)+1));return Math.max(1,t-n)}function Aw(e){if(`runId`in e&&typeof e.runId==`string`)return e.runId}function jw(e){if(!e)return;let t=e.startsWith(`wrun_`)?e.slice(5):e;try{let e=Jc(t);return!e.tagged||e.regionId===Uc.unknown?void 0:e.region??void 0}catch{return}}function Mw(e,t){if(Hc(t?.region))return t.region;let n=jw(Aw(e));if(n)return n;let r=process.env.VERCEL_REGION;return Hc(r)?r:`iad1`}function Nw(e){let t={};return`runId`in e&&typeof e.runId==`string`&&(t[`x-vercel-workflow-run-id`]=e.runId),`stepId`in e&&typeof e.stepId==`string`&&(t[`x-vercel-workflow-step-id`]=e.stepId),Object.keys(t).length>0?t:void 0}const Pw=/^__([a-z][a-z0-9]*_)?wkf_workflow_/;let Fw=!1;function Iw(){return process.env.WORKFLOW_SEQUENTIAL_REPLAYS===`1`}function Lw(e,t){return!Iw()||!Pw.test(e)?e:(Fw||(Fw=!0,console.warn(`[workflow] WORKFLOW_SEQUENTIAL_REPLAYS=1: routing flow messages to per-run queue topics`)),`__healthCheck`in t&&typeof t.correlationId==`string`?`${e}_${t.correlationId}`:`runId`in t&&typeof t.runId==`string`?`stepId`in t&&typeof t.stepId==`string`?`${e}_${t.runId}_${t.stepId}`:`${e}_${t.runId}`:e)}function Rw(e){let{baseUrl:t,usingProxy:n}=eh(e),r=nh(e,{usingProxy:n}),i=new Cw,a=new ww,o=new Tw,s={dispatcher:qp(e),transport:o,...n&&{resolveBaseUrl:()=>new URL(`${t}/queues-proxy`),token:e?.token},headers:Object.fromEntries(r.entries())},c=async(e,t,r)=>{let o=r?.deploymentId??process.env.VERCEL_DEPLOYMENT_ID;if(!o)throw Error(`${Sw(`Enqueuing a workflow message`)} Callers outside a deployment can instead pass an explicit deploymentId in options.`);let c=(r?.specVersion??5)>=3?i:a,l=Mw(t,r),u=new xw({...s,...n&&{headers:{...s.headers,"x-vercel-queue-region":l}},region:l,deploymentId:o,transport:c}),d={payload:t,queueName:e,deploymentId:r?.deploymentId},f=Lw(e,t).replace(/[^A-Za-z0-9-_]/g,`-`);try{let{messageId:e}=await u.send(f,d,{idempotencyKey:r?.idempotencyKey,delaySeconds:r?.delaySeconds,headers:{...Nw(t),...r?.headers}});return{messageId:e?ka.parse(e):null}}catch(e){if(e instanceof DS)return{messageId:ka.parse(`msg_duplicate_${e.idempotencyKey??r?.idempotencyKey??`unknown`}`)};throw e}};return{queue:c,createQueueHandler:(e,t)=>{let n=new xw(s).handleCallback(async(e,n)=>{if(!e||!n)return;let r=Ew.getStore(),{payload:i,queueName:a,deploymentId:o}=Dw.parse(e),s=await t(i,{queueName:a,messageId:ka.parse(n.messageId),attempt:n.deliveryCount,requestId:r});if(typeof s?.timeoutSeconds==`number`){let e=s.timeoutSeconds>0?Math.min(s.timeoutSeconds,Ow):void 0;await c(a,i,{deploymentId:o,delaySeconds:e})}},{retry:(e,{messageId:t,deliveryCount:n})=>{let r=kw(n);return console.error(`[workflow] Queue handler failed for message "${t}" on delivery attempt ${n}; retrying in ${r}s:`,e),{afterSeconds:r}}});return async e=>{let t=e.headers.get(`x-vercel-id`)?.trim()||void 0;return Ew.run(t,()=>n(e))}},getDeploymentId:async()=>{let e=process.env.VERCEL_DEPLOYMENT_ID;if(!e)throw Error(Sw(`Starting a workflow run`));return e},isDeploymentUnavailableError:e=>e instanceof OS}}const zw=dc({id:qt()});function Bw(e){return async function(){let t=process.env.VERCEL_DEPLOYMENT_ID;if(!t)throw Error(Sw(`Resolving the latest deployment for deploymentId: 'latest'`));let n=await Vm(e);if(!n)throw Error(`Cannot resolve latest deployment: no OIDC token or VERCEL_TOKEN available`);let r=await(await Wm({method:`GET`,url:`https://api.vercel.com/v1/workflow/resolve-latest-deployment/${encodeURIComponent(t)}`,headers:new Headers({Authorization:`Bearer ${n}`}),dispatcher:qp(e),peerService:`vercel-api`,timeoutMs:null,buildError:async e=>{let n;try{n=await e.text()}catch{n=`<unable to read response body>`}return Error(`Failed to resolve latest deployment for ${t}: HTTP ${e.status} ${e.statusText}${n?` — ${n}`:``}`)}})).json(),i=zw.safeParse(r);if(!i.success)throw Error(`Invalid response from Vercel API: expected { id: string }. Zod error: ${i.error.message}`);return i.data.id}}function Vw(e){let t=ht.safeParse(e);return t.success?t.data:(Vt.safeParse(e.eventType).success&&console.debug(`[workflow:world-vercel] v4 event ${e.eventId} failed EventSchema parse for known eventType '${e.eventType}'; passing through unparsed: ${t.error.message}`),e)}const Hw={run_created:{retryable:!0,reason:`conditional create → 409 if exists`},step_created:{retryable:!0,reason:`conditional create → 409 if exists`},wait_created:{retryable:!0,reason:`conditional create → 409 if exists`},hook_created:{retryable:!0,reason:`transactional token uniqueness → 409 if exists`},run_started:{retryable:!0,reason:`early-returns if already running, no duplicate row`},run_completed:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},run_failed:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},run_cancelled:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},step_completed:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},step_failed:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},wait_completed:{retryable:!0,reason:`waiting-state guard → 409, no duplicate row`},hook_disposed:{retryable:!0,reason:`conditional delete (exists) → 409, no duplicate row`},attr_set:{retryable:!0,reason:`correlationId constraint reuses eventId (idempotent replay)`},step_started:{retryable:!1,reason:`unconditional attempt increment → a retry double-counts attempts`},step_retrying:{retryable:!1,reason:`no duplicate guard → a retry appends a second event row`},hook_received:{retryable:!1,reason:`no server guard → a retry duplicates the row / re-delivers payload. EXCEPTION: the atomic lazy-resume shape (resumeId + digest) is deduplicated server-side by the (runId, resumeId) claim, so those writes opt in via withEventPostRetry({ idempotentHookResume })`},hook_conflict:{retryable:!1,reason:`server-originated; never POSTed by the SDK`}},Uw=new Set([`ECONNRESET`,`ECONNREFUSED`,`ENOTFOUND`,`ENETDOWN`,`ENETUNREACH`,`EHOSTDOWN`,`EHOSTUNREACH`,`EPIPE`,`ETIMEDOUT`,`UND_ERR_SOCKET`,`UND_ERR_REQ_RETRY`,`UND_ERR_CONNECT_TIMEOUT`,`UND_ERR_HEADERS_TIMEOUT`,`UND_ERR_BODY_TIMEOUT`,`TimeoutError`,`RequestRetryError`]);function Ww(e,t=0){if(t>5||typeof e!=`object`||!e)return[];let n=[],r=e;return typeof r.code==`string`&&n.push(r.code),typeof r.name==`string`&&n.push(r.name),r.cause&&n.push(...Ww(r.cause,t+1)),n}function Gw(e){if(f.is(e)||l.is(e)||s.is(e)||u.is(e))return!1;if(o.is(e)){if(e.code===`PARSE_ERROR`)return!0;if(typeof e.status==`number`)return e.status>=500&&e.status<=599}return Ww(e).some(e=>Uw.has(e))}const Kw=e=>new Promise(t=>setTimeout(t,e)),qw=typeof process<`u`&&typeof process.env.DEBUG==`string`&&(process.env.DEBUG.includes(`workflow:`)||process.env.DEBUG===`*`);function Jw(e,t){if(!qw)return;let n=Object.entries(t).map(([e,t])=>`${e}=${t}`).join(` `);console.debug(`[workflow:world-vercel:event-retry] ${e} ${n}`)}function Yw(e){return o.is(e)?e.code??(e.status==null?e.name:`status_${e.status}`):Ww(e)[0]??(e instanceof Error?e.name:`unknown`)}async function Xw(e,t,n){let r=t===`hook_received`&&n?.idempotentHookResume===!0||(Hw[t]?.retryable??!1);for(let n=0;;n++)try{return await e()}catch(e){let i=r&&Gw(e);if(i&&n<2){let r=100*2**n+Math.floor(Math.random()*50);Jw(`retrying event POST after transient failure`,{eventType:t,attempt:n+1,backoffMs:r,error:Yw(e)}),await Kw(r);continue}throw i&&Jw(`exhausted in-process retries; surfacing for queue redelivery`,{eventType:t,attempts:n+1,error:Yw(e)}),e}}const Zw=`application/vnd.workflow.v4-frames`;function Qw(e,t){let n=new Uint8Array(bp(e)),r=new Uint8Array(4+n.byteLength+4+t.byteLength),i=new DataView(r.buffer);return i.setUint32(0,n.byteLength,!1),r.set(n,4),i.setUint32(4+n.byteLength,t.byteLength,!1),r.set(t,4+n.byteLength+4),r}async function*$w(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():tT(e.getReader()),n=new Uint8Array,r=async e=>{for(;n.byteLength<e;){let{done:e,value:r}=await t.next();if(e)return!1;if(!r||r.byteLength===0)continue;let i=new Uint8Array(n.byteLength+r.byteLength);i.set(n,0),i.set(r,n.byteLength),n=i}return!0},i=e=>{let t=n.subarray(0,e);return n=n.subarray(e),t};try{for(;;){if(!await r(4))return;let e=new DataView(n.buffer,n.byteOffset,4).getUint32(0,!1);if(i(4),!await r(e))throw Error(`decodeFrames: truncated meta block`);let t=qf(i(e));if(!await r(4))throw Error(`decodeFrames: truncated body length`);let a=new DataView(n.buffer,n.byteOffset,4).getUint32(0,!1);if(i(4),a>0&&!await r(a))throw Error(`decodeFrames: truncated body bytes`);if(yield{meta:t,body:n.slice(0,a)},i(a),t._end===1)return}}finally{eT(()=>t.return?.())}}function eT(e){try{Promise.resolve(e()).catch(()=>{})}catch{}}async function*tT(e){try{for(;;){let{done:t,value:n}=await e.read();if(t)return;n&&(yield n)}}finally{eT(()=>e.cancel())}}async function nT(e,t,n,r){return Wm({method:t.method,url:e,headers:t.headers,body:t.body,dispatcher:Jp(n),timeoutMs:null,logLabel:r,buildError:async t=>oT(t.status,rT(t.headers),await t.text(),r,e)})}function rT(e){let t={};return e.forEach((e,n)=>{t[n]=e}),t}const iT={eventId:`x-wf-event-id`,runId:`x-wf-run-id`,createdAt:`x-wf-created-at`,maxEvents:`x-wf-max-events`};function aT(e){let t={eventType:e.eventType,specVersion:e.specVersion};return e.correlationId!==void 0&&(t.correlationId=e.correlationId),e.vercelId!==void 0&&(t.vercelId=e.vercelId),e.computeInstanceId!==void 0&&(t.computeInstanceId=e.computeInstanceId),e.occurredAt!==void 0&&(t.occurredAt=e.occurredAt),e.remoteRefBehavior!==void 0&&(t.remoteRefBehavior=e.remoteRefBehavior),e.deploymentId!==void 0&&(t.deploymentId=e.deploymentId),e.workflowName!==void 0&&(t.workflowName=e.workflowName),e.stepName!==void 0&&(t.stepName=e.stepName),e.attempt!==void 0&&(t.attempt=e.attempt),e.resumeAt!==void 0&&(t.resumeAt=e.resumeAt),e.retryAfter!==void 0&&(t.retryAfter=e.retryAfter),e.hookToken!==void 0&&(t.hookToken=e.hookToken),e.hookTokenRetentionUntil!==void 0&&(t.hookTokenRetentionUntil=e.hookTokenRetentionUntil),e.hookIsWebhook!==void 0&&(t.hookIsWebhook=e.hookIsWebhook),e.hookIsSystem!==void 0&&(t.hookIsSystem=e.hookIsSystem),e.resumeId!==void 0&&(t.resumeId=e.resumeId),e.errorCode!==void 0&&(t.errorCode=e.errorCode),e.cancelReason!==void 0&&(t.cancelReason=e.cancelReason),e.ownerMessageId!==void 0&&(t.ownerMessageId=e.ownerMessageId),e.executionContext!==void 0&&(t.executionContext=e.executionContext),e.attributes!==void 0&&(t.attributes=e.attributes),e.changes!==void 0&&(t.changes=e.changes),e.writer!==void 0&&(t.writer=e.writer),e.allowReservedAttributes!==void 0&&(t.allowReservedAttributes=e.allowReservedAttributes),e.encryptionPublicKey!==void 0&&(t.encryptionPublicKey=e.encryptionPublicKey),e.ttfs!==void 0&&(t.ttfs=e.ttfs),e.stso!==void 0&&(t.stso=e.stso),e.stepCount!==void 0&&(t.stepCount=e.stepCount),e.eventCount!==void 0&&(t.eventCount=e.eventCount),e.rsfs!==void 0&&(t.rsfs=e.rsfs),e.finalSchedulingReplay!==void 0&&(t.finalSchedulingReplay=e.finalSchedulingReplay),e.optimizations!==void 0&&(t.optimizations=e.optimizations),e.sinceCursor!==void 0&&(t.sinceCursor=e.sinceCursor),e.skipPreload!==void 0&&(t.skipPreload=e.skipPreload),e.stateUpdatedAt!==void 0&&(t.stateUpdatedAt=e.stateUpdatedAt),e.stateEventCount!==void 0&&(t.stateEventCount=e.stateEventCount),e.stateCursor!==void 0&&(t.stateCursor=e.stateCursor),e.replayDivergenceCount!==void 0&&(t.replayDivergenceCount=e.replayDivergenceCount),e.resumePayloadDigest!==void 0&&(t.resumePayloadDigest=e.resumePayloadDigest),t}function oT(e,t,n,r,i){let a=`v4 ${r} failed: HTTP ${e}`,o,s;try{let t=JSON.parse(n);typeof t.message==`string`&&(a=t.message),typeof t.code==`string`&&(o=t.code),e===412&&(s=sT(t))}catch{n&&(a+=` ${n}`)}let c=Rm(fT(t,`retry-after`));return zm(e,a,{retryAfter:c,code:o,url:i,mitigated:fT(t,`x-vercel-mitigated`),...s===void 0?{}:{details:s}})}function sT(e){if(!Array.isArray(e.events)||e.events.length===0)return;let t=[];for(let n of e.events){if(typeof n!=`object`||!n)return;let e=n;if(typeof e.eventId!=`string`||cT(e))return;t.push(Vw(e))}return{events:t,...typeof e.cursor==`string`?{cursor:e.cursor}:{}}}function cT(e){let t=e.eventType;if(typeof t!=`string`)return!1;let n=zn(t);if(!n)return!1;let r=e.eventData;if(typeof r!=`object`||!r)return!1;let i=r[n];return i!==void 0&&!(i instanceof Uint8Array)}async function lT(e,t){let{baseUrl:n,headers:r}=await rh(t),i=new Headers(r);i.set(`Content-Type`,`application/octet-stream`);let a=Qw(aT(e),e.payload??new Uint8Array);return uT(await nT(`${n}/v4/runs/${encodeURIComponent(e.runId)}/events/${encodeURIComponent(e.eventType)}`,{method:`POST`,headers:i,body:a},t,`createEvent`))}async function uT(e){let t=e.headers.get(iT.eventId),n=e.headers.get(iT.runId),r=e.headers.get(iT.createdAt);if(typeof t!=`string`||typeof n!=`string`||typeof r!=`string`)throw Error(`v4 createEvent: response missing required x-wf-* headers`);let i=new Uint8Array(await e.arrayBuffer());return{eventId:t,runId:n,createdAt:r,body:i.byteLength>0?qf(i):{}}}async function dT(e,t){let{baseUrl:n,headers:r}=await rh(t),i=new Headers(r);i.set(`Content-Type`,`application/octet-stream`),i.set(`Accept`,Zw);let a=Qw(aT(e),e.payload??new Uint8Array),o=await nT(`${n}/v4/runs/${encodeURIComponent(e.runId)}/events/${encodeURIComponent(e.eventType)}`,{method:`POST`,headers:i,body:a},t,`createEvent`);if(!o.headers.get(`content-type`)?.startsWith(`application/vnd.workflow.v4-frames`))return{kind:`materialized`,result:await uT(o)};let s=await hT(o,`createEvent`),c=o.headers.get(iT.maxEvents),l=c===null?NaN:Number(c);return{kind:`stream`,...s,canonicalEventId:o.headers.get(iT.eventId)??void 0,maxEvents:Number.isInteger(l)&&l>0?l:void 0}}function fT(e,t){let n=e[t];if(typeof n==`string`)return n;if(Array.isArray(n)&&n.length>0)return n[0]}async function pT(e,t,n){let{baseUrl:r,headers:i}=await rh(n),a=await nT(`${r}/v4/runs/${encodeURIComponent(e)}/events/${encodeURIComponent(t)}`,{method:`GET`,headers:i},n,`getEvent`),o=a.headers.get(`content-type`);if(!o?.startsWith(`application/vnd.workflow.v4-frames`))throw Error(`v4 getEvent: expected ${Zw}, got ${o??`(none)`}`);let s=a.body;for await(let e of $w(s))return{event:e.meta,body:e.body};throw Error(`v4 getEvent: empty frame stream for ${t}`)}async function mT(e,t,n,r){return hT(await nT(e,{method:`GET`,headers:t},n,r),r)}async function hT(e,t){let n=e.headers.get(`content-type`);if(!n?.startsWith(`application/vnd.workflow.v4-frames`))throw Error(`v4 ${t}: expected ${Zw}, got ${n??`(none)`}`);let r=e.body,i=[],a,o,s=!1;for await(let e of $w(r)){if(e.meta._end===1){typeof e.meta.next==`string`&&(a=e.meta.next),typeof e.meta.hasMore==`boolean`&&(o=e.meta.hasMore),s=!0;break}i.push({event:e.meta,body:e.body})}if(!s)throw Error(`v4 ${t}: frame stream ended without the end-of-stream sentinel (${i.length} events read) — truncated response?`);return{events:i,...a?{next:a}:{},...o===void 0?{}:{hasMore:o}}}function gT(e,t){t.cursor&&e.set(`cursor`,t.cursor),t.limit!==void 0&&e.set(`limit`,String(t.limit)),t.sortOrder&&e.set(`sortOrder`,t.sortOrder),t.remoteRefBehavior&&e.set(`remoteRefBehavior`,t.remoteRefBehavior)}function _T(e){let t=new URLSearchParams;gT(t,e);let n=t.toString();return n?`?${n}`:``}async function vT(e,t={},n){let{baseUrl:r,headers:i}=await rh(n);return mT(`${r}/v4/runs/${encodeURIComponent(e)}/events`+_T(t),i,n,`listEvents`)}async function yT(e,t,n={},r){let{baseUrl:i,headers:a}=await rh(r),o=new URLSearchParams;return o.set(`correlationId`,e),o.set(`runId`,t),gT(o,n),mT(`${i}/v4/events?${o.toString()}`,a,r,`listEventsByCorrelationId`)}const bT=`gzip`,xT=`zstd`,ST=new TextDecoder,CT=new Set([`devl`,`encr`,bT,xT]);function wT(){try{return globalThis.process?.getBuiltinModule?.(`node:zlib`)}catch{return}}function TT(e){return!(e instanceof Uint8Array)||e.byteLength<4?null:ST.decode(e.subarray(0,4))}function ET(e){let t=TT(e);return t!==null&&CT.has(t)}function DT(e,t){let n=wT(),r=e===xT?n?.zstdDecompressSync:n?.gunzipSync;if(!r)throw new o(`Received ${e}-compressed workflow data, but this Node.js runtime does not support ${e} decompression. Use a compatible Node.js runtime or request unresolved data.`);return new Uint8Array(r(t))}function OT(e){let t=TT(e);return t!==xT&&t!==bT?e:DT(t,e.subarray(4))}function kT(e){return{...e,input:OT(e.input),output:OT(e.output),error:OT(e.error)}}function AT(e){return{...e,input:OT(e.input),output:OT(e.output),error:OT(e.error)}}function jT(e){return{...e,metadata:OT(e.metadata)}}function MT(e){let t=e.eventData;if(!t||typeof t!=`object`)return e;let n=Mc(typeof e.eventType==`string`?e.eventType:``);if(n.length===0)return e;let r={...t},i=!1;for(let e of n){if(!(e in r))continue;let t=r[e],n=OT(t);n!==t&&(r[e]=n,i=!0)}return i?{...e,eventData:r}:e}const NT=on.omit({error:!0,errorCode:!0}).extend({error:Zr([rs,cr()]).optional(),errorCode:qt().optional(),blobStorageBytes:we().optional(),streamStorageBytes:we().optional()}),PT=NT,FT=NT.omit({input:!0,output:!0}).extend({inputRef:cr().optional(),outputRef:cr().optional(),input:Zr([vc(Uint8Array),cr()]).optional(),output:Zr([vc(Uint8Array),cr()]).optional()});function IT(e,t){if(t===`none`){let{inputRef:t,outputRef:n,...r}=e;return{...kT(Zm(r)),input:void 0,output:void 0}}return kT(Zm(e))}async function LT(e={},t){let{workflowName:n,status:r,pagination:i,resolveData:a=`all`}=e,o=new URLSearchParams;n&&o.set(`workflowName`,n),r&&o.set(`status`,r),i?.limit&&o.set(`limit`,i.limit.toString()),i?.cursor&&o.set(`cursor`,i.cursor),i?.sortOrder&&o.set(`sortOrder`,i.sortOrder);let s=a===`none`?`lazy`:`resolve`;o.set(`remoteRefBehavior`,s);let c=o.toString(),l=await R({endpoint:`/v2/runs${c?`?${c}`:``}`,options:{method:`GET`},config:t,schema:zs(s===`lazy`?FT:PT)});return{...l,data:l.data.map(e=>IT(e,a))}}async function RT(e,t){return Zm(await R({endpoint:`/v1/runs/create`,options:{method:`POST`},data:e,config:t,schema:PT}))}async function zT(e,t,n){let r=t?.resolveData??`all`,i=r===`none`?`lazy`:`resolve`,s=new URLSearchParams;s.set(`remoteRefBehavior`,i);let c=s.toString(),l=`/v2/runs/${encodeURIComponent(e)}${c?`?${c}`:``}`;try{return IT(await R({endpoint:l,options:{method:`GET`},config:n,retryConnectTimeout:!0,schema:i===`lazy`?FT:PT}),r)}catch(t){throw t instanceof o&&t.status===404?new a(e):t}}async function BT(e,t,n){let r=[...new Set(e)],i=await Promise.all(r.map(async e=>{try{return await zT(e,t,n)}catch(e){if(e instanceof a)return null;throw e}})),o=new Map(r.map((e,t)=>[e,i[t]]));return e.map(e=>o.get(e)??null)}async function VT(e,t,n){let r=t?.resolveData??`all`,i=r===`none`?`lazy`:`resolve`,s=new URLSearchParams;s.set(`remoteRefBehavior`,i);let c=s.toString(),l=`/v1/runs/${encodeURIComponent(e)}/cancel${c?`?${c}`:``}`;try{return IT(await R({endpoint:l,options:{method:`PUT`},config:n,schema:i===`lazy`?FT:PT}),r)}catch(t){throw t instanceof o&&t.status===404?new a(e):t}}async function HT(e,t){let{runIds:n,cancelReason:r}=qa.parse(e),i=await R({endpoint:`/v4/runs/cancel`,options:{method:`POST`},data:r===void 0?{runIds:n}:{runIds:n,cancelReason:r},config:t,schema:Xt}),a=new Map(i.results.map(e=>[e.runId,e]));if(!(a.size===i.results.length&&i.results.length===n.length&&n.every(e=>a.has(e))))throw new o(`Bulk cancel response did not contain exactly one result per requested run ID (requested ${n.length}, received ${i.results.length}).`);let s=n.map(e=>a.get(e));return{summary:i.summary,results:s}}const UT=dc({attributes:nn(qt(),qt())});async function WT(e,t,n,r){try{return{attributes:(await R({endpoint:`/v2/runs/${encodeURIComponent(e)}/attributes`,options:{method:`POST`},data:n?.allowReservedAttributes?{changes:t,allowReservedAttributes:!0}:{changes:t},config:r,schema:UT})).attributes}}catch(t){throw t instanceof o&&t.status===404?new a(e):t}}const GT=no.omit({error:!0}).extend({error:Zr([rs,cr()]).optional(),errorRef:cr().optional()}),KT=GT.omit({input:!0,output:!0}).extend({inputRef:cr().optional(),outputRef:cr().optional(),input:vc(Uint8Array).optional(),output:vc(Uint8Array).optional()});function qT(e){let{error:t,errorRef:n,...r}=e,i={...r},a=t??n;return a!=null&&(i.error=a),i}function JT(e,t){if(t===`none`){let{inputRef:t,outputRef:n,...r}=e;return{...AT(qT(r)),input:void 0,output:void 0}}return AT(qT(e))}async function YT(e,t){let{runId:n,pagination:r,resolveData:i=`all`}=e,a=new URLSearchParams;r?.cursor&&a.set(`cursor`,r.cursor),r?.limit&&a.set(`limit`,r.limit.toString()),r?.sortOrder&&a.set(`sortOrder`,r.sortOrder);let o=i===`none`?`lazy`:`resolve`;a.set(`remoteRefBehavior`,o);let s=a.toString(),c=await R({endpoint:`/v2/runs/${encodeURIComponent(n)}/steps${s?`?${s}`:``}`,options:{method:`GET`},config:t,schema:zs(o===`lazy`?KT:GT)});return{...c,data:c.data.map(e=>JT(e,i))}}async function XT(e,t,n,r){let i=n?.resolveData??`all`,a=i===`none`?`lazy`:`resolve`,o=new URLSearchParams;o.set(`remoteRefBehavior`,a);let s=o.toString();return JT(await R({endpoint:`/v2/runs/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}${s?`?${s}`:``}`,options:{method:`GET`},config:r,schema:a===`lazy`?KT:GT}),i)}function ZT(e){let t=e.startsWith(`wrun_`)?e.slice(5):e;try{return fs(`wrun_${Jc(t).ulid}`,`wrun_`)}catch{return fs(e,`wrun_`)}}const QT=new Set([`run_created`,`run_started`,`step_started`]),$T=new Set([`run_failed`,`step_failed`,`step_retrying`]);function eE(e){let t=e.eventData??{},n=zn(e.eventType),r={};if(typeof t.deploymentId==`string`&&(r.deploymentId=t.deploymentId),typeof t.workflowName==`string`&&(r.workflowName=t.workflowName),typeof t.stepName==`string`&&(r.stepName=t.stepName),typeof t.attempt==`number`&&(r.attempt=t.attempt),t.resumeAt instanceof Date)r.resumeAt=t.resumeAt;else if(typeof t.resumeAt==`string`){let e=new Date(t.resumeAt);Number.isNaN(e.getTime())||(r.resumeAt=e)}if(t.retryAfter instanceof Date)r.retryAfter=t.retryAfter;else if(typeof t.retryAfter==`string`){let e=new Date(t.retryAfter);Number.isNaN(e.getTime())||(r.retryAfter=e)}typeof t.token==`string`&&(r.hookToken=t.token),t.tokenRetentionUntil instanceof Date&&(r.hookTokenRetentionUntil=t.tokenRetentionUntil),typeof t.isWebhook==`boolean`&&(r.hookIsWebhook=t.isWebhook),typeof t.isSystem==`boolean`&&(r.hookIsSystem=t.isSystem),typeof t.errorCode==`string`&&(r.errorCode=t.errorCode),typeof t.cancelReason==`string`&&(r.cancelReason=t.cancelReason),typeof t.ownerMessageId==`string`&&(r.ownerMessageId=t.ownerMessageId),t.executionContext!==void 0&&t.executionContext!==null&&typeof t.executionContext==`object`&&(r.executionContext=t.executionContext),t.attributes!==void 0&&t.attributes!==null&&typeof t.attributes==`object`&&(r.attributes=t.attributes),Array.isArray(t.changes)&&(r.changes=t.changes),t.writer!==void 0&&t.writer!==null&&typeof t.writer==`object`&&(r.writer=t.writer),typeof t.allowReservedAttributes==`boolean`&&(r.allowReservedAttributes=t.allowReservedAttributes),typeof t.encryptionPublicKey==`string`&&(r.encryptionPublicKey=t.encryptionPublicKey),typeof t.ttfs==`number`&&(r.ttfs=t.ttfs),typeof t.stso==`number`&&(r.stso=t.stso),typeof t.stepCount==`number`&&Number.isSafeInteger(t.stepCount)&&t.stepCount>0&&(r.stepCount=t.stepCount),typeof t.eventCount==`number`&&Number.isSafeInteger(t.eventCount)&&t.eventCount>0&&(r.eventCount=t.eventCount),typeof t.rsfs==`number`&&(r.rsfs=t.rsfs),typeof t.finalSchedulingReplay==`number`&&(r.finalSchedulingReplay=t.finalSchedulingReplay),Array.isArray(t.optimizations)&&t.optimizations.every(e=>typeof e==`string`)&&(r.optimizations=t.optimizations);let i;if(n&&n in t){let r=t[n];if(r!==void 0){if(!(r instanceof Uint8Array))throw TypeError(`world-vercel v4: eventData.${n} for ${e.eventType} must be a Uint8Array (the runtime's dehydrated wire form); got ${typeof r==`object`?r===null?`null`:r.constructor?.name??typeof r:typeof r}.`);i=r}}return{payload:i,meta:r}}function tE(e){return Vw(MT(e))}function nE(e){if(ET(e))return e;try{let t=qi.safeParse(qf(e.slice()));return t.success?t.data:e}catch{return e}}function rE(e,t,n){let r=e.eventData??{};if(t.byteLength>0){let n=zn(e.eventType),i=OT(t);n&&i instanceof Uint8Array&&(r[n]=$T.has(e.eventType)?nE(i):i)}let i=tE({eventId:e.eventId,runId:e.runId,eventType:e.eventType,createdAt:e.createdAt instanceof Date?e.createdAt:new Date(e.createdAt),...e.occurredAt===void 0?{}:{occurredAt:e.occurredAt instanceof Date?e.occurredAt:new Date(e.occurredAt)},...e.correlationId?{correlationId:e.correlationId}:{},eventData:r,...e.specVersion===void 0?{}:{specVersion:e.specVersion},...e.resumeId?{resumeId:e.resumeId}:{}});return n===`none`?Mt(i,`none`):i}async function iE(e,t,n,r){let i=n?.resolveData??`all`,{event:a,body:o}=await pT(e,t,r);return rE(a,o,i)}async function aE(e,t){let{pagination:n,resolveData:r=`all`}=e,i={cursor:n?.cursor??void 0,limit:n?.limit,sortOrder:n?.sortOrder,remoteRefBehavior:r===`none`?`lazy`:`resolve`},a=await(`correlationId`in e?yT(e.correlationId,e.runId,i,t):vT(e.runId,i,t)),o=a.events.map(e=>rE(e.event,e.body,r));return{data:`correlationId`in e?o.filter(t=>t.runId===e.runId):o,cursor:a.next??null,hasMore:typeof a.hasMore==`boolean`?a.hasMore:!!a.next}}async function oE(e,t,n,r){try{return await Xw(()=>sE(e,t,n,r),t.eventType,{idempotentHookResume:t.eventType===`hook_received`&&n?.resumeId!==void 0&&n?.resumePayloadDigest!==void 0})}catch(e){throw xr(t.eventType)&&o.is(e)&&e.status===404&&t.correlationId?new d(t.correlationId):e}}async function sE(e,t,n,r){if(n?.v1Compat){if(t.eventType===`run_cancelled`&&e)return{run:await VT(e,n,r)};if(t.eventType===`run_created`)return{run:await RT(t.eventData,r)};if(e===null)throw new o(`world-vercel: v1Compat=true requires a runId for ${t.eventType}`,{status:400});return{event:await R({endpoint:`/v1/runs/${encodeURIComponent(e)}/events`,options:{method:`POST`},data:t,config:r,schema:ht})}}if(e===null)throw new o(`world-vercel v4: createWorkflowRunEvent requires a client-generated runId for run_created (the runId is part of the payload storage ref key). Generate a wrun_ ULID before calling.`,{status:400});if(t.eventType===`run_created`){let t=ZT(e);if(t)throw new o(t,{status:400})}let i=QT.has(t.eventType)?`resolve`:`lazy`,{payload:a,meta:s}=eE(t),c=n?.resolveData??`all`,l={runId:e,eventType:t.eventType,specVersion:t.specVersion??2,...t.correlationId?{correlationId:t.correlationId}:{},...n?.requestId?{vercelId:n.requestId}:{},...n?.computeInstanceId?{computeInstanceId:n.computeInstanceId}:{},...n?.stateUpdatedAt===void 0?{}:{stateUpdatedAt:n.stateUpdatedAt},...n?.stateEventCount===void 0?{}:{stateEventCount:n.stateEventCount},...n?.stateCursor?{stateCursor:n.stateCursor}:{},...n?.replayDivergenceCount===void 0?{}:{replayDivergenceCount:n.replayDivergenceCount},occurredAt:n?.occurredAt??new Date,...n?.sinceCursor?{sinceCursor:n.sinceCursor}:{},...n?.skipPreload?{skipPreload:!0}:{},...n?.resumeId?{resumeId:n.resumeId}:{},...n?.resumePayloadDigest?{resumePayloadDigest:n.resumePayloadDigest}:{},remoteRefBehavior:i,payload:a,...s};if(t.eventType===`hook_received`&&n?.preloadEvents===!0&&n.resumeId!==void 0&&n.resumePayloadDigest!==void 0){let e=await dT({...l,remoteRefBehavior:`lazy`},r);if(e.kind===`materialized`)return cE(e.result,c);let{canonicalEventId:t,maxEvents:n,next:i,hasMore:a}=e,o=e.events.map(e=>rE(e.event,e.body,`all`)),s=o.find(e=>e.eventId===t),u=lE(o);return{...s?{event:s}:{},...u?{run:u}:{},events:o,cursor:i??null,hasMore:a??!0,...n===void 0?{}:{maxEvents:n}}}return cE(await lT(l,r),c)}function cE(e,t){let n=e.body;return{event:n.event?Mt(Vw(n.event),t):void 0,run:n.run?Zm(n.run):void 0,step:n.step?qT(n.step):void 0,hook:n.hook,wait:n.wait,events:n.events?n.events.map(Vw):void 0,cursor:n.cursor??void 0,hasMore:n.hasMore,...n.stepCreated?{stepCreated:!0}:{},...typeof n.maxEvents==`number`?{maxEvents:n.maxEvents}:{}}}function lE(e){let t=e.find(e=>e.eventType===`run_created`),n=e.find(e=>e.eventType===`run_started`);if(!t||!n)return;let r=t.eventData.attributes??{},i=n.createdAt;for(let t of e)t.eventType===`attr_set`&&(r=ei(r,t.eventData.changes),i=t.createdAt);return{runId:t.runId,status:`running`,deploymentId:t.eventData.deploymentId,workflowName:t.eventData.workflowName,specVersion:t.specVersion,executionContext:t.eventData.executionContext,input:t.eventData.input,attributes:r,encryptionPublicKey:t.eventData.encryptionPublicKey,startedAt:n.createdAt,createdAt:t.createdAt,updatedAt:i}}function uE(e,t){if(t===`none`){let{metadataRef:t,...n}=e;return n}return jT(e)}const dE=qo.omit({metadata:!0}).extend({metadataRef:Gd.any().optional()});async function fE(e,t){let{runId:n,pagination:r,resolveData:i=`all`}=e,a=new URLSearchParams;r?.limit&&a.set(`limit`,r.limit.toString()),r?.cursor&&a.set(`cursor`,r.cursor),r?.sortOrder&&a.set(`sortOrder`,r.sortOrder);let o=i===`none`?`lazy`:`resolve`;a.set(`remoteRefBehavior`,o),n&&a.set(`runId`,n);let s=a.toString(),c=await R({endpoint:`/v2/hooks${s?`?${s}`:``}`,options:{method:`GET`},config:t,schema:zs(o===`lazy`?dE:qo)});return{...c,data:c.data.map(e=>uE(e,i))}}async function pE(e,t,n){let r=t?.resolveData||`all`;return uE(await R({endpoint:`/v2/hooks/${encodeURIComponent(e)}`,options:{method:`GET`},config:n,schema:qo}),r)}async function mE(e,t){try{return await R({endpoint:`/v2/hooks/by-token?token=${encodeURIComponent(e)}`,options:{method:`GET`},config:t,schema:qo})}catch(t){throw o.is(t)&&t.status===404?new d(e):t}}function hE(e){let t={runs:{get:((t,n)=>zT(t,n,e)),getMany:((t,n)=>BT(t,n,e)),list:(t=>LT(t,e)),experimentalSetAttributes:(t,n,r)=>WT(t,n,r,e),cancelMany:t=>HT(t,e)},steps:{get:((t,n,r)=>XT(t,n,r,e)),list:(t=>YT(t,e))},events:{create:(t,n,r)=>oE(t,n,r,e),get:(t,n,r)=>iE(t,n,r,e),list:t=>aE(t,e),listByCorrelationId:t=>aE(t,e)},hooks:{get:(t,n)=>pE(t,n,e),getByToken:t=>mE(t,e),list:t=>fE(t,e)}};return{runs:Ah(`world.runs`,t.runs),steps:Ah(`world.steps`,t.steps),events:Ah(`world.events`,t.events),hooks:Ah(`world.hooks`,t.hooks)}}const gE=()=>Vc(`WORKFLOW_MAX_CHUNKS_PER_REQUEST`,1e3,{integer:!0,min:1});function _E(e,t,n){return new URL(`${n.baseUrl}/v2/runs/${encodeURIComponent(t)}/stream/${encodeURIComponent(e)}`)}function vE(e,t,n){return new URL(`${n.baseUrl}/v3/runs/${encodeURIComponent(t)}/stream/${encodeURIComponent(e)}`)}function yE(e){return{...Em(e.runId),...Om(e.name),...km(e.operation),...typeof e.startIndex==`number`?Am(e.startIndex):{}}}function bE(e,t,n,r){let i=[`PUT ${t.origin}${t.pathname}`,...Pm(n.headers)];return Error(`Stream ${e} failed: HTTP ${n.status} (${i.join(`; `)}): ${r}`)}function xE(e){let t=new TextEncoder,n=[],r=0;for(let i of e){let e=typeof i==`string`?t.encode(i):i;n.push(e),r+=4+e.length}let i=new Uint8Array(r),a=new DataView(i.buffer),o=0;for(let e of n)a.setUint32(o,e.length,!1),o+=4,i.set(e,o),o+=e.length;return i}const SE=dc({tailIndex:we(),done:ie()}),CE=dc({data:Be(dc({index:we(),data:vc(Uint8Array)})),cursor:qt().nullable(),hasMore:ie(),done:ie()});function wE(e){return{streams:{async write(t,n,r){let i=await t,a=await rh(e),o=_E(n,i,a);await(await Wm({method:`PUT`,url:o.toString(),body:r,headers:a.headers,dispatcher:Yp(e),timeoutMs:null,logLabel:o.pathname,spanName:`workflow.stream.write`,durationAttribute:`workflow.stream.write.chunk_rtt`,attributes:yE({runId:i,name:n,operation:`write`}),buildError:async e=>bE(`write`,o,e,await e.text())})).text()},async writeMulti(t,n,r){if(r.length===0)return;let i=await t,a=await rh(e);a.headers.set(`X-Stream-Multi`,`true`);let o=gE();for(let t=0;t<r.length;t+=o){let s=xE(r.slice(t,t+o)),c=_E(n,i,a);await(await Wm({method:`PUT`,url:c.toString(),body:s,headers:a.headers,dispatcher:Yp(e),timeoutMs:null,logLabel:c.pathname,spanName:`workflow.stream.write`,durationAttribute:`workflow.stream.write.chunk_rtt`,attributes:yE({runId:i,name:n,operation:`write_multi`}),buildError:async e=>bE(`write`,c,e,await e.text())})).text()}},async close(t,n){let r=await t,i=await rh(e);i.headers.set(`X-Stream-Done`,`true`);let a=_E(n,r,i);await(await Wm({method:`PUT`,url:a.toString(),headers:i.headers,dispatcher:Xp(e),timeoutMs:null,logLabel:a.pathname,spanName:`workflow.stream.write`,durationAttribute:`workflow.stream.write.chunk_rtt`,attributes:yE({runId:r,name:n,operation:`close`}),buildError:async e=>bE(`close`,a,e,await e.text())})).text()},async get(t,n,r){let i=await rh(e),a=vE(n,t,i);typeof r==`number`&&a.searchParams.set(`startIndex`,String(r));let o=await Wm({method:`GET`,url:a.toString(),headers:i.headers,dispatcher:void 0,timeoutMs:null,logLabel:a.pathname,spanName:`workflow.stream.read.connect`,attributes:yE({runId:t,name:n,operation:`read`,startIndex:r}),buildError:e=>Error(`Failed to fetch stream: ${e.status}`)});if(!o.body)throw Error(`No response body for stream`);return o.body},async getChunks(t,n,r){let i=new URLSearchParams;r?.limit!=null&&i.set(`limit`,String(r.limit)),r?.cursor&&i.set(`cursor`,r.cursor);let a=i.toString();return R({endpoint:`/v2/runs/${encodeURIComponent(t)}/streams/${encodeURIComponent(n)}/chunks${a?`?${a}`:``}`,config:e,schema:CE})},async getInfo(t,n){return R({endpoint:`/v2/runs/${encodeURIComponent(t)}/streams/${encodeURIComponent(n)}/info`,config:e,schema:SE})},async list(t){let n=await rh(e),r=new URL(`${n.baseUrl}/v2/runs/${encodeURIComponent(t)}/streams`);return await(await Wm({method:`GET`,url:r.toString(),headers:n.headers,dispatcher:void 0,timeoutMs:null,logLabel:r.pathname,buildError:e=>Error(`Failed to list streams: ${e.status}`)})).json()}}}}function TE(e){let t=e?.projectConfig?.projectId||process.env.VERCEL_PROJECT_ID;return{specVersion:5,capabilities:{preconditionGuard:!0,maxConcurrency:!0,deploymentAffinity:!0},processExitTriggersQueueRedelivery:!0,getRuntimeDeadline:xh,...Rw(e),...hE(e),analytics:process.env.WORKFLOW_DISABLE_ANALYTICS_READS===`1`?void 0:lh(e),...Ah(`world.streams`,wE(e)),createRunId:hh,describeRun:_h,getEnvironment:()=>th(e),getEncryptionKeyForRun:bh(t,e?.projectConfig?.teamId,e?.token,e?.dispatcher),resolveLatestDeploymentId:Bw(e)}}export{lh as createAnalytics,bh as createGetEncryptionKeyForRun,Rw as createQueue,hh as createRunId,hE as createStorage,wE as createStreamer,TE as createWorld,vh as deriveRunKey,_h as describeRun,yh as fetchRunKey,gh as regionForRunId};
42
+ Cause: ${t}`)}}buildUrl(e,...t){let n=encodeURIComponent(e),r=t.map(e=>encodeURIComponent(e)),i=r.length>0?`/`+r.join(`/`):``,a=this.baseUrl.pathname.replace(/\/+$/,``);return`${this.baseUrl.origin}${a}${_w}/${n}${i}`}async fetch(e,t){let n=t.method||`GET`;if(cw()){let r={method:n,url:e,headers:t.headers},i=t.body;i!=null&&(i instanceof ArrayBuffer||i instanceof Uint8Array?r.bodySize=i.byteLength:typeof i==`string`?r.bodySize=i.length:r.bodyType=typeof i),console.debug(`[VQS Debug] Request:`,JSON.stringify(r,null,2))}t.headers.set(`User-Agent`,`@vercel/queue/0.4.0`),t.headers.set(`Vqs-Client-Ts`,new Date().toISOString());let r=this.dispatcher?{...t,dispatcher:this.dispatcher}:t,i=await fetch(e,r);if(cw()){let t={method:n,url:e,status:i.status,statusText:i.statusText,headers:i.headers};console.debug(`[VQS Debug] Response:`,JSON.stringify(t,null,2))}return i}async sendMessage(e){let t=this.transport,{queueName:n,payload:r,idempotencyKey:i,retentionSeconds:a,delaySeconds:o,headers:s,telemetry:c}=e,l=new Headers;if(this.customHeaders)for(let[e,t]of Object.entries(this.customHeaders))l.append(e,t);if(s){let e=new Set([`authorization`,`content-type`]),t=t=>{let n=t.toLowerCase();return e.has(n)?!0:n.startsWith(`vqs-`)};for(let[e,n]of Object.entries(s))!t(e)&&n!==void 0&&l.append(e,n)}l.set(`Authorization`,`Bearer ${await this.getToken()}`),l.set(`Content-Type`,t.contentType);let u=this.getSendDeploymentId();u&&l.set(`Vqs-Deployment-Id`,u),i&&l.set(`Vqs-Idempotency-Key`,i),a!==void 0&&l.set(`Vqs-Retention-Seconds`,a.toString()),o!==void 0&&l.set(`Vqs-Delay-Seconds`,o.toString());let d=t.serialize(r),f=Buffer.isBuffer(d)?new Uint8Array(d):d,p=qC(this.telemetry,c);return tw(n,async e=>{await QC(l,p);let t=await this.fetch(this.buildUrl(n),{method:`POST`,body:f,headers:l});if(!t.ok){let e=await t.text();if(t.status===409)throw new NS(e||`Duplicate idempotency key detected`,i);if(t.status===502)throw new PS(e||`Consumer discovery failed`,u);if(t.status===503)throw new FS(e||`Consumer registry not configured`);dw(t.status,t.statusText,e,`send message`)}if(t.status===202)return await t.text(),{messageId:null};let r=await t.json();return e&&r.messageId&&e.setMessageId(r.messageId),r},p)}async*receiveMessages(e){let t=this.transport,{queueName:n,consumerGroup:r,visibilityTimeoutSeconds:i,limit:a}=e;if(a!==void 0&&(a<1||a>10))throw new jS(a);let o=new Headers({Authorization:`Bearer ${await this.getToken()}`,Accept:`multipart/mixed`,...this.customHeaders});i!==void 0&&o.set(`Vqs-Visibility-Timeout-Seconds`,i.toString()),a!==void 0&&o.set(`Vqs-Max-Messages`,a.toString());let s=this.getConsumeDeploymentId();s&&o.set(`Vqs-Deployment-Id`,s);let c=await this.fetch(this.buildUrl(n,`consumer`,r),{method:`POST`,headers:o});if(c.status===204){await c.text();return}if(!c.ok){let e=await c.text();dw(c.status,c.statusText,e,`receive messages`)}for await(let e of Uh(c))try{let n=fw(e.headers);if(!n){console.warn(`Missing required queue headers in multipart part`),await lw(e.payload);continue}let r=await t.deserialize(e.payload);yield{...n,payload:r}}catch(t){console.warn(`Failed to process multipart message:`,t),await lw(e.payload)}}async receiveMessageById(e){let t=this.transport,{queueName:n,consumerGroup:r,messageId:i,visibilityTimeoutSeconds:a}=e,o=new Headers({Authorization:`Bearer ${await this.getToken()}`,Accept:`multipart/mixed`,...this.customHeaders});a!==void 0&&o.set(`Vqs-Visibility-Timeout-Seconds`,a.toString());let s=this.getConsumeDeploymentId();s&&o.set(`Vqs-Deployment-Id`,s);let c=await this.fetch(this.buildUrl(n,`consumer`,r,`id`,i),{method:`POST`,headers:o});if(!c.ok){let e=await c.text();if(c.status===404)throw new CS(i);if(c.status===409){let t={};try{t=JSON.parse(e)}catch{}throw t.originalMessageId?new wS(i,`This message was a duplicate - use originalMessageId: ${t.originalMessageId}`):new wS(i)}if(c.status===410)throw new MS(i);dw(c.status,c.statusText,e,`receive message by ID`)}for await(let e of Uh(c)){let n=fw(e.headers);if(!n)throw await lw(e.payload),new TS(i,`Missing required queue headers in response`);let r=await t.deserialize(e.payload);return{message:{...n,payload:r}}}throw new CS(i)}async acknowledgeMessage(e){let{queueName:t,consumerGroup:n,receiptHandle:r}=e,i=new Headers({Authorization:`Bearer ${await this.getToken()}`,...this.customHeaders}),a=this.getConsumeDeploymentId();a&&i.set(`Vqs-Deployment-Id`,a);let o=await this.fetch(this.buildUrl(t,`consumer`,n,`lease`,r),{method:`DELETE`,headers:i});if(!o.ok){let e=await o.text();if(o.status===404)throw new CS(r);if(o.status===409)throw new wS(r,e||`Invalid receipt handle, message not in correct state, or already processed`);dw(o.status,o.statusText,e,`acknowledge message`,`Missing or invalid receipt handle`,o.headers?.get(`Retry-After`)??null)}return await o.text(),{acknowledged:!0}}async changeVisibility(e){let{queueName:t,consumerGroup:n,receiptHandle:r,visibilityTimeoutSeconds:i}=e,a=new Headers({Authorization:`Bearer ${await this.getToken()}`,"Content-Type":`application/json`,...this.customHeaders}),o=this.getConsumeDeploymentId();o&&a.set(`Vqs-Deployment-Id`,o);let s=await this.fetch(this.buildUrl(t,`consumer`,n,`lease`,r),{method:`PATCH`,headers:a,body:JSON.stringify({visibilityTimeoutSeconds:i})});if(!s.ok){let e=await s.text();if(s.status===404)throw new CS(r);if(s.status===409)throw new wS(r,e||`Invalid receipt handle, message not in correct state, or already processed`);dw(s.status,s.statusText,e,`change visibility`,`Missing receipt handle or invalid visibility timeout`,s.headers?.get(`Retry-After`)??null)}return await s.text(),{success:!0}}},yw=new WeakMap,bw=Symbol.for(`@vercel/queue.apiClient`);function xw(e,t){yw.set(e,t),Object.defineProperty(e,bw,{value:t,writable:!1,enumerable:!1,configurable:!1})}function Sw(e){let t=yw.get(e);if(t)return t;let n=e[bw];if(typeof n==`object`&&n){let t=n;return yw.set(e,t),t}throw Error(`QueueClient not initialized. This may happen when multiple bundled copies of @vercel/queue are loaded in local dev.`)}function Cw(e){return`request`in e?e.request:e}function ww(e){return Sw(e)}var Tw=`iad1`;function Ew(e){return e||process.env.VERCEL_REGION||(aC()||console.warn(`[QueueClient] Region not detected \u2014 defaulting to "${Tw}". On Vercel this is set automatically via VERCEL_REGION. To silence this warning, pass region explicitly: new QueueClient({ region: "iad1" })`),Tw)}var Dw=class{constructor(e={}){let t=Ew(e.region);xw(this,new vw({...e,region:t}))}send=async(e,t,n)=>{let r=Sw(this),i=await r.sendMessage({queueName:e,payload:t,idempotencyKey:n?.idempotencyKey,retentionSeconds:n?.retentionSeconds,delaySeconds:n?.delaySeconds,headers:n?.headers,telemetry:n?.telemetry});return i.messageId&&aC()&&GC(e,i.messageId,r.getRegion(),n?.delaySeconds,n?.retentionSeconds),{messageId:i.messageId}};handleCallback=(e,t)=>{aC()&&xC(e,this,t);let n=qC(Sw(this).getTelemetry?.());return async r=>{let i=Cw(r);if(aC()&&i.headers.get(`x-vercel-queue-prime`)===`1`){let n=i.headers.get(`x-vercel-queue-prime-file`);return n&&xC(e,this,t,n),Response.json({status:`primed`})}try{let r=await eC(i);return await aw(i.headers,()=>tC(e,r,{client:this,visibilityTimeoutSeconds:t?.visibilityTimeoutSeconds,retry:t?.retry}),n),Response.json({status:`success`})}catch(e){return console.error(`Queue callback error:`,e),e instanceof Error&&(e.message.includes(`Invalid content type`)||e.message.includes(`Invalid CloudEvent`)||e.message.includes(`Missing required CloudEvent`)||e.message.includes(`Failed to parse CloudEvent`)||e.message.includes(`Binary mode callback`))?Response.json({error:e.message},{status:400}):Response.json({error:`Failed to process queue message`},{status:500})}}};handleNodeCallback=(e,t)=>{aC()&&xC(e,this,t);let n=qC(Sw(this).getTelemetry?.());return async(r,i)=>{if(r.method!==`POST`){i.status(200).end();return}let a=r.headers[`x-vercel-queue-prime`];if(aC()&&a===`1`){let n=r.headers[`x-vercel-queue-prime-file`],a=Array.isArray(n)?n[0]:n;a&&xC(e,this,t,a),i.status(200).json({status:`primed`});return}try{let a=$S(r.body,r.headers);await aw(r.headers,()=>tC(e,a,{client:this,visibilityTimeoutSeconds:t?.visibilityTimeoutSeconds,retry:t?.retry}),n),i.status(200).json({status:`success`})}catch(e){if(console.error(`Queue callback error:`,e),e instanceof Error&&(e.message.includes(`Invalid content type`)||e.message.includes(`Invalid CloudEvent`)||e.message.includes(`Missing required CloudEvent`)||e.message.includes(`Failed to parse CloudEvent`)||e.message.includes(`Binary mode callback`))){i.status(400).json({error:e.message});return}i.status(500).json({error:`Failed to process queue message`})}}}};function Ow(e){return`${e} requires VERCEL_DEPLOYMENT_ID, which Vercel sets in every deployment, so this process is not running inside one. The Vercel world is only selected automatically when that variable is set, so it was requested explicitly here — most often by WORKFLOW_TARGET_WORLD=vercel in a process that is not a deployment, such as a production server started locally or in CI. To use the local filesystem world instead, set WORKFLOW_TARGET_WORLD=local or unset it.`}var kw=class{contentType=`application/cbor`;serialize(e){return Buffer.from(hp(e))}async deserialize(e){let t=[],n=e.getReader();for(;;){let{done:e,value:r}=await n.read();if(e)break;r&&t.push(r)}return Hf(Buffer.concat(t))}},Aw=class{contentType=`application/json`;serialize(e){return Buffer.from(JSON.stringify(e))}async deserialize(e){let t=[],n=e.getReader();for(;;){let{done:e,value:r}=await n.read();if(e)break;r&&t.push(r)}return JSON.parse(Buffer.concat(t).toString())}},jw=class{contentType=`application/cbor`;serialize(e){return Buffer.from(hp(e))}async deserialize(e){let t=[],n=e.getReader();for(;;){let{done:e,value:r}=await n.read();if(e)break;r&&t.push(r)}let r=Buffer.concat(t);try{return Hf(r)}catch{return JSON.parse(r.toString())}}};const Mw=new yl,Nw=Wa({payload:Mc,queueName:Lc,deploymentId:ct().optional()}),Pw=Number(process.env.VERCEL_QUEUE_MAX_DELAY_SECONDS||82800);function Fw(e){let t=Math.min(Math.max(1,2**(e-1)),900),n=Math.floor(Math.random()*(Math.ceil(t*.25)+1));return Math.max(1,t-n)}function Iw(e){if(`runId`in e&&typeof e.runId==`string`)return e.runId}function Lw(e){if(!e)return;let t=e.startsWith(`wrun_`)?e.slice(5):e;try{let e=gh(t);return!e.tagged||e.regionId===uh.unknown?void 0:e.region??void 0}catch{return}}function Rw(e,t){if(ph(t?.region))return t.region;let n=Lw(Iw(e));if(n)return n;let r=process.env.VERCEL_REGION;return ph(r)?r:`iad1`}function zw(e){let t={};return`runId`in e&&typeof e.runId==`string`&&(t[`x-vercel-workflow-run-id`]=e.runId),`stepId`in e&&typeof e.stepId==`string`&&(t[`x-vercel-workflow-step-id`]=e.stepId),Object.keys(t).length>0?t:void 0}const Bw=/^__([a-z][a-z0-9]*_)?wkf_workflow_/;let Vw=!1;function Hw(){return process.env.WORKFLOW_SEQUENTIAL_REPLAYS===`1`}function Uw(e,t){return!Hw()||!Bw.test(e)?e:(Vw||(Vw=!0,console.warn(`[workflow] WORKFLOW_SEQUENTIAL_REPLAYS=1: routing flow messages to per-run queue topics`)),`__healthCheck`in t&&typeof t.correlationId==`string`?`${e}_${t.correlationId}`:`runId`in t&&typeof t.runId==`string`?`stepId`in t&&typeof t.stepId==`string`?`${e}_${t.runId}_${t.stepId}`:`${e}_${t.runId}`:e)}function Ww(e){let{baseUrl:t,usingProxy:n}=Xm(e),r=Qm(e,{usingProxy:n}),i=new kw,a=new Aw,o=new jw,s={dispatcher:Hp(e),transport:o,...n&&{resolveBaseUrl:()=>new URL(`${t}/queues-proxy`),token:e?.token},headers:Object.fromEntries(r.entries())},c=async(e,t,r)=>{let o=r?.deploymentId??process.env.VERCEL_DEPLOYMENT_ID;if(!o)throw Error(`${Ow(`Enqueuing a workflow message`)} Callers outside a deployment can instead pass an explicit deploymentId in options.`);let c=(r?.specVersion??5)>=3?i:a,l=Rw(t,r),u=new Dw({...s,...n&&{headers:{...s.headers,"x-vercel-queue-region":l}},region:l,deploymentId:o,transport:c}),d={payload:t,queueName:e,deploymentId:r?.deploymentId},f=Uw(e,t).replace(/[^A-Za-z0-9-_]/g,`-`);try{let{messageId:e}=await u.send(f,d,{idempotencyKey:r?.idempotencyKey,delaySeconds:r?.delaySeconds,headers:{...zw(t),...r?.headers}});return{messageId:e?Tc.parse(e):null}}catch(e){if(e instanceof NS)return{messageId:Tc.parse(`msg_duplicate_${e.idempotencyKey??r?.idempotencyKey??`unknown`}`)};throw e}};return{queue:c,createQueueHandler:(e,t)=>{let n=new Dw(s).handleCallback(async(e,n)=>{if(!e||!n)return;let r=Mw.getStore(),{payload:i,queueName:a,deploymentId:o}=Nw.parse(e),s=await t(i,{queueName:a,messageId:Tc.parse(n.messageId),attempt:n.deliveryCount,requestId:r});if(typeof s?.timeoutSeconds==`number`){let e=s.timeoutSeconds>0?Math.min(s.timeoutSeconds,Pw):void 0;await c(a,i,{deploymentId:o,delaySeconds:e})}},{retry:(e,{messageId:t,deliveryCount:n})=>{let r=Fw(n);return console.error(`[workflow] Queue handler failed for message "${t}" on delivery attempt ${n}; retrying in ${r}s:`,e),{afterSeconds:r}}});return async e=>{let t=e.headers.get(`x-vercel-id`)?.trim()||void 0;return Mw.run(t,()=>n(e))}},getDeploymentId:async()=>{let e=process.env.VERCEL_DEPLOYMENT_ID;if(!e)throw Error(Ow(`Starting a workflow run`));return e},isDeploymentUnavailableError:e=>e instanceof PS}}const Gw=Wa({id:ct()});function Kw(e){return async function(){let t=process.env.VERCEL_DEPLOYMENT_ID;if(!t)throw Error(Ow(`Resolving the latest deployment for deploymentId: 'latest'`));let n=await Lm(e);if(!n)throw Error(`Cannot resolve latest deployment: no OIDC token or VERCEL_TOKEN available`);let r=await(await Bm({method:`GET`,url:`https://api.vercel.com/v1/workflow/resolve-latest-deployment/${encodeURIComponent(t)}`,headers:new Headers({Authorization:`Bearer ${n}`}),dispatcher:Hp(e),peerService:`vercel-api`,timeoutMs:null,buildError:async e=>{let n;try{n=await e.text()}catch{n=`<unable to read response body>`}return Error(`Failed to resolve latest deployment for ${t}: HTTP ${e.status} ${e.statusText}${n?` — ${n}`:``}`)}})).json(),i=Gw.safeParse(r);if(!i.success)throw Error(`Invalid response from Vercel API: expected { id: string }. Zod error: ${i.error.message}`);return i.data.id}}function qw(e){let t=vc.safeParse(e);return t.success?t.data:(_c.safeParse(e.eventType).success&&console.debug(`[workflow:world-vercel] v4 event ${e.eventId} failed EventSchema parse for known eventType '${e.eventType}'; passing through unparsed: ${t.error.message}`),e)}const Jw={run_created:{retryable:!0,reason:`conditional create → 409 if exists`},step_created:{retryable:!0,reason:`conditional create → 409 if exists`},wait_created:{retryable:!0,reason:`conditional create → 409 if exists`},hook_created:{retryable:!0,reason:`transactional token uniqueness → 409 if exists`},run_started:{retryable:!0,reason:`early-returns if already running, no duplicate row`},run_completed:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},run_failed:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},run_cancelled:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},step_completed:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},step_failed:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},wait_completed:{retryable:!0,reason:`waiting-state guard → 409, no duplicate row`},hook_disposed:{retryable:!0,reason:`conditional delete (exists) → 409, no duplicate row`},attr_set:{retryable:!0,reason:`correlationId constraint reuses eventId (idempotent replay)`},step_started:{retryable:!1,reason:`unconditional attempt increment → a retry double-counts attempts`},step_retrying:{retryable:!1,reason:`no duplicate guard → a retry appends a second event row`},hook_received:{retryable:!1,reason:`no server guard → a retry duplicates the row / re-delivers payload. EXCEPTION: the atomic lazy-resume shape (resumeId + digest) is deduplicated server-side by the (runId, resumeId) claim, so those writes opt in via withEventPostRetry({ idempotentHookResume })`},hook_conflict:{retryable:!1,reason:`server-originated; never POSTed by the SDK`}},Yw=new Set([`ECONNRESET`,`ECONNREFUSED`,`ENOTFOUND`,`ENETDOWN`,`ENETUNREACH`,`EHOSTDOWN`,`EHOSTUNREACH`,`EPIPE`,`ETIMEDOUT`,`UND_ERR_SOCKET`,`UND_ERR_REQ_RETRY`,`UND_ERR_CONNECT_TIMEOUT`,`UND_ERR_HEADERS_TIMEOUT`,`UND_ERR_BODY_TIMEOUT`,`TimeoutError`,`RequestRetryError`]);function Xw(e,t=0){if(t>5||typeof e!=`object`||!e)return[];let n=[],r=e;return typeof r.code==`string`&&n.push(r.code),typeof r.name==`string`&&n.push(r.name),r.cause&&n.push(...Xw(r.cause,t+1)),n}function Zw(e){if(f.is(e)||l.is(e)||s.is(e)||u.is(e))return!1;if(o.is(e)){if(e.code===`PARSE_ERROR`)return!0;if(typeof e.status==`number`)return e.status>=500&&e.status<=599}return Xw(e).some(e=>Yw.has(e))}const Qw=e=>new Promise(t=>setTimeout(t,e)),$w=typeof process<`u`&&typeof process.env.DEBUG==`string`&&(process.env.DEBUG.includes(`workflow:`)||process.env.DEBUG===`*`);function eT(e,t){if(!$w)return;let n=Object.entries(t).map(([e,t])=>`${e}=${t}`).join(` `);console.debug(`[workflow:world-vercel:event-retry] ${e} ${n}`)}function tT(e){return o.is(e)?e.code??(e.status==null?e.name:`status_${e.status}`):Xw(e)[0]??(e instanceof Error?e.name:`unknown`)}async function nT(e,t,n){let r=t===`hook_received`&&n?.idempotentHookResume===!0||(Jw[t]?.retryable??!1);for(let n=0;;n++)try{return await e()}catch(e){let i=r&&Zw(e);if(i&&n<2){let r=100*2**n+Math.floor(Math.random()*50);eT(`retrying event POST after transient failure`,{eventType:t,attempt:n+1,backoffMs:r,error:tT(e)}),await Qw(r);continue}throw i&&eT(`exhausted in-process retries; surfacing for queue redelivery`,{eventType:t,attempts:n+1,error:tT(e)}),e}}const rT=`application/vnd.workflow.v4-frames`;function iT(e,t){let n=new Uint8Array(hp(e)),r=new Uint8Array(4+n.byteLength+4+t.byteLength),i=new DataView(r.buffer);return i.setUint32(0,n.byteLength,!1),r.set(n,4),i.setUint32(4+n.byteLength,t.byteLength,!1),r.set(t,4+n.byteLength+4),r}async function*aT(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():sT(e.getReader()),n=new Uint8Array,r=async e=>{for(;n.byteLength<e;){let{done:e,value:r}=await t.next();if(e)return!1;if(!r||r.byteLength===0)continue;let i=new Uint8Array(n.byteLength+r.byteLength);i.set(n,0),i.set(r,n.byteLength),n=i}return!0},i=e=>{let t=n.subarray(0,e);return n=n.subarray(e),t};try{for(;;){if(!await r(4))return;let e=new DataView(n.buffer,n.byteOffset,4).getUint32(0,!1);if(i(4),!await r(e))throw Error(`decodeFrames: truncated meta block`);let t=Hf(i(e));if(!await r(4))throw Error(`decodeFrames: truncated body length`);let a=new DataView(n.buffer,n.byteOffset,4).getUint32(0,!1);if(i(4),a>0&&!await r(a))throw Error(`decodeFrames: truncated body bytes`);if(yield{meta:t,body:n.slice(0,a)},i(a),t._end===1)return}}finally{oT(()=>t.return?.())}}function oT(e){try{Promise.resolve(e()).catch(()=>{})}catch{}}async function*sT(e){try{for(;;){let{done:t,value:n}=await e.read();if(t)return;n&&(yield n)}}finally{oT(()=>e.cancel())}}async function cT(e,t,n,r){return Bm({method:t.method,url:e,headers:t.headers,body:t.body,dispatcher:Up(n),timeoutMs:null,logLabel:r,buildError:async t=>fT(t.status,lT(t.headers),await t.text(),r,e)})}function lT(e){let t={};return e.forEach((e,n)=>{t[n]=e}),t}const uT={eventId:`x-wf-event-id`,runId:`x-wf-run-id`,createdAt:`x-wf-created-at`,maxEvents:`x-wf-max-events`};function dT(e){let t={eventType:e.eventType,specVersion:e.specVersion};return e.correlationId!==void 0&&(t.correlationId=e.correlationId),e.vercelId!==void 0&&(t.vercelId=e.vercelId),e.computeInstanceId!==void 0&&(t.computeInstanceId=e.computeInstanceId),e.occurredAt!==void 0&&(t.occurredAt=e.occurredAt),e.remoteRefBehavior!==void 0&&(t.remoteRefBehavior=e.remoteRefBehavior),e.deploymentId!==void 0&&(t.deploymentId=e.deploymentId),e.workflowName!==void 0&&(t.workflowName=e.workflowName),e.stepName!==void 0&&(t.stepName=e.stepName),e.attempt!==void 0&&(t.attempt=e.attempt),e.resumeAt!==void 0&&(t.resumeAt=e.resumeAt),e.retryAfter!==void 0&&(t.retryAfter=e.retryAfter),e.hookToken!==void 0&&(t.hookToken=e.hookToken),e.hookTokenRetentionUntil!==void 0&&(t.hookTokenRetentionUntil=e.hookTokenRetentionUntil),e.hookIsWebhook!==void 0&&(t.hookIsWebhook=e.hookIsWebhook),e.hookIsSystem!==void 0&&(t.hookIsSystem=e.hookIsSystem),e.resumeId!==void 0&&(t.resumeId=e.resumeId),e.errorCode!==void 0&&(t.errorCode=e.errorCode),e.cancelReason!==void 0&&(t.cancelReason=e.cancelReason),e.ownerMessageId!==void 0&&(t.ownerMessageId=e.ownerMessageId),e.executionContext!==void 0&&(t.executionContext=e.executionContext),e.attributes!==void 0&&(t.attributes=e.attributes),e.changes!==void 0&&(t.changes=e.changes),e.writer!==void 0&&(t.writer=e.writer),e.allowReservedAttributes!==void 0&&(t.allowReservedAttributes=e.allowReservedAttributes),e.encryptionPublicKey!==void 0&&(t.encryptionPublicKey=e.encryptionPublicKey),e.ttfs!==void 0&&(t.ttfs=e.ttfs),e.stso!==void 0&&(t.stso=e.stso),e.stepCount!==void 0&&(t.stepCount=e.stepCount),e.eventCount!==void 0&&(t.eventCount=e.eventCount),e.rsfs!==void 0&&(t.rsfs=e.rsfs),e.finalSchedulingReplay!==void 0&&(t.finalSchedulingReplay=e.finalSchedulingReplay),e.optimizations!==void 0&&(t.optimizations=e.optimizations),e.sinceCursor!==void 0&&(t.sinceCursor=e.sinceCursor),e.skipPreload!==void 0&&(t.skipPreload=e.skipPreload),e.stateUpdatedAt!==void 0&&(t.stateUpdatedAt=e.stateUpdatedAt),e.stateEventCount!==void 0&&(t.stateEventCount=e.stateEventCount),e.stateCursor!==void 0&&(t.stateCursor=e.stateCursor),e.replayDivergenceCount!==void 0&&(t.replayDivergenceCount=e.replayDivergenceCount),e.resumePayloadDigest!==void 0&&(t.resumePayloadDigest=e.resumePayloadDigest),t}function fT(e,t,n,r,i){let a=`v4 ${r} failed: HTTP ${e}`,o,s;try{let t=JSON.parse(n);typeof t.message==`string`&&(a=t.message),typeof t.code==`string`&&(o=t.code),e===412&&(s=pT(t))}catch{n&&(a+=` ${n}`)}let c=Pm(vT(t,`retry-after`));return Fm(e,a,{retryAfter:c,code:o,url:i,mitigated:vT(t,`x-vercel-mitigated`),...s===void 0?{}:{details:s}})}function pT(e){if(!Array.isArray(e.events)||e.events.length===0)return;let t=[];for(let n of e.events){if(typeof n!=`object`||!n)return;let e=n;if(typeof e.eventId!=`string`||mT(e))return;t.push(qw(e))}return{events:t,...typeof e.cursor==`string`?{cursor:e.cursor}:{}}}function mT(e){let t=e.eventType;if(typeof t!=`string`)return!1;let n=xc(t);if(!n)return!1;let r=e.eventData;if(typeof r!=`object`||!r)return!1;let i=r[n];return i!==void 0&&!(i instanceof Uint8Array)}async function hT(e,t){let{baseUrl:n,headers:r}=await $m(t),i=new Headers(r);i.set(`Content-Type`,`application/octet-stream`);let a=iT(dT(e),e.payload??new Uint8Array);return gT(await cT(`${n}/v4/runs/${encodeURIComponent(e.runId)}/events/${encodeURIComponent(e.eventType)}`,{method:`POST`,headers:i,body:a},t,`createEvent`))}async function gT(e){let t=e.headers.get(uT.eventId),n=e.headers.get(uT.runId),r=e.headers.get(uT.createdAt);if(typeof t!=`string`||typeof n!=`string`||typeof r!=`string`)throw Error(`v4 createEvent: response missing required x-wf-* headers`);let i=new Uint8Array(await e.arrayBuffer());return{eventId:t,runId:n,createdAt:r,body:i.byteLength>0?Hf(i):{}}}async function _T(e,t){let{baseUrl:n,headers:r}=await $m(t),i=new Headers(r);i.set(`Content-Type`,`application/octet-stream`),i.set(`Accept`,rT);let a=iT(dT(e),e.payload??new Uint8Array),o=await cT(`${n}/v4/runs/${encodeURIComponent(e.runId)}/events/${encodeURIComponent(e.eventType)}`,{method:`POST`,headers:i,body:a},t,`createEvent`);if(!o.headers.get(`content-type`)?.startsWith(`application/vnd.workflow.v4-frames`))return{kind:`materialized`,result:await gT(o)};let s=await xT(o,`createEvent`),c=o.headers.get(uT.maxEvents),l=c===null?NaN:Number(c);return{kind:`stream`,...s,canonicalEventId:o.headers.get(uT.eventId)??void 0,maxEvents:Number.isInteger(l)&&l>0?l:void 0}}function vT(e,t){let n=e[t];if(typeof n==`string`)return n;if(Array.isArray(n)&&n.length>0)return n[0]}async function yT(e,t,n){let{baseUrl:r,headers:i}=await $m(n),a=await cT(`${r}/v4/runs/${encodeURIComponent(e)}/events/${encodeURIComponent(t)}`,{method:`GET`,headers:i},n,`getEvent`),o=a.headers.get(`content-type`);if(!o?.startsWith(`application/vnd.workflow.v4-frames`))throw Error(`v4 getEvent: expected ${rT}, got ${o??`(none)`}`);let s=a.body;for await(let e of aT(s))return{event:e.meta,body:e.body};throw Error(`v4 getEvent: empty frame stream for ${t}`)}async function bT(e,t,n,r){return xT(await cT(e,{method:`GET`,headers:t},n,r),r)}async function xT(e,t){let n=e.headers.get(`content-type`);if(!n?.startsWith(`application/vnd.workflow.v4-frames`))throw Error(`v4 ${t}: expected ${rT}, got ${n??`(none)`}`);let r=e.body,i=[],a,o,s=!1;for await(let e of aT(r)){if(e.meta._end===1){typeof e.meta.next==`string`&&(a=e.meta.next),typeof e.meta.hasMore==`boolean`&&(o=e.meta.hasMore),s=!0;break}i.push({event:e.meta,body:e.body})}if(!s)throw Error(`v4 ${t}: frame stream ended without the end-of-stream sentinel (${i.length} events read) — truncated response?`);return{events:i,...a?{next:a}:{},...o===void 0?{}:{hasMore:o}}}function ST(e,t){t.cursor&&e.set(`cursor`,t.cursor),t.limit!==void 0&&e.set(`limit`,String(t.limit)),t.sortOrder&&e.set(`sortOrder`,t.sortOrder),t.remoteRefBehavior&&e.set(`remoteRefBehavior`,t.remoteRefBehavior)}function CT(e){let t=new URLSearchParams;ST(t,e);let n=t.toString();return n?`?${n}`:``}async function wT(e,t={},n){let{baseUrl:r,headers:i}=await $m(n);return bT(`${r}/v4/runs/${encodeURIComponent(e)}/events`+CT(t),i,n,`listEvents`)}async function TT(e,t,n={},r){let{baseUrl:i,headers:a}=await $m(r),o=new URLSearchParams;return o.set(`correlationId`,e),o.set(`runId`,t),ST(o,n),bT(`${i}/v4/events?${o.toString()}`,a,r,`listEventsByCorrelationId`)}const ET=`gzip`,DT=`zstd`,OT=new TextDecoder,kT=new Set([`devl`,`encr`,ET,DT]);function AT(){try{return globalThis.process?.getBuiltinModule?.(`node:zlib`)}catch{return}}function jT(e){return!(e instanceof Uint8Array)||e.byteLength<4?null:OT.decode(e.subarray(0,4))}function MT(e){let t=jT(e);return t!==null&&kT.has(t)}function NT(e,t){let n=AT(),r=e===DT?n?.zstdDecompressSync:n?.gunzipSync;if(!r)throw new o(`Received ${e}-compressed workflow data, but this Node.js runtime does not support ${e} decompression. Use a compatible Node.js runtime or request unresolved data.`);return new Uint8Array(r(t))}function PT(e){let t=jT(e);return t!==DT&&t!==ET?e:NT(t,e.subarray(4))}function FT(e){return{...e,input:PT(e.input),output:PT(e.output),error:PT(e.error)}}function IT(e){return{...e,input:PT(e.input),output:PT(e.output),error:PT(e.error)}}function LT(e){return{...e,metadata:PT(e.metadata)}}function RT(e){let t=e.eventData;if(!t||typeof t!=`object`)return e;let n=jc(typeof e.eventType==`string`?e.eventType:``);if(n.length===0)return e;let r={...t},i=!1;for(let e of n){if(!(e in r))continue;let t=r[e],n=PT(t);n!==t&&(r[e]=n,i=!0)}return i?{...e,eventData:r}:e}const zT=gc.omit({error:!0,errorCode:!0}).extend({error:qi([bc,se()]).optional(),errorCode:ct().optional(),blobStorageBytes:fn().optional(),streamStorageBytes:fn().optional()}),BT=zT,VT=zT.omit({input:!0,output:!0}).extend({inputRef:se().optional(),outputRef:se().optional(),input:qi([He(Uint8Array),se()]).optional(),output:qi([He(Uint8Array),se()]).optional()});function HT(e,t){if(t===`none`){let{inputRef:t,outputRef:n,...r}=e;return{...FT(qm(r)),input:void 0,output:void 0}}return FT(qm(e))}async function UT(e={},t){let{workflowName:n,status:r,pagination:i,resolveData:a=`all`}=e,o=new URLSearchParams;n&&o.set(`workflowName`,n),r&&o.set(`status`,r),i?.limit&&o.set(`limit`,i.limit.toString()),i?.cursor&&o.set(`cursor`,i.cursor),i?.sortOrder&&o.set(`sortOrder`,i.sortOrder);let s=a===`none`?`lazy`:`resolve`;o.set(`remoteRefBehavior`,s);let c=o.toString(),l=await L({endpoint:`/v2/runs${c?`?${c}`:``}`,options:{method:`GET`},config:t,schema:kc(s===`lazy`?VT:BT)});return{...l,data:l.data.map(e=>HT(e,a))}}async function WT(e,t){return qm(await L({endpoint:`/v1/runs/create`,options:{method:`POST`},data:e,config:t,schema:BT}))}async function GT(e,t,n){let r=t?.resolveData??`all`,i=r===`none`?`lazy`:`resolve`,s=new URLSearchParams;s.set(`remoteRefBehavior`,i);let c=s.toString(),l=`/v2/runs/${encodeURIComponent(e)}${c?`?${c}`:``}`;try{return HT(await L({endpoint:l,options:{method:`GET`},config:n,retryConnectTimeout:!0,schema:i===`lazy`?VT:BT}),r)}catch(t){throw t instanceof o&&t.status===404?new a(e):t}}async function KT(e,t,n){let r=[...new Set(e)],i=await Promise.all(r.map(async e=>{try{return await GT(e,t,n)}catch(e){if(e instanceof a)return null;throw e}})),o=new Map(r.map((e,t)=>[e,i[t]]));return e.map(e=>o.get(e)??null)}async function qT(e,t,n){let r=t?.resolveData??`all`,i=r===`none`?`lazy`:`resolve`,s=new URLSearchParams;s.set(`remoteRefBehavior`,i);let c=s.toString(),l=`/v1/runs/${encodeURIComponent(e)}/cancel${c?`?${c}`:``}`;try{return HT(await L({endpoint:l,options:{method:`PUT`},config:n,schema:i===`lazy`?VT:BT}),r)}catch(t){throw t instanceof o&&t.status===404?new a(e):t}}async function JT(e,t){let{runIds:n,cancelReason:r}=Rc.parse(e),i=await L({endpoint:`/v4/runs/cancel`,options:{method:`POST`},data:r===void 0?{runIds:n}:{runIds:n,cancelReason:r},config:t,schema:Sc}),a=new Map(i.results.map(e=>[e.runId,e]));if(!(a.size===i.results.length&&i.results.length===n.length&&n.every(e=>a.has(e))))throw new o(`Bulk cancel response did not contain exactly one result per requested run ID (requested ${n.length}, received ${i.results.length}).`);let s=n.map(e=>a.get(e));return{summary:i.summary,results:s}}const YT=Wa({attributes:Bt(ct(),ct())});async function XT(e,t,n,r){try{return{attributes:(await L({endpoint:`/v2/runs/${encodeURIComponent(e)}/attributes`,options:{method:`POST`},data:n?.allowReservedAttributes?{changes:t,allowReservedAttributes:!0}:{changes:t},config:r,schema:YT})).attributes}}catch(t){throw t instanceof o&&t.status===404?new a(e):t}}const ZT=zc.omit({error:!0}).extend({error:qi([bc,se()]).optional(),errorRef:se().optional()}),QT=ZT.omit({input:!0,output:!0}).extend({inputRef:se().optional(),outputRef:se().optional(),input:He(Uint8Array).optional(),output:He(Uint8Array).optional()});function $T(e){let{error:t,errorRef:n,...r}=e,i={...r},a=t??n;return a!=null&&(i.error=a),i}function eE(e,t){if(t===`none`){let{inputRef:t,outputRef:n,...r}=e;return{...IT($T(r)),input:void 0,output:void 0}}return IT($T(e))}async function tE(e,t){let{runId:n,pagination:r,resolveData:i=`all`}=e,a=new URLSearchParams;r?.cursor&&a.set(`cursor`,r.cursor),r?.limit&&a.set(`limit`,r.limit.toString()),r?.sortOrder&&a.set(`sortOrder`,r.sortOrder);let o=i===`none`?`lazy`:`resolve`;a.set(`remoteRefBehavior`,o);let s=a.toString(),c=await L({endpoint:`/v2/runs/${encodeURIComponent(n)}/steps${s?`?${s}`:``}`,options:{method:`GET`},config:t,schema:kc(o===`lazy`?QT:ZT)});return{...c,data:c.data.map(e=>eE(e,i))}}async function nE(e,t,n,r){let i=n?.resolveData??`all`,a=i===`none`?`lazy`:`resolve`,o=new URLSearchParams;o.set(`remoteRefBehavior`,a);let s=o.toString();return eE(await L({endpoint:`/v2/runs/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}${s?`?${s}`:``}`,options:{method:`GET`},config:r,schema:a===`lazy`?QT:ZT}),i)}function rE(e){let t=e.startsWith(`wrun_`)?e.slice(5):e;try{return Fc(`wrun_${gh(t).ulid}`,`wrun_`)}catch{return Fc(e,`wrun_`)}}const iE=new Set([`run_created`,`run_started`,`step_started`]),aE=new Set([`run_failed`,`step_failed`,`step_retrying`]);function oE(e){let t=e.eventData??{},n=xc(e.eventType),r={};if(typeof t.deploymentId==`string`&&(r.deploymentId=t.deploymentId),typeof t.workflowName==`string`&&(r.workflowName=t.workflowName),typeof t.stepName==`string`&&(r.stepName=t.stepName),typeof t.attempt==`number`&&(r.attempt=t.attempt),t.resumeAt instanceof Date)r.resumeAt=t.resumeAt;else if(typeof t.resumeAt==`string`){let e=new Date(t.resumeAt);Number.isNaN(e.getTime())||(r.resumeAt=e)}if(t.retryAfter instanceof Date)r.retryAfter=t.retryAfter;else if(typeof t.retryAfter==`string`){let e=new Date(t.retryAfter);Number.isNaN(e.getTime())||(r.retryAfter=e)}typeof t.token==`string`&&(r.hookToken=t.token),t.tokenRetentionUntil instanceof Date&&(r.hookTokenRetentionUntil=t.tokenRetentionUntil),typeof t.isWebhook==`boolean`&&(r.hookIsWebhook=t.isWebhook),typeof t.isSystem==`boolean`&&(r.hookIsSystem=t.isSystem),typeof t.errorCode==`string`&&(r.errorCode=t.errorCode),typeof t.cancelReason==`string`&&(r.cancelReason=t.cancelReason),typeof t.ownerMessageId==`string`&&(r.ownerMessageId=t.ownerMessageId),t.executionContext!==void 0&&t.executionContext!==null&&typeof t.executionContext==`object`&&(r.executionContext=t.executionContext),t.attributes!==void 0&&t.attributes!==null&&typeof t.attributes==`object`&&(r.attributes=t.attributes),Array.isArray(t.changes)&&(r.changes=t.changes),t.writer!==void 0&&t.writer!==null&&typeof t.writer==`object`&&(r.writer=t.writer),typeof t.allowReservedAttributes==`boolean`&&(r.allowReservedAttributes=t.allowReservedAttributes),typeof t.encryptionPublicKey==`string`&&(r.encryptionPublicKey=t.encryptionPublicKey),typeof t.ttfs==`number`&&(r.ttfs=t.ttfs),typeof t.stso==`number`&&(r.stso=t.stso),typeof t.stepCount==`number`&&Number.isSafeInteger(t.stepCount)&&t.stepCount>0&&(r.stepCount=t.stepCount),typeof t.eventCount==`number`&&Number.isSafeInteger(t.eventCount)&&t.eventCount>0&&(r.eventCount=t.eventCount),typeof t.rsfs==`number`&&(r.rsfs=t.rsfs),typeof t.finalSchedulingReplay==`number`&&(r.finalSchedulingReplay=t.finalSchedulingReplay),Array.isArray(t.optimizations)&&t.optimizations.every(e=>typeof e==`string`)&&(r.optimizations=t.optimizations);let i;if(n&&n in t){let r=t[n];if(r!==void 0){if(!(r instanceof Uint8Array))throw TypeError(`world-vercel v4: eventData.${n} for ${e.eventType} must be a Uint8Array (the runtime's dehydrated wire form); got ${typeof r==`object`?r===null?`null`:r.constructor?.name??typeof r:typeof r}.`);i=r}}return{payload:i,meta:r}}function sE(e){return qw(RT(e))}function cE(e){if(MT(e))return e;try{let t=wc.safeParse(Hf(e.slice()));return t.success?t.data:e}catch{return e}}function lE(e,t,n){let r=e.eventData??{};if(t.byteLength>0){let n=xc(e.eventType),i=PT(t);n&&i instanceof Uint8Array&&(r[n]=aE.has(e.eventType)?cE(i):i)}let i=sE({eventId:e.eventId,runId:e.runId,eventType:e.eventType,createdAt:e.createdAt instanceof Date?e.createdAt:new Date(e.createdAt),...e.occurredAt===void 0?{}:{occurredAt:e.occurredAt instanceof Date?e.occurredAt:new Date(e.occurredAt)},...e.correlationId?{correlationId:e.correlationId}:{},eventData:r,...e.specVersion===void 0?{}:{specVersion:e.specVersion},...e.resumeId?{resumeId:e.resumeId}:{}});return n===`none`?yc(i,`none`):i}async function uE(e,t,n,r){let i=n?.resolveData??`all`,{event:a,body:o}=await yT(e,t,r);return lE(a,o,i)}async function dE(e,t){let{pagination:n,resolveData:r=`all`}=e,i={cursor:n?.cursor??void 0,limit:n?.limit,sortOrder:n?.sortOrder,remoteRefBehavior:r===`none`?`lazy`:`resolve`},a=await(`correlationId`in e?TT(e.correlationId,e.runId,i,t):wT(e.runId,i,t)),o=a.events.map(e=>lE(e.event,e.body,r));return{data:`correlationId`in e?o.filter(t=>t.runId===e.runId):o,cursor:a.next??null,hasMore:typeof a.hasMore==`boolean`?a.hasMore:!!a.next}}async function fE(e,t,n,r){try{return await nT(()=>pE(e,t,n,r),t.eventType,{idempotentHookResume:t.eventType===`hook_received`&&n?.resumeId!==void 0&&n?.resumePayloadDigest!==void 0})}catch(e){throw Ac(t.eventType)&&o.is(e)&&e.status===404&&t.correlationId?new d(t.correlationId):e}}async function pE(e,t,n,r){if(n?.v1Compat){if(t.eventType===`run_cancelled`&&e)return{run:await qT(e,n,r)};if(t.eventType===`run_created`)return{run:await WT(t.eventData,r)};if(e===null)throw new o(`world-vercel: v1Compat=true requires a runId for ${t.eventType}`,{status:400});return{event:await L({endpoint:`/v1/runs/${encodeURIComponent(e)}/events`,options:{method:`POST`},data:t,config:r,schema:vc})}}if(e===null)throw new o(`world-vercel v4: createWorkflowRunEvent requires a client-generated runId for run_created (the runId is part of the payload storage ref key). Generate a wrun_ ULID before calling.`,{status:400});if(t.eventType===`run_created`){let t=rE(e);if(t)throw new o(t,{status:400})}let i=iE.has(t.eventType)?`resolve`:`lazy`,{payload:a,meta:s}=oE(t),c=n?.resolveData??`all`,l={runId:e,eventType:t.eventType,specVersion:t.specVersion??2,...t.correlationId?{correlationId:t.correlationId}:{},...n?.requestId?{vercelId:n.requestId}:{},...n?.computeInstanceId?{computeInstanceId:n.computeInstanceId}:{},...n?.stateUpdatedAt===void 0?{}:{stateUpdatedAt:n.stateUpdatedAt},...n?.stateEventCount===void 0?{}:{stateEventCount:n.stateEventCount},...n?.stateCursor?{stateCursor:n.stateCursor}:{},...n?.replayDivergenceCount===void 0?{}:{replayDivergenceCount:n.replayDivergenceCount},occurredAt:n?.occurredAt??new Date,...n?.sinceCursor?{sinceCursor:n.sinceCursor}:{},...n?.skipPreload?{skipPreload:!0}:{},...n?.resumeId?{resumeId:n.resumeId}:{},...n?.resumePayloadDigest?{resumePayloadDigest:n.resumePayloadDigest}:{},remoteRefBehavior:i,payload:a,...s};if(t.eventType===`hook_received`&&n?.preloadEvents===!0&&n.resumeId!==void 0&&n.resumePayloadDigest!==void 0){let e=await _T({...l,remoteRefBehavior:`lazy`},r);if(e.kind===`materialized`)return mE(e.result,c);let{canonicalEventId:t,maxEvents:n,next:i,hasMore:a}=e,o=e.events.map(e=>lE(e.event,e.body,`all`)),s=o.find(e=>e.eventId===t),u=hE(o);return{...s?{event:s}:{},...u?{run:u}:{},events:o,cursor:i??null,hasMore:a??!0,...n===void 0?{}:{maxEvents:n}}}return mE(await hT(l,r),c)}function mE(e,t){let n=e.body;return{event:n.event?yc(qw(n.event),t):void 0,run:n.run?qm(n.run):void 0,step:n.step?$T(n.step):void 0,hook:n.hook,wait:n.wait,events:n.events?n.events.map(qw):void 0,cursor:n.cursor??void 0,hasMore:n.hasMore,...n.stepCreated?{stepCreated:!0}:{},...typeof n.maxEvents==`number`?{maxEvents:n.maxEvents}:{}}}function hE(e){let t=e.find(e=>e.eventType===`run_created`),n=e.find(e=>e.eventType===`run_started`);if(!t||!n)return;let r=t.eventData.attributes??{},i=n.createdAt;for(let t of e)t.eventType===`attr_set`&&(r=Bc(r,t.eventData.changes),i=t.createdAt);return{runId:t.runId,status:`running`,deploymentId:t.eventData.deploymentId,workflowName:t.eventData.workflowName,specVersion:t.specVersion,executionContext:t.eventData.executionContext,input:t.eventData.input,attributes:r,encryptionPublicKey:t.eventData.encryptionPublicKey,startedAt:n.createdAt,createdAt:t.createdAt,updatedAt:i}}function gE(e,t){if(t===`none`){let{metadataRef:t,...n}=e;return n}return LT(e)}const _E=Ic.omit({metadata:!0}).extend({metadataRef:Ld.any().optional()});async function vE(e,t){let{runId:n,pagination:r,resolveData:i=`all`}=e,a=new URLSearchParams;r?.limit&&a.set(`limit`,r.limit.toString()),r?.cursor&&a.set(`cursor`,r.cursor),r?.sortOrder&&a.set(`sortOrder`,r.sortOrder);let o=i===`none`?`lazy`:`resolve`;a.set(`remoteRefBehavior`,o),n&&a.set(`runId`,n);let s=a.toString(),c=await L({endpoint:`/v2/hooks${s?`?${s}`:``}`,options:{method:`GET`},config:t,schema:kc(o===`lazy`?_E:Ic)});return{...c,data:c.data.map(e=>gE(e,i))}}async function yE(e,t,n){let r=t?.resolveData||`all`;return gE(await L({endpoint:`/v2/hooks/${encodeURIComponent(e)}`,options:{method:`GET`},config:n,schema:Ic}),r)}async function bE(e,t){try{return await L({endpoint:`/v2/hooks/by-token?token=${encodeURIComponent(e)}`,options:{method:`GET`},config:t,schema:Ic})}catch(t){throw o.is(t)&&t.status===404?new d(e):t}}function xE(e){let t={runs:{get:((t,n)=>GT(t,n,e)),getMany:((t,n)=>KT(t,n,e)),list:(t=>UT(t,e)),experimentalSetAttributes:(t,n,r)=>XT(t,n,r,e),cancelMany:t=>JT(t,e)},steps:{get:((t,n,r)=>nE(t,n,r,e)),list:(t=>tE(t,e))},events:{create:(t,n,r)=>fE(t,n,r,e),get:(t,n,r)=>uE(t,n,r,e),list:t=>dE(t,e),listByCorrelationId:t=>dE(t,e)},hooks:{get:(t,n)=>yE(t,n,e),getByToken:t=>bE(t,e),list:t=>vE(t,e)}};return{runs:Lh(`world.runs`,t.runs),steps:Lh(`world.steps`,t.steps),events:Lh(`world.events`,t.events),hooks:Lh(`world.hooks`,t.hooks)}}const SE=()=>Bd(`WORKFLOW_MAX_CHUNKS_PER_REQUEST`,1e3,{integer:!0,min:1});function CE(e,t,n){return new URL(`${n.baseUrl}/v2/runs/${encodeURIComponent(t)}/stream/${encodeURIComponent(e)}`)}function wE(e,t,n){return new URL(`${n.baseUrl}/v3/runs/${encodeURIComponent(t)}/stream/${encodeURIComponent(e)}`)}function TE(e){return{...Sm(e.runId),...wm(e.name),...Tm(e.operation),...typeof e.startIndex==`number`?Em(e.startIndex):{}}}function EE(e,t,n,r){let i=[`PUT ${t.origin}${t.pathname}`,...Am(n.headers)];return Error(`Stream ${e} failed: HTTP ${n.status} (${i.join(`; `)}): ${r}`)}function DE(e){let t=new TextEncoder,n=[],r=0;for(let i of e){let e=typeof i==`string`?t.encode(i):i;n.push(e),r+=4+e.length}let i=new Uint8Array(r),a=new DataView(i.buffer),o=0;for(let e of n)a.setUint32(o,e.length,!1),o+=4,i.set(e,o),o+=e.length;return i}const OE=Wa({tailIndex:fn(),done:Xe()}),kE=Wa({data:za(Wa({index:fn(),data:He(Uint8Array)})),cursor:ct().nullable(),hasMore:Xe(),done:Xe()});function AE(e){return{streams:{async write(t,n,r){let i=await t,a=await $m(e),o=CE(n,i,a);await(await Bm({method:`PUT`,url:o.toString(),body:r,headers:a.headers,dispatcher:Wp(e),timeoutMs:null,logLabel:o.pathname,spanName:`workflow.stream.write`,durationAttribute:`workflow.stream.write.chunk_rtt`,attributes:TE({runId:i,name:n,operation:`write`}),buildError:async e=>EE(`write`,o,e,await e.text())})).text()},async writeMulti(t,n,r){if(r.length===0)return;let i=await t,a=await $m(e);a.headers.set(`X-Stream-Multi`,`true`);let o=SE();for(let t=0;t<r.length;t+=o){let s=DE(r.slice(t,t+o)),c=CE(n,i,a);await(await Bm({method:`PUT`,url:c.toString(),body:s,headers:a.headers,dispatcher:Wp(e),timeoutMs:null,logLabel:c.pathname,spanName:`workflow.stream.write`,durationAttribute:`workflow.stream.write.chunk_rtt`,attributes:TE({runId:i,name:n,operation:`write_multi`}),buildError:async e=>EE(`write`,c,e,await e.text())})).text()}},async close(t,n){let r=await t,i=await $m(e);i.headers.set(`X-Stream-Done`,`true`);let a=CE(n,r,i);await(await Bm({method:`PUT`,url:a.toString(),headers:i.headers,dispatcher:Gp(e),timeoutMs:null,logLabel:a.pathname,spanName:`workflow.stream.write`,durationAttribute:`workflow.stream.write.chunk_rtt`,attributes:TE({runId:r,name:n,operation:`close`}),buildError:async e=>EE(`close`,a,e,await e.text())})).text()},async get(t,n,r){let i=await $m(e),a=wE(n,t,i);typeof r==`number`&&a.searchParams.set(`startIndex`,String(r));let o=await Bm({method:`GET`,url:a.toString(),headers:i.headers,dispatcher:void 0,timeoutMs:null,logLabel:a.pathname,spanName:`workflow.stream.read.connect`,attributes:TE({runId:t,name:n,operation:`read`,startIndex:r}),buildError:e=>Error(`Failed to fetch stream: ${e.status}`)});if(!o.body)throw Error(`No response body for stream`);return o.body},async getChunks(t,n,r){let i=new URLSearchParams;r?.limit!=null&&i.set(`limit`,String(r.limit)),r?.cursor&&i.set(`cursor`,r.cursor);let a=i.toString();return L({endpoint:`/v2/runs/${encodeURIComponent(t)}/streams/${encodeURIComponent(n)}/chunks${a?`?${a}`:``}`,config:e,schema:kE})},async getInfo(t,n){return L({endpoint:`/v2/runs/${encodeURIComponent(t)}/streams/${encodeURIComponent(n)}/info`,config:e,schema:OE})},async list(t){let n=await $m(e),r=new URL(`${n.baseUrl}/v2/runs/${encodeURIComponent(t)}/streams`);return await(await Bm({method:`GET`,url:r.toString(),headers:n.headers,dispatcher:void 0,timeoutMs:null,logLabel:r.pathname,buildError:e=>Error(`Failed to list streams: ${e.status}`)})).json()}}}}function jE(e){let t=e?.projectConfig?.projectId||process.env.VERCEL_PROJECT_ID;return{specVersion:5,capabilities:{preconditionGuard:!0,maxConcurrency:!0,deploymentAffinity:!0},processExitTriggersQueueRedelivery:!0,getRuntimeDeadline:Oh,...Ww(e),...xE(e),analytics:process.env.WORKFLOW_DISABLE_ANALYTICS_READS===`1`?void 0:ah(e),...Lh(`world.streams`,AE(e)),createRunId:Sh,describeRun:wh,getEnvironment:()=>Zm(e),getEncryptionKeyForRun:Dh(t,e?.projectConfig?.teamId,e?.token,e?.dispatcher),resolveLatestDeploymentId:Kw(e)}}export{ah as createAnalytics,Dh as createGetEncryptionKeyForRun,Ww as createQueue,Sh as createRunId,xE as createStorage,AE as createStreamer,jE as createWorld,Th as deriveRunKey,wh as describeRun,Eh as fetchRunKey,Ch as regionForRunId};