@google/adk 1.6.0 → 2.1.0

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 (869) hide show
  1. package/dist/cjs/a2a/a2a_event.js +17 -28
  2. package/dist/cjs/a2a/a2a_remote_agent.js +13 -7
  3. package/dist/cjs/a2a/a2a_remote_agent_run_processor.js +7 -3
  4. package/dist/cjs/a2a/a2a_remote_agent_utils.js +111 -2
  5. package/dist/cjs/a2a/agent_card.js +90 -8
  6. package/dist/cjs/a2a/agent_executor.js +34 -18
  7. package/dist/cjs/a2a/agent_to_a2a.js +28 -11
  8. package/dist/cjs/a2a/auth.js +3 -0
  9. package/dist/cjs/a2a/event_converter_utils.js +10 -0
  10. package/dist/cjs/a2a/event_processor_utils.js +71 -35
  11. package/dist/cjs/a2a/executor_context.js +6 -2
  12. package/dist/cjs/a2a/index.js +57 -0
  13. package/dist/cjs/a2a/metadata_converter_utils.js +5 -0
  14. package/dist/cjs/a2a/part_converter_utils.js +12 -0
  15. package/dist/cjs/a2a/request_metadata.js +94 -0
  16. package/dist/cjs/agents/active_streaming_tool.js +5 -2
  17. package/dist/cjs/agents/base_agent.js +55 -17
  18. package/dist/cjs/agents/context.js +12 -2
  19. package/dist/cjs/agents/framework_function_calls.js +64 -0
  20. package/dist/cjs/agents/functions.js +185 -60
  21. package/dist/cjs/agents/instructions.js +51 -12
  22. package/dist/cjs/agents/invocation_context.js +43 -8
  23. package/dist/cjs/agents/live_request_queue.js +29 -5
  24. package/dist/cjs/agents/llm_agent.js +541 -50
  25. package/dist/cjs/agents/loop_agent.js +20 -3
  26. package/dist/cjs/agents/parallel_agent.js +22 -3
  27. package/dist/cjs/agents/processors/agent_transfer_llm_request_processor.js +32 -8
  28. package/dist/cjs/agents/processors/base_llm_processor.js +9 -4
  29. package/dist/cjs/agents/processors/basic_llm_request_processor.js +6 -3
  30. package/dist/cjs/agents/processors/code_execution_request_processor.js +20 -7
  31. package/dist/cjs/agents/processors/content_processor_utils.js +85 -15
  32. package/dist/cjs/agents/processors/content_request_processor.js +13 -5
  33. package/dist/cjs/agents/processors/context_compactor_request_processor.js +5 -2
  34. package/dist/cjs/agents/processors/identity_llm_request_processor.js +12 -4
  35. package/dist/cjs/agents/processors/instructions_llm_request_processor.js +5 -2
  36. package/dist/cjs/agents/processors/interactions_request_processor.js +5 -2
  37. package/dist/cjs/agents/processors/request_confirmation_llm_request_processor.js +320 -92
  38. package/dist/cjs/agents/processors/request_input_llm_request_processor.js +214 -0
  39. package/dist/cjs/agents/processors/tool_filter_request_processor.js +5 -2
  40. package/dist/cjs/agents/readonly_context.js +13 -3
  41. package/dist/cjs/agents/routed_agent.js +7 -14
  42. package/dist/cjs/agents/run_config.js +12 -0
  43. package/dist/cjs/agents/sequential_agent.js +21 -4
  44. package/dist/cjs/agents/user_input_request.js +145 -0
  45. package/dist/cjs/apps/app.js +12 -12
  46. package/dist/cjs/apps/resumability_config.js +2 -0
  47. package/dist/cjs/artifacts/file_artifact_service.js +22 -4
  48. package/dist/cjs/artifacts/gcs_artifact_service.js +46 -11
  49. package/dist/cjs/artifacts/in_memory_artifact_service.js +9 -2
  50. package/dist/cjs/artifacts/registry.js +6 -1
  51. package/dist/cjs/artifacts/scoped_artifact_service.js +14 -2
  52. package/dist/cjs/artifacts/session_artifact_service.js +19 -0
  53. package/dist/cjs/auth/auth_handler.js +49 -10
  54. package/dist/cjs/auth/auth_preprocessor.js +48 -40
  55. package/dist/cjs/auth/auth_provider_registry.js +5 -2
  56. package/dist/cjs/auth/auth_schemes.js +2 -0
  57. package/dist/cjs/auth/credential_response_binding.js +101 -0
  58. package/dist/cjs/auth/credential_service/in_memory_credential_service.js +5 -2
  59. package/dist/cjs/auth/credential_service/session_state_credential_service.js +5 -2
  60. package/dist/cjs/auth/exchanger/base_credential_exchanger.js +5 -2
  61. package/dist/cjs/auth/exchanger/credential_exchanger_registry.js +5 -2
  62. package/dist/cjs/auth/oauth2/oauth2_credential_exchanger.js +8 -2
  63. package/dist/cjs/auth/oauth2/oauth2_credential_refresher.js +6 -3
  64. package/dist/cjs/auth/oauth2/oauth2_discovery.js +7 -2
  65. package/dist/cjs/auth/oauth2/oauth2_utils.js +23 -2
  66. package/dist/cjs/auth/refresher/base_credential_refresher.js +5 -2
  67. package/dist/cjs/auth/refresher/credential_refresher_registry.js +5 -2
  68. package/dist/cjs/code_executors/agent_engine_sandbox_code_executor.js +3 -0
  69. package/dist/cjs/code_executors/base_code_executor.js +7 -3
  70. package/dist/cjs/code_executors/built_in_code_executor.js +7 -3
  71. package/dist/cjs/code_executors/code_execution_utils.js +8 -2
  72. package/dist/cjs/code_executors/code_executor_context.js +5 -2
  73. package/dist/cjs/code_executors/container_code_executor.js +186 -0
  74. package/dist/cjs/code_executors/docker_container.js +282 -0
  75. package/dist/cjs/code_executors/unsafe_local_code_executor.js +19 -8
  76. package/dist/cjs/common.js +180 -46
  77. package/dist/cjs/context/agent_controlled_context_compactor.js +15 -7
  78. package/dist/cjs/context/anchored_context_compactor.js +46 -20
  79. package/dist/cjs/context/compaction_utils.js +18 -6
  80. package/dist/cjs/context/summarizers/llm_summarizer.js +5 -2
  81. package/dist/cjs/context/token_based_context_compactor.js +19 -5
  82. package/dist/cjs/context/trajectory_thought_pruning_compactor.js +22 -12
  83. package/dist/cjs/context/truncating_context_compactor.js +22 -7
  84. package/dist/cjs/environment/base_environment.js +97 -0
  85. package/dist/cjs/environment/local_environment.js +186 -0
  86. package/dist/cjs/errors/already_exists_error.js +50 -0
  87. package/dist/cjs/errors/input_validation_error.js +50 -0
  88. package/dist/cjs/errors/not_found_error.js +50 -0
  89. package/dist/cjs/errors/session_not_found_error.js +50 -0
  90. package/dist/cjs/errors/tool_execution_error.js +68 -0
  91. package/dist/cjs/events/compacted_event.js +4 -0
  92. package/dist/cjs/events/event.js +38 -3
  93. package/dist/cjs/events/event_actions.js +12 -0
  94. package/dist/cjs/events/structured_events.js +2 -0
  95. package/dist/cjs/examples/base_example_provider.js +7 -3
  96. package/dist/cjs/examples/example_util.js +3 -0
  97. package/dist/cjs/features/feature_registry.js +7 -0
  98. package/dist/cjs/index.js +54 -25
  99. package/dist/cjs/index_web.js +2 -0
  100. package/dist/cjs/integrations/agent_registry/agent_registry.js +10 -6
  101. package/dist/cjs/integrations/agent_registry/agent_registry_mcp_toolset.js +7 -4
  102. package/dist/cjs/integrations/agent_registry/helpers.js +3 -0
  103. package/dist/cjs/memory/in_memory_memory_service.js +8 -2
  104. package/dist/cjs/memory/rag_memory_transcript.js +136 -0
  105. package/dist/cjs/memory/vertex_ai_memory_bank_service.js +19 -4
  106. package/dist/cjs/memory/vertex_ai_rag_api.js +120 -0
  107. package/dist/cjs/memory/vertex_ai_rag_memory_service.js +228 -0
  108. package/dist/cjs/models/apigee_llm.js +10 -4
  109. package/dist/cjs/models/base_llm.js +8 -4
  110. package/dist/cjs/models/chrome_prompt_llm.js +304 -0
  111. package/dist/cjs/models/chrome_prompt_utils.js +229 -0
  112. package/dist/cjs/models/gemini_llm_connection.js +5 -2
  113. package/dist/cjs/models/google_llm.js +33 -16
  114. package/dist/cjs/models/interactions_utils.js +18 -3
  115. package/dist/cjs/models/llm_request.js +4 -0
  116. package/dist/cjs/models/llm_response.js +2 -0
  117. package/dist/cjs/models/registry.js +8 -2
  118. package/dist/cjs/models/routed_llm.js +4 -13
  119. package/dist/cjs/plugins/_reflect_retry_utils.js +142 -0
  120. package/dist/cjs/plugins/base_plugin.js +39 -5
  121. package/dist/cjs/plugins/global_instruction_plugin.js +5 -2
  122. package/dist/cjs/plugins/logging_plugin.js +13 -8
  123. package/dist/cjs/plugins/plugin_manager.js +37 -2
  124. package/dist/cjs/plugins/reflect_retry_model_plugin.js +274 -0
  125. package/dist/cjs/plugins/reflect_retry_tool_plugin.js +276 -0
  126. package/dist/cjs/plugins/security_plugin.js +15 -8
  127. package/dist/cjs/runner/in_memory_runner.js +5 -2
  128. package/dist/cjs/runner/runner.js +236 -43
  129. package/dist/cjs/sessions/base_session_service.js +13 -2
  130. package/dist/cjs/sessions/database_session_service.js +84 -45
  131. package/dist/cjs/sessions/db/operations.js +259 -24
  132. package/dist/cjs/sessions/db/schema.js +118 -156
  133. package/dist/cjs/sessions/in_memory_session_service.js +22 -14
  134. package/dist/cjs/sessions/registry.js +9 -2
  135. package/dist/cjs/sessions/session.js +2 -0
  136. package/dist/cjs/sessions/state.js +80 -8
  137. package/dist/cjs/sessions/state_write_order.js +105 -0
  138. package/dist/cjs/sessions/vertex_ai_session_service.js +112 -17
  139. package/dist/cjs/skills/gcp_skill_registry.js +2 -0
  140. package/dist/cjs/skills/loader.js +22 -10
  141. package/dist/cjs/skills/prompt.js +3 -0
  142. package/dist/cjs/telemetry/google_cloud.js +42 -9
  143. package/dist/cjs/telemetry/setup.js +6 -1
  144. package/dist/cjs/telemetry/tracing.js +71 -5
  145. package/dist/cjs/tools/agent_tool.js +10 -7
  146. package/dist/cjs/tools/base_tool.js +38 -6
  147. package/dist/cjs/tools/base_toolset.js +10 -6
  148. package/dist/cjs/tools/built_in_tool.js +75 -0
  149. package/dist/cjs/tools/consolidate_context_tool.js +5 -2
  150. package/dist/cjs/tools/enterprise_web_search_tool.js +8 -7
  151. package/dist/cjs/tools/example_tool.js +5 -2
  152. package/dist/cjs/tools/exit_loop_tool.js +5 -2
  153. package/dist/cjs/tools/finish_task_tool.js +119 -0
  154. package/dist/cjs/tools/forwarding_artifact_service.js +23 -15
  155. package/dist/cjs/tools/function_tool.js +79 -11
  156. package/dist/cjs/tools/get_user_choice_tool.js +3 -2
  157. package/dist/cjs/tools/google_maps_grounding_tool.js +8 -7
  158. package/dist/cjs/tools/google_search_tool.js +7 -7
  159. package/dist/cjs/tools/load_artifacts_tool.js +55 -25
  160. package/dist/cjs/tools/load_memory_tool.js +5 -2
  161. package/dist/cjs/tools/load_web_page.js +14 -160
  162. package/dist/cjs/tools/long_running_tool.js +5 -2
  163. package/dist/cjs/tools/mcp/index.js +39 -0
  164. package/dist/cjs/tools/mcp/load_mcp_resource_tool.js +39 -7
  165. package/dist/cjs/tools/mcp/mcp_session_manager.js +36 -8
  166. package/dist/cjs/tools/mcp/mcp_tool.js +5 -2
  167. package/dist/cjs/tools/mcp/mcp_toolset.js +5 -2
  168. package/dist/cjs/tools/openapi_tool/auth/auth_helpers.js +15 -2
  169. package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.js +2 -0
  170. package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.js +2 -0
  171. package/dist/cjs/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +30 -9
  172. package/dist/cjs/tools/openapi_tool/openapi_spec_parser/operation_parser.js +3 -1
  173. package/dist/cjs/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +6 -2
  174. package/dist/cjs/tools/openapi_tool/openapi_toolset.js +2 -0
  175. package/dist/cjs/tools/openapi_tool/rest_api_tool.js +39 -23
  176. package/dist/cjs/tools/preload_memory_tool.js +6 -3
  177. package/dist/cjs/tools/request_input_tool.js +6 -4
  178. package/dist/cjs/tools/resume_inputs.js +27 -0
  179. package/dist/cjs/tools/retrieval/base_retrieval_tool.js +60 -0
  180. package/dist/cjs/tools/retrieval/files_retrieval.js +95 -0
  181. package/dist/cjs/tools/retrieval/llama_index_retrieval.js +57 -0
  182. package/dist/cjs/tools/skill/list_skills_tool.js +2 -0
  183. package/dist/cjs/tools/skill/load_skill_resource_tool.js +2 -0
  184. package/dist/cjs/tools/skill/load_skill_tool.js +4 -1
  185. package/dist/cjs/tools/skill/run_skill_inline_script_tool.js +8 -2
  186. package/dist/cjs/tools/skill/run_skill_script_tool.js +10 -2
  187. package/dist/cjs/tools/skill/search_skills_tool.js +2 -0
  188. package/dist/cjs/tools/skill/skill_toolset.js +35 -0
  189. package/dist/cjs/tools/tool_confirmation.js +26 -3
  190. package/dist/cjs/tools/url_context_tool.js +7 -7
  191. package/dist/cjs/tools/vertex_ai_search_tool.js +8 -9
  192. package/dist/cjs/tools/vertex_rag_retrieval_tool.js +7 -11
  193. package/dist/cjs/utils/async_hooks_shim.js +5 -2
  194. package/dist/cjs/utils/async_queue.js +45 -18
  195. package/dist/cjs/utils/branch_trie.js +2 -0
  196. package/dist/cjs/utils/case_utils.js +2 -0
  197. package/dist/cjs/utils/client_labels.js +5 -0
  198. package/dist/cjs/utils/crypto_shim.js +18 -0
  199. package/dist/cjs/utils/deprecated.js +68 -0
  200. package/dist/cjs/utils/env_aware_utils.js +41 -0
  201. package/dist/cjs/utils/error_utils.js +8 -0
  202. package/dist/cjs/utils/experimental.js +9 -2
  203. package/dist/cjs/utils/failover_utils.js +3 -0
  204. package/dist/cjs/utils/file_extension_utils.js +3 -0
  205. package/dist/cjs/utils/file_utils.js +7 -2
  206. package/dist/cjs/utils/gemini_schema_util.js +6 -8
  207. package/dist/cjs/utils/genai_schema_to_json.js +107 -0
  208. package/dist/cjs/utils/live_connection_utils.js +5 -2
  209. package/dist/cjs/utils/logger.js +28 -54
  210. package/dist/cjs/utils/logger_browser.js +86 -0
  211. package/dist/cjs/utils/logger_node.js +119 -0
  212. package/dist/cjs/utils/model_name.js +8 -0
  213. package/dist/cjs/utils/object_notation_utils.js +7 -3
  214. package/dist/cjs/utils/optional_peer.js +68 -0
  215. package/dist/cjs/utils/output_schema_utils.js +2 -0
  216. package/dist/cjs/utils/partial_copy.js +2 -0
  217. package/dist/cjs/utils/redact_inline_data.js +46 -0
  218. package/dist/cjs/utils/redact_uri.js +80 -0
  219. package/dist/cjs/utils/schema.js +178 -0
  220. package/dist/cjs/utils/simple_zod_to_json.js +17 -4
  221. package/dist/cjs/utils/ssrf_guard.js +262 -0
  222. package/dist/cjs/utils/streaming_utils.js +14 -6
  223. package/dist/cjs/utils/task.js +7 -4
  224. package/dist/cjs/utils/variant_utils.js +3 -1
  225. package/dist/cjs/utils/vertex_ai_utils.js +3 -1
  226. package/dist/cjs/version.js +1 -1
  227. package/dist/cjs/workflow/base_node.js +211 -0
  228. package/dist/cjs/workflow/branch_path.js +108 -0
  229. package/dist/cjs/workflow/dynamic_node_scheduler.js +220 -0
  230. package/dist/cjs/workflow/errors.js +178 -0
  231. package/dist/cjs/workflow/graph.js +158 -0
  232. package/dist/cjs/workflow/index.js +131 -0
  233. package/dist/cjs/workflow/node.js +65 -0
  234. package/dist/cjs/workflow/node_builders.js +68 -0
  235. package/dist/cjs/workflow/node_context.js +246 -0
  236. package/dist/cjs/workflow/node_error_event.js +86 -0
  237. package/dist/cjs/workflow/node_runner.js +459 -0
  238. package/dist/cjs/workflow/node_state.js +57 -0
  239. package/dist/cjs/workflow/node_status.js +48 -0
  240. package/dist/cjs/workflow/nodes/function_node.js +195 -0
  241. package/dist/cjs/workflow/nodes/join_node.js +56 -0
  242. package/dist/cjs/workflow/nodes/node_tool.js +147 -0
  243. package/dist/cjs/workflow/nodes/parallel_worker.js +129 -0
  244. package/dist/cjs/workflow/nodes/tool_node.js +117 -0
  245. package/dist/cjs/workflow/request_input.js +64 -0
  246. package/dist/cjs/workflow/retry_config.js +71 -0
  247. package/dist/cjs/workflow/run_llm_agent_as_node.js +192 -0
  248. package/dist/cjs/workflow/run_node_as_invocation.js +165 -0
  249. package/dist/cjs/workflow/schedule_dynamic_node.js +53 -0
  250. package/dist/cjs/workflow/trigger.js +27 -0
  251. package/dist/cjs/workflow/utils/graph_parser.js +212 -0
  252. package/dist/cjs/workflow/utils/graph_validation.js +216 -0
  253. package/dist/cjs/workflow/utils/hitl_utils.js +252 -0
  254. package/dist/cjs/workflow/utils/rehydration_utils.js +373 -0
  255. package/dist/cjs/workflow/utils/retry_utils.js +112 -0
  256. package/dist/cjs/workflow/utils/workflow_graph_utils.js +144 -0
  257. package/dist/cjs/workflow/workflow.js +509 -0
  258. package/dist/esm/a2a/a2a_event.js +18 -27
  259. package/dist/esm/a2a/a2a_remote_agent.js +16 -7
  260. package/dist/esm/a2a/a2a_remote_agent_run_processor.js +8 -3
  261. package/dist/esm/a2a/a2a_remote_agent_utils.js +110 -2
  262. package/dist/esm/a2a/agent_card.js +96 -8
  263. package/dist/esm/a2a/agent_executor.js +36 -19
  264. package/dist/esm/a2a/agent_to_a2a.js +52 -17
  265. package/dist/esm/a2a/auth.js +4 -0
  266. package/dist/esm/a2a/event_converter_utils.js +11 -0
  267. package/dist/esm/a2a/event_processor_utils.js +74 -35
  268. package/dist/esm/a2a/executor_context.js +7 -2
  269. package/dist/esm/a2a/index.js +26 -0
  270. package/dist/esm/a2a/metadata_converter_utils.js +6 -0
  271. package/dist/esm/a2a/part_converter_utils.js +13 -0
  272. package/dist/esm/a2a/request_metadata.js +68 -0
  273. package/dist/esm/agents/active_streaming_tool.js +6 -2
  274. package/dist/esm/agents/base_agent.js +56 -17
  275. package/dist/esm/agents/context.js +13 -2
  276. package/dist/esm/agents/framework_function_calls.js +34 -0
  277. package/dist/esm/agents/functions.js +191 -58
  278. package/dist/esm/agents/instructions.js +52 -12
  279. package/dist/esm/agents/invocation_context.js +42 -7
  280. package/dist/esm/agents/live_request_queue.js +30 -5
  281. package/dist/esm/agents/llm_agent.js +542 -50
  282. package/dist/esm/agents/loop_agent.js +22 -3
  283. package/dist/esm/agents/parallel_agent.js +24 -3
  284. package/dist/esm/agents/processors/agent_transfer_llm_request_processor.js +33 -8
  285. package/dist/esm/agents/processors/base_llm_processor.js +10 -4
  286. package/dist/esm/agents/processors/basic_llm_request_processor.js +7 -3
  287. package/dist/esm/agents/processors/code_execution_request_processor.js +21 -7
  288. package/dist/esm/agents/processors/content_processor_utils.js +88 -16
  289. package/dist/esm/agents/processors/content_request_processor.js +14 -5
  290. package/dist/esm/agents/processors/context_compactor_request_processor.js +6 -2
  291. package/dist/esm/agents/processors/identity_llm_request_processor.js +13 -4
  292. package/dist/esm/agents/processors/instructions_llm_request_processor.js +6 -2
  293. package/dist/esm/agents/processors/interactions_request_processor.js +6 -2
  294. package/dist/esm/agents/processors/request_confirmation_llm_request_processor.js +325 -93
  295. package/dist/esm/agents/processors/request_input_llm_request_processor.js +193 -0
  296. package/dist/esm/agents/processors/tool_filter_request_processor.js +6 -2
  297. package/dist/esm/agents/readonly_context.js +14 -3
  298. package/dist/esm/agents/routed_agent.js +7 -15
  299. package/dist/esm/agents/run_config.js +13 -0
  300. package/dist/esm/agents/sequential_agent.js +23 -4
  301. package/dist/esm/agents/user_input_request.js +120 -0
  302. package/dist/esm/apps/app.js +15 -12
  303. package/dist/esm/apps/resumability_config.js +3 -0
  304. package/dist/esm/artifacts/file_artifact_service.js +23 -4
  305. package/dist/esm/artifacts/gcs_artifact_service.js +58 -11
  306. package/dist/esm/artifacts/in_memory_artifact_service.js +10 -2
  307. package/dist/esm/artifacts/registry.js +7 -1
  308. package/dist/esm/artifacts/scoped_artifact_service.js +15 -2
  309. package/dist/esm/artifacts/session_artifact_service.js +12 -0
  310. package/dist/esm/auth/auth_handler.js +53 -10
  311. package/dist/esm/auth/auth_preprocessor.js +50 -41
  312. package/dist/esm/auth/auth_provider_registry.js +6 -2
  313. package/dist/esm/auth/auth_schemes.js +3 -0
  314. package/dist/esm/auth/credential_response_binding.js +74 -0
  315. package/dist/esm/auth/credential_service/in_memory_credential_service.js +6 -2
  316. package/dist/esm/auth/credential_service/session_state_credential_service.js +6 -2
  317. package/dist/esm/auth/exchanger/base_credential_exchanger.js +6 -2
  318. package/dist/esm/auth/exchanger/credential_exchanger_registry.js +6 -2
  319. package/dist/esm/auth/oauth2/oauth2_credential_exchanger.js +9 -2
  320. package/dist/esm/auth/oauth2/oauth2_credential_refresher.js +7 -3
  321. package/dist/esm/auth/oauth2/oauth2_discovery.js +8 -2
  322. package/dist/esm/auth/oauth2/oauth2_utils.js +22 -2
  323. package/dist/esm/auth/refresher/base_credential_refresher.js +6 -2
  324. package/dist/esm/auth/refresher/credential_refresher_registry.js +6 -2
  325. package/dist/esm/code_executors/agent_engine_sandbox_code_executor.js +3 -0
  326. package/dist/esm/code_executors/base_code_executor.js +8 -3
  327. package/dist/esm/code_executors/built_in_code_executor.js +8 -3
  328. package/dist/esm/code_executors/code_execution_utils.js +9 -2
  329. package/dist/esm/code_executors/code_executor_context.js +6 -2
  330. package/dist/esm/code_executors/container_code_executor.js +155 -0
  331. package/dist/esm/code_executors/docker_container.js +265 -0
  332. package/dist/esm/code_executors/unsafe_local_code_executor.js +20 -8
  333. package/dist/esm/common.js +181 -41
  334. package/dist/esm/context/agent_controlled_context_compactor.js +16 -7
  335. package/dist/esm/context/anchored_context_compactor.js +51 -21
  336. package/dist/esm/context/compaction_utils.js +17 -5
  337. package/dist/esm/context/summarizers/llm_summarizer.js +6 -2
  338. package/dist/esm/context/token_based_context_compactor.js +20 -5
  339. package/dist/esm/context/trajectory_thought_pruning_compactor.js +23 -12
  340. package/dist/esm/context/truncating_context_compactor.js +23 -7
  341. package/dist/esm/environment/base_environment.js +71 -0
  342. package/dist/esm/environment/local_environment.js +150 -0
  343. package/dist/esm/errors/already_exists_error.js +23 -0
  344. package/dist/esm/errors/input_validation_error.js +23 -0
  345. package/dist/esm/errors/not_found_error.js +23 -0
  346. package/dist/esm/errors/session_not_found_error.js +23 -0
  347. package/dist/esm/errors/tool_execution_error.js +40 -0
  348. package/dist/esm/events/compacted_event.js +5 -0
  349. package/dist/esm/events/event.js +38 -3
  350. package/dist/esm/events/event_actions.js +12 -0
  351. package/dist/esm/events/structured_events.js +3 -0
  352. package/dist/esm/examples/base_example_provider.js +8 -3
  353. package/dist/esm/examples/example_util.js +4 -0
  354. package/dist/esm/features/feature_registry.js +8 -0
  355. package/dist/esm/index.js +41 -15
  356. package/dist/esm/index_web.js +2 -0
  357. package/dist/esm/integrations/agent_registry/agent_registry.js +11 -6
  358. package/dist/esm/integrations/agent_registry/agent_registry_mcp_toolset.js +6 -2
  359. package/dist/esm/integrations/agent_registry/helpers.js +4 -0
  360. package/dist/esm/memory/in_memory_memory_service.js +9 -2
  361. package/dist/esm/memory/rag_memory_transcript.js +106 -0
  362. package/dist/esm/memory/vertex_ai_memory_bank_service.js +20 -4
  363. package/dist/esm/memory/vertex_ai_rag_api.js +93 -0
  364. package/dist/esm/memory/vertex_ai_rag_memory_service.js +208 -0
  365. package/dist/esm/models/apigee_llm.js +11 -4
  366. package/dist/esm/models/base_llm.js +9 -4
  367. package/dist/esm/models/chrome_prompt_llm.js +285 -0
  368. package/dist/esm/models/chrome_prompt_utils.js +192 -0
  369. package/dist/esm/models/gemini_llm_connection.js +6 -2
  370. package/dist/esm/models/google_llm.js +35 -17
  371. package/dist/esm/models/interactions_utils.js +19 -3
  372. package/dist/esm/models/llm_request.js +5 -0
  373. package/dist/esm/models/llm_response.js +3 -0
  374. package/dist/esm/models/registry.js +9 -2
  375. package/dist/esm/models/routed_llm.js +4 -14
  376. package/dist/esm/plugins/_reflect_retry_utils.js +111 -0
  377. package/dist/esm/plugins/base_plugin.js +39 -5
  378. package/dist/esm/plugins/global_instruction_plugin.js +6 -2
  379. package/dist/esm/plugins/logging_plugin.js +14 -8
  380. package/dist/esm/plugins/plugin_manager.js +38 -2
  381. package/dist/esm/plugins/reflect_retry_model_plugin.js +250 -0
  382. package/dist/esm/plugins/reflect_retry_tool_plugin.js +254 -0
  383. package/dist/esm/plugins/security_plugin.js +14 -6
  384. package/dist/esm/runner/in_memory_runner.js +6 -2
  385. package/dist/esm/runner/runner.js +249 -46
  386. package/dist/esm/sessions/base_session_service.js +14 -2
  387. package/dist/esm/sessions/database_session_service.js +65 -27
  388. package/dist/esm/sessions/db/operations.js +259 -24
  389. package/dist/esm/sessions/db/schema.js +116 -157
  390. package/dist/esm/sessions/in_memory_session_service.js +23 -14
  391. package/dist/esm/sessions/registry.js +10 -2
  392. package/dist/esm/sessions/session.js +3 -0
  393. package/dist/esm/sessions/state.js +78 -7
  394. package/dist/esm/sessions/state_write_order.js +74 -0
  395. package/dist/esm/sessions/vertex_ai_session_service.js +111 -16
  396. package/dist/esm/skills/gcp_skill_registry.js +2 -0
  397. package/dist/esm/skills/loader.js +23 -10
  398. package/dist/esm/skills/prompt.js +4 -0
  399. package/dist/esm/telemetry/google_cloud.js +54 -9
  400. package/dist/esm/telemetry/setup.js +7 -1
  401. package/dist/esm/telemetry/tracing.js +70 -5
  402. package/dist/esm/tools/agent_tool.js +11 -7
  403. package/dist/esm/tools/base_tool.js +36 -5
  404. package/dist/esm/tools/base_toolset.js +11 -6
  405. package/dist/esm/tools/built_in_tool.js +51 -0
  406. package/dist/esm/tools/consolidate_context_tool.js +6 -2
  407. package/dist/esm/tools/enterprise_web_search_tool.js +9 -7
  408. package/dist/esm/tools/example_tool.js +6 -2
  409. package/dist/esm/tools/exit_loop_tool.js +6 -2
  410. package/dist/esm/tools/finish_task_tool.js +92 -0
  411. package/dist/esm/tools/forwarding_artifact_service.js +24 -15
  412. package/dist/esm/tools/function_tool.js +80 -11
  413. package/dist/esm/tools/get_user_choice_tool.js +4 -2
  414. package/dist/esm/tools/google_maps_grounding_tool.js +9 -7
  415. package/dist/esm/tools/google_search_tool.js +8 -7
  416. package/dist/esm/tools/load_artifacts_tool.js +57 -26
  417. package/dist/esm/tools/load_memory_tool.js +6 -2
  418. package/dist/esm/tools/load_web_page.js +19 -158
  419. package/dist/esm/tools/long_running_tool.js +6 -2
  420. package/dist/{web/context/summarizers/base_summarizer.js → esm/tools/mcp/index.js} +4 -0
  421. package/dist/esm/tools/mcp/load_mcp_resource_tool.js +40 -7
  422. package/dist/esm/tools/mcp/mcp_session_manager.js +45 -9
  423. package/dist/esm/tools/mcp/mcp_tool.js +6 -2
  424. package/dist/esm/tools/mcp/mcp_toolset.js +6 -2
  425. package/dist/esm/tools/openapi_tool/auth/auth_helpers.js +18 -2
  426. package/dist/esm/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.js +2 -0
  427. package/dist/esm/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.js +2 -0
  428. package/dist/esm/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +30 -9
  429. package/dist/esm/tools/openapi_tool/openapi_spec_parser/operation_parser.js +3 -1
  430. package/dist/esm/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +6 -2
  431. package/dist/esm/tools/openapi_tool/openapi_toolset.js +2 -0
  432. package/dist/esm/tools/openapi_tool/rest_api_tool.js +39 -23
  433. package/dist/esm/tools/preload_memory_tool.js +7 -3
  434. package/dist/esm/tools/request_input_tool.js +7 -4
  435. package/dist/esm/tools/retrieval/base_retrieval_tool.js +33 -0
  436. package/dist/esm/tools/retrieval/files_retrieval.js +81 -0
  437. package/dist/esm/tools/retrieval/llama_index_retrieval.js +30 -0
  438. package/dist/esm/tools/skill/list_skills_tool.js +2 -0
  439. package/dist/esm/tools/skill/load_skill_resource_tool.js +2 -0
  440. package/dist/esm/tools/skill/load_skill_tool.js +4 -1
  441. package/dist/esm/tools/skill/run_skill_inline_script_tool.js +8 -2
  442. package/dist/esm/tools/skill/run_skill_script_tool.js +10 -2
  443. package/dist/esm/tools/skill/search_skills_tool.js +2 -0
  444. package/dist/esm/tools/skill/skill_toolset.js +25 -0
  445. package/dist/esm/tools/tool_confirmation.js +24 -2
  446. package/dist/esm/tools/url_context_tool.js +8 -7
  447. package/dist/esm/tools/vertex_ai_search_tool.js +9 -9
  448. package/dist/esm/tools/vertex_rag_retrieval_tool.js +8 -11
  449. package/dist/esm/utils/async_hooks_shim.js +6 -2
  450. package/dist/esm/utils/async_queue.js +46 -18
  451. package/dist/esm/utils/branch_trie.js +3 -0
  452. package/dist/esm/utils/case_utils.js +3 -0
  453. package/dist/esm/utils/client_labels.js +6 -0
  454. package/dist/esm/utils/crypto_shim.js +17 -0
  455. package/dist/esm/utils/deprecated.js +40 -0
  456. package/dist/esm/utils/env_aware_utils.js +41 -0
  457. package/dist/esm/utils/error_utils.js +9 -0
  458. package/dist/esm/utils/experimental.js +10 -2
  459. package/dist/esm/utils/failover_utils.js +4 -0
  460. package/dist/esm/utils/file_extension_utils.js +4 -0
  461. package/dist/esm/utils/file_utils.js +8 -2
  462. package/dist/esm/utils/gemini_schema_util.js +7 -8
  463. package/dist/esm/utils/genai_schema_to_json.js +80 -0
  464. package/dist/esm/utils/live_connection_utils.js +6 -2
  465. package/dist/esm/utils/logger.js +28 -44
  466. package/dist/esm/utils/logger_browser.js +58 -0
  467. package/dist/esm/utils/logger_node.js +81 -0
  468. package/dist/esm/utils/model_name.js +9 -0
  469. package/dist/esm/utils/object_notation_utils.js +8 -3
  470. package/dist/esm/utils/optional_peer.js +41 -0
  471. package/dist/esm/utils/output_schema_utils.js +3 -0
  472. package/dist/esm/utils/partial_copy.js +3 -0
  473. package/dist/esm/utils/redact_inline_data.js +19 -0
  474. package/dist/esm/utils/redact_uri.js +53 -0
  475. package/dist/esm/utils/schema.js +152 -0
  476. package/dist/esm/utils/simple_zod_to_json.js +15 -4
  477. package/dist/esm/utils/ssrf_guard.js +230 -0
  478. package/dist/esm/utils/streaming_utils.js +15 -6
  479. package/dist/esm/utils/task.js +8 -4
  480. package/dist/esm/utils/variant_utils.js +5 -2
  481. package/dist/esm/utils/vertex_ai_utils.js +5 -2
  482. package/dist/esm/version.js +1 -1
  483. package/dist/esm/workflow/base_node.js +182 -0
  484. package/dist/esm/workflow/branch_path.js +77 -0
  485. package/dist/esm/workflow/dynamic_node_scheduler.js +202 -0
  486. package/dist/esm/workflow/errors.js +140 -0
  487. package/dist/esm/workflow/graph.js +127 -0
  488. package/dist/esm/workflow/index.js +80 -0
  489. package/dist/esm/workflow/node.js +38 -0
  490. package/dist/esm/workflow/node_builders.js +40 -0
  491. package/dist/esm/workflow/node_context.js +219 -0
  492. package/dist/esm/workflow/node_error_event.js +57 -0
  493. package/dist/esm/workflow/node_runner.js +439 -0
  494. package/dist/esm/workflow/node_state.js +29 -0
  495. package/dist/esm/workflow/node_status.js +20 -0
  496. package/dist/esm/workflow/nodes/function_node.js +172 -0
  497. package/dist/esm/workflow/nodes/join_node.js +29 -0
  498. package/dist/esm/workflow/nodes/node_tool.js +122 -0
  499. package/dist/esm/workflow/nodes/parallel_worker.js +102 -0
  500. package/dist/esm/workflow/nodes/tool_node.js +90 -0
  501. package/dist/esm/workflow/request_input.js +36 -0
  502. package/dist/esm/workflow/retry_config.js +43 -0
  503. package/dist/esm/workflow/run_llm_agent_as_node.js +172 -0
  504. package/dist/esm/workflow/run_node_as_invocation.js +139 -0
  505. package/dist/esm/workflow/schedule_dynamic_node.js +26 -0
  506. package/dist/esm/workflow/utils/graph_parser.js +188 -0
  507. package/dist/esm/workflow/utils/graph_validation.js +189 -0
  508. package/dist/esm/workflow/utils/hitl_utils.js +222 -0
  509. package/dist/esm/workflow/utils/rehydration_utils.js +342 -0
  510. package/dist/esm/workflow/utils/retry_utils.js +82 -0
  511. package/dist/esm/workflow/utils/workflow_graph_utils.js +115 -0
  512. package/dist/esm/workflow/workflow.js +493 -0
  513. package/dist/types/a2a/a2a_event.d.ts +7 -10
  514. package/dist/types/a2a/a2a_remote_agent.d.ts +5 -0
  515. package/dist/types/a2a/a2a_remote_agent_utils.d.ts +25 -0
  516. package/dist/types/a2a/agent_card.d.ts +12 -3
  517. package/dist/types/a2a/agent_executor.d.ts +1 -1
  518. package/dist/types/a2a/agent_to_a2a.d.ts +6 -4
  519. package/dist/types/a2a/auth.d.ts +5 -1
  520. package/dist/types/a2a/event_processor_utils.d.ts +17 -2
  521. package/dist/types/a2a/executor_context.d.ts +7 -1
  522. package/dist/types/a2a/index.d.ts +18 -0
  523. package/dist/types/a2a/request_metadata.d.ts +22 -0
  524. package/dist/types/agents/base_agent.d.ts +56 -25
  525. package/dist/types/agents/context.d.ts +8 -0
  526. package/dist/types/agents/framework_function_calls.d.ts +26 -0
  527. package/dist/types/agents/functions.d.ts +73 -8
  528. package/dist/types/agents/invocation_context.d.ts +106 -6
  529. package/dist/types/agents/live_request_queue.d.ts +7 -1
  530. package/dist/types/agents/llm_agent.d.ts +86 -8
  531. package/dist/types/agents/loop_agent.d.ts +5 -0
  532. package/dist/types/agents/parallel_agent.d.ts +5 -0
  533. package/dist/types/agents/processors/agent_transfer_llm_request_processor.d.ts +16 -1
  534. package/dist/types/agents/processors/content_processor_utils.d.ts +3 -2
  535. package/dist/types/agents/processors/identity_llm_request_processor.d.ts +4 -1
  536. package/dist/types/agents/processors/request_input_llm_request_processor.d.ts +21 -0
  537. package/dist/types/agents/readonly_context.d.ts +4 -0
  538. package/dist/types/agents/run_config.d.ts +72 -4
  539. package/dist/types/agents/sequential_agent.d.ts +5 -0
  540. package/dist/types/agents/user_input_request.d.ts +71 -0
  541. package/dist/types/apps/app.d.ts +8 -3
  542. package/dist/types/artifacts/gcs_artifact_service.d.ts +9 -2
  543. package/dist/types/artifacts/scoped_artifact_service.d.ts +13 -0
  544. package/dist/types/artifacts/session_artifact_service.d.ts +8 -1
  545. package/dist/types/auth/auth_credential.d.ts +13 -8
  546. package/dist/types/auth/auth_handler.d.ts +12 -1
  547. package/dist/types/auth/credential_response_binding.d.ts +24 -0
  548. package/dist/types/auth/oauth2/oauth2_credential_refresher.d.ts +1 -1
  549. package/dist/types/auth/oauth2/oauth2_utils.d.ts +9 -0
  550. package/dist/types/auth/refresher/base_credential_refresher.d.ts +1 -1
  551. package/dist/types/code_executors/code_execution_utils.d.ts +1 -1
  552. package/dist/types/code_executors/container_code_executor.d.ts +89 -0
  553. package/dist/types/code_executors/docker_container.d.ts +79 -0
  554. package/dist/types/common.d.ts +39 -27
  555. package/dist/types/context/compaction_utils.d.ts +9 -1
  556. package/dist/types/environment/base_environment.d.ts +101 -0
  557. package/dist/types/environment/local_environment.d.ts +72 -0
  558. package/dist/types/errors/already_exists_error.d.ts +14 -0
  559. package/dist/types/errors/input_validation_error.d.ts +14 -0
  560. package/dist/types/errors/not_found_error.d.ts +14 -0
  561. package/dist/types/errors/session_not_found_error.d.ts +14 -0
  562. package/dist/types/errors/tool_execution_error.d.ts +36 -0
  563. package/dist/types/events/event.d.ts +94 -1
  564. package/dist/types/events/event_actions.d.ts +23 -0
  565. package/dist/types/index.d.ts +27 -14
  566. package/dist/types/memory/rag_memory_transcript.d.ts +55 -0
  567. package/dist/types/memory/vertex_ai_rag_api.d.ts +89 -0
  568. package/dist/types/memory/vertex_ai_rag_memory_service.d.ts +68 -0
  569. package/dist/types/models/apigee_llm.d.ts +4 -4
  570. package/dist/types/models/chrome_prompt_llm.d.ts +210 -0
  571. package/dist/types/models/chrome_prompt_utils.d.ts +68 -0
  572. package/dist/types/models/google_llm.d.ts +10 -4
  573. package/dist/types/models/registry.d.ts +3 -2
  574. package/dist/types/plugins/_reflect_retry_utils.d.ts +72 -0
  575. package/dist/types/plugins/base_plugin.d.ts +47 -10
  576. package/dist/types/plugins/logging_plugin.d.ts +3 -2
  577. package/dist/types/plugins/plugin_manager.d.ts +20 -0
  578. package/dist/types/plugins/reflect_retry_model_plugin.d.ts +132 -0
  579. package/dist/types/plugins/reflect_retry_tool_plugin.d.ts +187 -0
  580. package/dist/types/plugins/security_plugin.d.ts +4 -2
  581. package/dist/types/runner/in_memory_runner.d.ts +2 -2
  582. package/dist/types/runner/runner.d.ts +64 -9
  583. package/dist/types/sessions/base_session_service.d.ts +2 -2
  584. package/dist/types/sessions/database_session_service.d.ts +1 -1
  585. package/dist/types/sessions/db/operations.d.ts +13 -1
  586. package/dist/types/sessions/db/schema.d.ts +23 -9
  587. package/dist/types/sessions/state.d.ts +34 -1
  588. package/dist/types/sessions/state_write_order.d.ts +39 -0
  589. package/dist/types/telemetry/tracing.d.ts +15 -0
  590. package/dist/types/tools/base_tool.d.ts +26 -0
  591. package/dist/types/tools/base_toolset.d.ts +3 -4
  592. package/dist/types/tools/built_in_tool.d.ts +41 -0
  593. package/dist/types/tools/enterprise_web_search_tool.d.ts +4 -4
  594. package/dist/types/tools/finish_task_tool.d.ts +47 -0
  595. package/dist/types/tools/forwarding_artifact_service.d.ts +23 -10
  596. package/dist/types/tools/function_tool.d.ts +88 -10
  597. package/dist/types/tools/google_maps_grounding_tool.d.ts +4 -4
  598. package/dist/types/tools/google_search_tool.d.ts +4 -4
  599. package/dist/types/tools/long_running_tool.d.ts +1 -1
  600. package/dist/types/tools/mcp/index.d.ts +13 -0
  601. package/dist/types/tools/mcp/mcp_session_manager.d.ts +3 -3
  602. package/dist/types/tools/mcp/mcp_tool.d.ts +1 -1
  603. package/dist/types/tools/mcp/mcp_toolset.d.ts +12 -11
  604. package/dist/types/tools/openapi_tool/auth/auth_helpers.d.ts +5 -0
  605. package/dist/types/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.d.ts +0 -1
  606. package/dist/types/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.d.ts +0 -1
  607. package/dist/types/tools/preload_memory_tool.d.ts +1 -1
  608. package/dist/types/tools/request_input_tool.d.ts +6 -1
  609. package/dist/types/tools/resume_inputs.d.ts +25 -0
  610. package/dist/types/tools/retrieval/base_retrieval_tool.d.ts +21 -0
  611. package/dist/types/tools/retrieval/files_retrieval.d.ts +50 -0
  612. package/dist/types/tools/retrieval/llama_index_retrieval.d.ts +62 -0
  613. package/dist/types/tools/skill/skill_toolset.d.ts +26 -0
  614. package/dist/types/tools/tool_confirmation.d.ts +47 -0
  615. package/dist/types/tools/url_context_tool.d.ts +4 -4
  616. package/dist/types/tools/vertex_ai_search_tool.d.ts +4 -4
  617. package/dist/types/tools/vertex_rag_retrieval_tool.d.ts +13 -12
  618. package/dist/types/utils/async_queue.d.ts +34 -2
  619. package/dist/types/utils/crypto_shim.d.ts +16 -0
  620. package/dist/types/utils/deprecated.d.ts +21 -0
  621. package/dist/types/utils/env_aware_utils.d.ts +16 -0
  622. package/dist/types/utils/file_utils.d.ts +10 -2
  623. package/dist/types/utils/gemini_schema_util.d.ts +5 -7
  624. package/dist/types/utils/genai_schema_to_json.d.ts +25 -0
  625. package/dist/types/utils/logger.d.ts +23 -1
  626. package/dist/types/utils/logger_browser.d.ts +28 -0
  627. package/dist/types/utils/logger_node.d.ts +20 -0
  628. package/dist/types/utils/optional_peer.d.ts +36 -0
  629. package/dist/types/utils/output_schema_utils.d.ts +3 -3
  630. package/dist/types/utils/redact_inline_data.d.ts +16 -0
  631. package/dist/types/utils/redact_uri.d.ts +32 -0
  632. package/dist/types/utils/schema.d.ts +73 -0
  633. package/dist/types/utils/simple_zod_to_json.d.ts +8 -0
  634. package/dist/types/utils/ssrf_guard.d.ts +32 -0
  635. package/dist/types/utils/vertex_ai_utils.d.ts +4 -0
  636. package/dist/types/version.d.ts +1 -1
  637. package/dist/types/workflow/base_node.d.ts +142 -0
  638. package/dist/types/workflow/branch_path.d.ts +40 -0
  639. package/dist/types/workflow/dynamic_node_scheduler.d.ts +64 -0
  640. package/dist/types/workflow/errors.d.ts +132 -0
  641. package/dist/types/workflow/graph.d.ts +127 -0
  642. package/dist/types/workflow/index.d.ts +46 -0
  643. package/dist/types/workflow/node.d.ts +48 -0
  644. package/dist/types/workflow/node_builders.d.ts +25 -0
  645. package/dist/types/workflow/node_context.d.ts +208 -0
  646. package/dist/types/workflow/node_error_event.d.ts +18 -0
  647. package/dist/types/workflow/node_runner.d.ts +82 -0
  648. package/dist/types/workflow/node_state.d.ts +47 -0
  649. package/dist/types/workflow/node_status.d.ts +28 -0
  650. package/dist/types/workflow/nodes/function_node.d.ts +78 -0
  651. package/dist/types/workflow/nodes/join_node.d.ts +24 -0
  652. package/dist/types/workflow/nodes/node_tool.d.ts +53 -0
  653. package/dist/types/workflow/nodes/parallel_worker.d.ts +55 -0
  654. package/dist/types/workflow/nodes/tool_node.d.ts +34 -0
  655. package/dist/types/workflow/request_input.d.ts +73 -0
  656. package/dist/types/workflow/retry_config.d.ts +84 -0
  657. package/dist/types/workflow/run_llm_agent_as_node.d.ts +28 -0
  658. package/dist/types/workflow/run_node_as_invocation.d.ts +72 -0
  659. package/dist/types/workflow/schedule_dynamic_node.d.ts +66 -0
  660. package/dist/types/workflow/trigger.d.ts +22 -0
  661. package/dist/types/workflow/utils/graph_parser.d.ts +8 -0
  662. package/dist/types/workflow/utils/graph_validation.d.ts +18 -0
  663. package/dist/types/workflow/utils/hitl_utils.d.ts +92 -0
  664. package/dist/types/workflow/utils/rehydration_utils.d.ts +132 -0
  665. package/dist/types/workflow/utils/retry_utils.d.ts +54 -0
  666. package/dist/types/workflow/utils/workflow_graph_utils.d.ts +76 -0
  667. package/dist/types/workflow/workflow.d.ts +115 -0
  668. package/dist/web/index_web.js +304 -3
  669. package/dist/web/index_web.js.map +7 -0
  670. package/package.json +97 -20
  671. package/dist/web/a2a/a2a_event.js +0 -271
  672. package/dist/web/a2a/a2a_remote_agent.js +0 -196
  673. package/dist/web/a2a/a2a_remote_agent_run_processor.js +0 -184
  674. package/dist/web/a2a/a2a_remote_agent_utils.js +0 -133
  675. package/dist/web/a2a/agent_card.js +0 -342
  676. package/dist/web/a2a/agent_executor.js +0 -218
  677. package/dist/web/a2a/agent_to_a2a.js +0 -97
  678. package/dist/web/a2a/auth.js +0 -37
  679. package/dist/web/a2a/event_converter_utils.js +0 -232
  680. package/dist/web/a2a/event_processor_utils.js +0 -170
  681. package/dist/web/a2a/executor_context.js +0 -25
  682. package/dist/web/a2a/metadata_converter_utils.js +0 -110
  683. package/dist/web/a2a/part_converter_utils.js +0 -188
  684. package/dist/web/agents/active_streaming_tool.js +0 -21
  685. package/dist/web/agents/base_agent.js +0 -423
  686. package/dist/web/agents/context.js +0 -142
  687. package/dist/web/agents/functions.js +0 -433
  688. package/dist/web/agents/instructions.js +0 -148
  689. package/dist/web/agents/invocation_context.js +0 -77
  690. package/dist/web/agents/live_request_queue.js +0 -126
  691. package/dist/web/agents/llm_agent.js +0 -936
  692. package/dist/web/agents/loop_agent.js +0 -112
  693. package/dist/web/agents/parallel_agent.js +0 -101
  694. package/dist/web/agents/processors/agent_transfer_llm_request_processor.js +0 -109
  695. package/dist/web/agents/processors/base_llm_processor.js +0 -15
  696. package/dist/web/agents/processors/basic_llm_request_processor.js +0 -81
  697. package/dist/web/agents/processors/code_execution_request_processor.js +0 -367
  698. package/dist/web/agents/processors/content_processor_utils.js +0 -361
  699. package/dist/web/agents/processors/content_request_processor.js +0 -67
  700. package/dist/web/agents/processors/context_compactor_request_processor.js +0 -74
  701. package/dist/web/agents/processors/identity_llm_request_processor.js +0 -50
  702. package/dist/web/agents/processors/instructions_llm_request_processor.js +0 -81
  703. package/dist/web/agents/processors/interactions_request_processor.js +0 -52
  704. package/dist/web/agents/processors/request_confirmation_llm_request_processor.js +0 -168
  705. package/dist/web/agents/processors/tool_filter_request_processor.js +0 -68
  706. package/dist/web/agents/readonly_context.js +0 -55
  707. package/dist/web/agents/routed_agent.js +0 -169
  708. package/dist/web/agents/run_config.js +0 -62
  709. package/dist/web/agents/sequential_agent.js +0 -122
  710. package/dist/web/agents/transcription_entry.js +0 -7
  711. package/dist/web/apps/app.js +0 -49
  712. package/dist/web/apps/resumability_config.js +0 -31
  713. package/dist/web/artifacts/base_artifact_service.js +0 -7
  714. package/dist/web/artifacts/file_artifact_service.js +0 -548
  715. package/dist/web/artifacts/gcs_artifact_service.js +0 -253
  716. package/dist/web/artifacts/in_memory_artifact_service.js +0 -164
  717. package/dist/web/artifacts/registry.js +0 -30
  718. package/dist/web/artifacts/scoped_artifact_service.js +0 -86
  719. package/dist/web/auth/auth_credential.js +0 -18
  720. package/dist/web/auth/auth_handler.js +0 -148
  721. package/dist/web/auth/auth_preprocessor.js +0 -175
  722. package/dist/web/auth/auth_provider_registry.js +0 -33
  723. package/dist/web/auth/auth_schemes.js +0 -33
  724. package/dist/web/auth/auth_tool.js +0 -7
  725. package/dist/web/auth/credential_service/base_credential_service.js +0 -7
  726. package/dist/web/auth/credential_service/in_memory_credential_service.js +0 -46
  727. package/dist/web/auth/credential_service/session_state_credential_service.js +0 -23
  728. package/dist/web/auth/exchanger/base_credential_exchanger.js +0 -12
  729. package/dist/web/auth/exchanger/credential_exchanger_registry.js +0 -31
  730. package/dist/web/auth/oauth2/oauth2_credential_exchanger.js +0 -188
  731. package/dist/web/auth/oauth2/oauth2_credential_refresher.js +0 -102
  732. package/dist/web/auth/oauth2/oauth2_discovery.js +0 -190
  733. package/dist/web/auth/oauth2/oauth2_utils.js +0 -98
  734. package/dist/web/auth/refresher/base_credential_refresher.js +0 -16
  735. package/dist/web/auth/refresher/credential_refresher_registry.js +0 -40
  736. package/dist/web/code_executors/agent_engine_sandbox_code_executor.js +0 -281
  737. package/dist/web/code_executors/base_code_executor.js +0 -63
  738. package/dist/web/code_executors/built_in_code_executor.js +0 -45
  739. package/dist/web/code_executors/code_execution_utils.js +0 -124
  740. package/dist/web/code_executors/code_executor_context.js +0 -170
  741. package/dist/web/code_executors/unsafe_local_code_executor.js +0 -214
  742. package/dist/web/common.js +0 -347
  743. package/dist/web/context/agent_controlled_context_compactor.js +0 -72
  744. package/dist/web/context/anchored_context_compactor.js +0 -117
  745. package/dist/web/context/base_context_compactor.js +0 -7
  746. package/dist/web/context/compaction_utils.js +0 -38
  747. package/dist/web/context/summarizers/llm_summarizer.js +0 -87
  748. package/dist/web/context/token_based_context_compactor.js +0 -111
  749. package/dist/web/context/trajectory_thought_pruning_compactor.js +0 -43
  750. package/dist/web/context/truncating_context_compactor.js +0 -30
  751. package/dist/web/events/compacted_event.js +0 -47
  752. package/dist/web/events/event.js +0 -174
  753. package/dist/web/events/event_actions.js +0 -69
  754. package/dist/web/events/structured_events.js +0 -76
  755. package/dist/web/examples/base_example_provider.js +0 -27
  756. package/dist/web/examples/example.js +0 -7
  757. package/dist/web/examples/example_util.js +0 -79
  758. package/dist/web/features/feature_registry.js +0 -107
  759. package/dist/web/index.js +0 -68
  760. package/dist/web/integrations/agent_registry/agent_registry.js +0 -333
  761. package/dist/web/integrations/agent_registry/agent_registry_mcp_toolset.js +0 -117
  762. package/dist/web/integrations/agent_registry/helpers.js +0 -28
  763. package/dist/web/integrations/agent_registry/types.js +0 -20
  764. package/dist/web/memory/base_memory_service.js +0 -7
  765. package/dist/web/memory/in_memory_memory_service.js +0 -82
  766. package/dist/web/memory/memory_entry.js +0 -7
  767. package/dist/web/memory/vertex_ai_memory_bank_service.js +0 -481
  768. package/dist/web/models/apigee_llm.js +0 -221
  769. package/dist/web/models/base_llm.js +0 -73
  770. package/dist/web/models/base_llm_connection.js +0 -7
  771. package/dist/web/models/gemini_llm_connection.js +0 -179
  772. package/dist/web/models/google_llm.js +0 -384
  773. package/dist/web/models/interactions_utils.js +0 -728
  774. package/dist/web/models/llm_request.js +0 -52
  775. package/dist/web/models/llm_response.js +0 -45
  776. package/dist/web/models/registry.js +0 -95
  777. package/dist/web/models/routed_llm.js +0 -122
  778. package/dist/web/plugins/base_plugin.js +0 -271
  779. package/dist/web/plugins/global_instruction_plugin.js +0 -67
  780. package/dist/web/plugins/logging_plugin.js +0 -235
  781. package/dist/web/plugins/plugin_manager.js +0 -282
  782. package/dist/web/plugins/security_plugin.js +0 -140
  783. package/dist/web/runner/in_memory_runner.js +0 -46
  784. package/dist/web/runner/runner.js +0 -535
  785. package/dist/web/sessions/base_session_service.js +0 -111
  786. package/dist/web/sessions/database_session_service.js +0 -436
  787. package/dist/web/sessions/db/operations.js +0 -96
  788. package/dist/web/sessions/db/schema.js +0 -208
  789. package/dist/web/sessions/in_memory_session_service.js +0 -242
  790. package/dist/web/sessions/registry.js +0 -34
  791. package/dist/web/sessions/session.js +0 -20
  792. package/dist/web/sessions/state.js +0 -89
  793. package/dist/web/sessions/vertex_ai_session_service.js +0 -443
  794. package/dist/web/skills/gcp_skill_registry.js +0 -78
  795. package/dist/web/skills/loader.js +0 -360
  796. package/dist/web/skills/prompt.js +0 -30
  797. package/dist/web/skills/skill.js +0 -67
  798. package/dist/web/skills/skill_registry.js +0 -7
  799. package/dist/web/telemetry/google_cloud.js +0 -54
  800. package/dist/web/telemetry/setup.js +0 -83
  801. package/dist/web/telemetry/tracing.js +0 -234
  802. package/dist/web/tools/agent_tool.js +0 -145
  803. package/dist/web/tools/base_tool.js +0 -93
  804. package/dist/web/tools/base_toolset.js +0 -57
  805. package/dist/web/tools/consolidate_context_tool.js +0 -51
  806. package/dist/web/tools/enterprise_web_search_tool.js +0 -55
  807. package/dist/web/tools/example_tool.js +0 -42
  808. package/dist/web/tools/exit_loop_tool.js +0 -43
  809. package/dist/web/tools/forwarding_artifact_service.js +0 -47
  810. package/dist/web/tools/function_tool.js +0 -85
  811. package/dist/web/tools/get_user_choice_tool.js +0 -25
  812. package/dist/web/tools/google_maps_grounding_tool.js +0 -54
  813. package/dist/web/tools/google_search_tool.js +0 -51
  814. package/dist/web/tools/load_artifacts_tool.js +0 -152
  815. package/dist/web/tools/load_memory_tool.js +0 -79
  816. package/dist/web/tools/load_web_page.js +0 -221
  817. package/dist/web/tools/long_running_tool.js +0 -55
  818. package/dist/web/tools/mcp/load_mcp_resource_tool.js +0 -107
  819. package/dist/web/tools/mcp/mcp_session_manager.js +0 -78
  820. package/dist/web/tools/mcp/mcp_tool.js +0 -43
  821. package/dist/web/tools/mcp/mcp_toolset.js +0 -141
  822. package/dist/web/tools/openapi_tool/auth/auth_helpers.js +0 -48
  823. package/dist/web/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.js +0 -60
  824. package/dist/web/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.js +0 -111
  825. package/dist/web/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +0 -221
  826. package/dist/web/tools/openapi_tool/openapi_spec_parser/operation_parser.js +0 -198
  827. package/dist/web/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +0 -94
  828. package/dist/web/tools/openapi_tool/openapi_toolset.js +0 -97
  829. package/dist/web/tools/openapi_tool/rest_api_tool.js +0 -229
  830. package/dist/web/tools/preload_memory_tool.js +0 -77
  831. package/dist/web/tools/request_input_tool.js +0 -26
  832. package/dist/web/tools/skill/list_skills_tool.js +0 -50
  833. package/dist/web/tools/skill/load_skill_resource_tool.js +0 -190
  834. package/dist/web/tools/skill/load_skill_tool.js +0 -93
  835. package/dist/web/tools/skill/run_skill_inline_script_tool.js +0 -167
  836. package/dist/web/tools/skill/run_skill_script_tool.js +0 -201
  837. package/dist/web/tools/skill/search_skills_tool.js +0 -82
  838. package/dist/web/tools/skill/skill_toolset.js +0 -160
  839. package/dist/web/tools/tool_confirmation.js +0 -21
  840. package/dist/web/tools/url_context_tool.js +0 -44
  841. package/dist/web/tools/vertex_ai_search_tool.js +0 -103
  842. package/dist/web/tools/vertex_rag_retrieval_tool.js +0 -36
  843. package/dist/web/utils/async_hooks_shim.js +0 -24
  844. package/dist/web/utils/async_queue.js +0 -60
  845. package/dist/web/utils/branch_trie.js +0 -13
  846. package/dist/web/utils/case_utils.js +0 -25
  847. package/dist/web/utils/client_labels.js +0 -64
  848. package/dist/web/utils/crypto_shim.js +0 -15
  849. package/dist/web/utils/env_aware_utils.js +0 -74
  850. package/dist/web/utils/error_utils.js +0 -92
  851. package/dist/web/utils/experimental.js +0 -46
  852. package/dist/web/utils/failover_utils.js +0 -96
  853. package/dist/web/utils/file_extension_utils.js +0 -51
  854. package/dist/web/utils/file_utils.js +0 -103
  855. package/dist/web/utils/gemini_schema_util.js +0 -173
  856. package/dist/web/utils/live_connection_utils.js +0 -254
  857. package/dist/web/utils/logger.js +0 -130
  858. package/dist/web/utils/model_name.js +0 -66
  859. package/dist/web/utils/object_notation_utils.js +0 -49
  860. package/dist/web/utils/output_schema_utils.js +0 -15
  861. package/dist/web/utils/partial_copy.js +0 -23
  862. package/dist/web/utils/simple_zod_to_json.js +0 -123
  863. package/dist/web/utils/streaming_utils.js +0 -430
  864. package/dist/web/utils/task.js +0 -34
  865. package/dist/web/utils/variant_utils.js +0 -20
  866. package/dist/web/utils/vertex_ai_utils.js +0 -24
  867. package/dist/web/version.js +0 -11
  868. /package/dist/{web/artifacts/session_artifact_service.js → esm/tools/resume_inputs.js} +0 -0
  869. /package/dist/{web/auth/base_auth_provider.js → esm/workflow/trigger.js} +0 -0
@@ -1,8 +1,309 @@
1
- import {createRequire as topLevelCreateRequire} from 'module';
2
- const require = topLevelCreateRequire(import.meta.url);
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ var gF=Object.create;var $s=Object.defineProperty;var zb=Object.getOwnPropertyDescriptor;var hF=Object.getOwnPropertyNames;var vF=Object.getPrototypeOf,yF=Object.prototype.hasOwnProperty;var a=(t,e)=>$s(t,"name",{value:e,configurable:!0});var Uu=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},Rn=(t,e)=>{for(var n in e)$s(t,n,{get:e[n],enumerable:!0})},_F=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of hF(e))!yF.call(t,r)&&r!==n&&$s(t,r,{get:()=>e[r],enumerable:!(o=zb(e,r))||o.enumerable});return t};var xF=(t,e,n)=>(n=t!=null?gF(vF(t)):{},_F(e||!t||!t.__esModule?$s(n,"default",{value:t,enumerable:!0}):n,t));var Re=(t,e,n,o)=>{for(var r=o>1?void 0:o?zb(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(r=(o?s(e,n,r):s(r))||r);return o&&r&&$s(e,n,r),r};var xP=Uu((mue,_P)=>{function zt(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}a(zt,"RetryOperation");_P.exports=zt;zt.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};zt.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};zt.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var o=this;return this._timer=setTimeout(function(){o._attempts++,o._operationTimeoutCb&&(o._timeout=setTimeout(function(){o._operationTimeoutCb(o._attempts)},o._operationTimeout),o._options.unref&&o._timeout.unref()),o._fn(o._attempts)},n),this._options.unref&&this._timer.unref(),!0};zt.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};zt.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};zt.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};zt.prototype.start=zt.prototype.try;zt.prototype.errors=function(){return this._errors};zt.prototype.attempts=function(){return this._attempts};zt.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,n=0,o=0;o<this._errors.length;o++){var r=this._errors[o],i=r.message,s=(t[i]||0)+1;t[i]=s,s>=n&&(e=r,n=s)}return e}});var EP=Uu(zr=>{var n4=xP();zr.operation=function(t){var e=zr.timeouts(t);return new n4(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};zr.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in t)e[n]=t[n];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var o=[],r=0;r<e.retries;r++)o.push(this.createTimeout(r,e));return t&&t.forever&&!o.length&&o.push(this.createTimeout(r,e)),o.sort(function(i,s){return i-s}),o};zr.createTimeout=function(t,e){var n=e.randomize?Math.random()+1:1,o=Math.round(n*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return o=Math.min(o,e.maxTimeout),o};zr.wrap=function(t,e,n){if(e instanceof Array&&(n=e,e=null),!n){n=[];for(var o in t)typeof t[o]=="function"&&n.push(o)}for(var r=0;r<n.length;r++){var i=n[r],s=t[i];t[i]=a(function(c){var l=zr.operation(e),p=Array.prototype.slice.call(arguments,1),d=p.pop();p.push(function(g){l.retry(g)||(g&&(arguments[0]=l.mainError()),d.apply(this,arguments))}),l.attempt(function(){c.apply(t,p)})},"retryWrapper").bind(t,s),t[i].options=e}}});var TP=Uu((yue,SP)=>{SP.exports=EP()});var IP=Uu((_ue,Sl)=>{"use strict";var r4=TP(),o4=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"],om=class om extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}};a(om,"AbortError");var El=om,i4=a((t,e,n)=>{let o=n.retries-(e-1);return t.attemptNumber=e,t.retriesLeft=o,t},"decorateErrorWithCounts"),s4=a(t=>o4.includes(t),"isNetworkError"),CP=a((t,e)=>new Promise((n,o)=>{e={onFailedAttempt:a(()=>{},"onFailedAttempt"),retries:10,...e};let r=r4.operation(e);r.attempt(async i=>{try{n(await t(i))}catch(s){if(!(s instanceof Error)){o(new TypeError(`Non-error was thrown: "${s}". You should only throw errors.`));return}if(s instanceof El)r.stop(),o(s.originalError);else if(s instanceof TypeError&&!s4(s.message))r.stop(),o(s);else{i4(s,i,e);try{await e.onFailedAttempt(s)}catch(u){o(u);return}r.retry(s)||o(r.mainError())}}})}),"pRetry");Sl.exports=CP;Sl.exports.default=CP;Sl.exports.AbortError=El});var Ds=(r=>(r[r.DEBUG=0]="DEBUG",r[r.INFO=1]="INFO",r[r.WARN=2]="WARN",r[r.ERROR=3]="ERROR",r))(Ds||{}),Pp={0:"debug",1:"info",2:"warn",3:"error"},$p=class $p{constructor(){this.logLevel=1}setLogLevel(e){this.logLevel=e}log(e,...n){if(this.logLevel>e)return;let o=new Date().toISOString(),r=`${Ds[e]}: [ADK] ${o} ${n.join(" ")}`;console[Pp[e]](r)}debug(...e){this.log(0,...e)}info(...e){this.log(1,...e)}warn(...e){this.log(2,...e)}error(...e){this.log(3,...e)}};a($p,"SimpleLogger");var Fu=$p,Dp=class Dp{setLogLevel(e){}log(e,...n){}debug(...e){}info(...e){}warn(...e){}error(...e){}};a(Dp,"NoOpLogger");var kp=Dp,kn=new Fu;function Np(t){kn=t!=null?t:new kp}a(Np,"setLogger");function EF(){return kn}a(EF,"getLogger");function SF(){kn=new Fu}a(SF,"resetLogger");function TF(t){N.setLogLevel(t)}a(TF,"setLogLevel");var N={setLogLevel(t){kn.setLogLevel(t)},log(t,...e){kn.log(t,...e)},debug(...t){kn.debug(...t)},info(...t){kn.info(...t)},warn(...t){kn.warn(...t)},error(...t){kn.error(...t)}};var CF={0:"blue",1:"green",2:"orange",3:"red"},Lp=class Lp{constructor(){this.logLevel=1}setLogLevel(e){this.logLevel=e}log(e,...n){if(this.logLevel>e)return;let r=`: [ADK] ${new Date().toISOString()} ${n.join(" ")}`;console[Pp[e]](`%c${Ds[e]}%c${r}`,`color: ${CF[e]}`,"color: inherit")}debug(...e){this.log(0,...e)}info(...e){this.log(1,...e)}warn(...e){this.log(2,...e)}error(...e){this.log(3,...e)}};a(Lp,"BrowserLogger");var Op=Lp;function Gb(){Np(new Op)}a(Gb,"installBrowserLogger");var Mp=class Mp{constructor(e){this.executable=e;this.isDone=!1;this.abortController=new AbortController;let n=a(()=>{this.isDone=!0},"markDone");this.promise=e(this.abortController.signal),this.promise.then(n).catch(n)}cancel(){this.abortController.abort()}done(){return this.isDone}};a(Mp,"Task");var Os=Mp;var Fp=class Fp{constructor(e={}){e.task instanceof Promise?this.task=new Os(()=>e.task):this.task=e.task,this.stream=e.stream}};a(Fp,"ActiveStreamingTool");var Up=Fp;var Bb=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{};var Pn="1.9.0";var qb=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function IF(t){var e=new Set([t]),n=new Set,o=t.match(qb);if(!o)return function(){return!1};var r={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(r.prerelease!=null)return a(function(c){return c===t},"isExactmatch");function i(u){return n.add(u),!1}a(i,"_reject");function s(u){return e.add(u),!0}return a(s,"_accept"),a(function(c){if(e.has(c))return!0;if(n.has(c))return!1;var l=c.match(qb);if(!l)return i(c);var p={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};return p.prerelease!=null||r.major!==p.major?i(c):r.major===0?r.minor===p.minor&&r.patch<=p.patch?s(c):i(c):r.minor<=p.minor?s(c):i(c)},"isCompatible")}a(IF,"_makeCompatibilityCheck");var Vb=IF(Pn);var AF=Pn.split(".")[0],Ls=Symbol.for("opentelemetry.js.api."+AF),Ms=Bb;function Ro(t,e,n,o){var r;o===void 0&&(o=!1);var i=Ms[Ls]=(r=Ms[Ls])!==null&&r!==void 0?r:{version:Pn};if(!o&&i[t]){var s=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return n.error(s.stack||s.message),!1}if(i.version!==Pn){var s=new Error("@opentelemetry/api: Registration of version v"+i.version+" for "+t+" does not match previously registered API v"+Pn);return n.error(s.stack||s.message),!1}return i[t]=e,n.debug("@opentelemetry/api: Registered a global for "+t+" v"+Pn+"."),!0}a(Ro,"registerGlobal");function Nn(t){var e,n,o=(e=Ms[Ls])===null||e===void 0?void 0:e.version;if(!(!o||!Vb(o)))return(n=Ms[Ls])===null||n===void 0?void 0:n[t]}a(Nn,"getGlobal");function ko(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+Pn+".");var n=Ms[Ls];n&&delete n[t]}a(ko,"unregisterGlobal");var wF=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],s;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(u){s={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},bF=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},Zb=(function(){function t(e){this._namespace=e.namespace||"DiagComponentLogger"}return a(t,"DiagComponentLogger"),t.prototype.debug=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Us("debug",this._namespace,e)},t.prototype.error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Us("error",this._namespace,e)},t.prototype.info=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Us("info",this._namespace,e)},t.prototype.warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Us("warn",this._namespace,e)},t.prototype.verbose=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Us("verbose",this._namespace,e)},t})();function Us(t,e,n){var o=Nn("diag");if(o)return n.unshift(e),o[t].apply(o,bF([],wF(n),!1))}a(Us,"logProxy");var nt;(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(nt||(nt={}));function Hb(t,e){t<nt.NONE?t=nt.NONE:t>nt.ALL&&(t=nt.ALL),e=e||{};function n(o,r){var i=e[o];return typeof i=="function"&&t>=r?i.bind(e):function(){}}return a(n,"_filterFunc"),{error:n("error",nt.ERROR),warn:n("warn",nt.WARN),info:n("info",nt.INFO),debug:n("debug",nt.DEBUG),verbose:n("verbose",nt.VERBOSE)}}a(Hb,"createLogLevelDiagLogger");var RF=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],s;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(u){s={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},kF=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},PF="diag",Po=(function(){function t(){function e(r){return function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];var u=Nn("diag");if(u)return u[r].apply(u,kF([],RF(i),!1))}}a(e,"_logProxy");var n=this,o=a(function(r,i){var s,u,c;if(i===void 0&&(i={logLevel:nt.INFO}),r===n){var l=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((s=l.stack)!==null&&s!==void 0?s:l.message),!1}typeof i=="number"&&(i={logLevel:i});var p=Nn("diag"),d=Hb((u=i.logLevel)!==null&&u!==void 0?u:nt.INFO,r);if(p&&!i.suppressOverrideMessage){var g=(c=new Error().stack)!==null&&c!==void 0?c:"<failed to generate stacktrace>";p.warn("Current logger will be overwritten from "+g),d.warn("Current logger will overwrite one already registered from "+g)}return Ro("diag",d,n,!0)},"setLogger");n.setLogger=o,n.disable=function(){ko(PF,n)},n.createComponentLogger=function(r){return new Zb(r)},n.verbose=e("verbose"),n.debug=e("debug"),n.info=e("info"),n.warn=e("warn"),n.error=e("error")}return a(t,"DiagAPI"),t.instance=function(){return this._instance||(this._instance=new t),this._instance},t})();function Jb(t){return Symbol.for(t)}a(Jb,"createContextKey");var NF=(function(){function t(e){var n=this;n._currentContext=e?new Map(e):new Map,n.getValue=function(o){return n._currentContext.get(o)},n.setValue=function(o,r){var i=new t(n._currentContext);return i._currentContext.set(o,r),i},n.deleteValue=function(o){var r=new t(n._currentContext);return r._currentContext.delete(o),r}}return a(t,"BaseContext"),t})(),Kb=new NF;var $F=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],s;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(u){s={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},DF=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},Wb=(function(){function t(){}return a(t,"NoopContextManager"),t.prototype.active=function(){return Kb},t.prototype.with=function(e,n,o){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];return n.call.apply(n,DF([o],$F(r),!1))},t.prototype.bind=function(e,n){return n},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t})();var OF=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],s;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(u){s={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return i},LF=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},zp="context",MF=new Wb,No=(function(){function t(){}return a(t,"ContextAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(e){return Ro(zp,e,Po.instance())},t.prototype.active=function(){return this._getContextManager().active()},t.prototype.with=function(e,n,o){for(var r,i=[],s=3;s<arguments.length;s++)i[s-3]=arguments[s];return(r=this._getContextManager()).with.apply(r,LF([e,n,o],OF(i),!1))},t.prototype.bind=function(e,n){return this._getContextManager().bind(e,n)},t.prototype._getContextManager=function(){return Nn(zp)||MF},t.prototype.disable=function(){this._getContextManager().disable(),ko(zp,Po.instance())},t})();var zu;(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(zu||(zu={}));var Gp="0000000000000000",Bp="00000000000000000000000000000000",jb={traceId:Bp,spanId:Gp,traceFlags:zu.NONE};var er=(function(){function t(e){e===void 0&&(e=jb),this._spanContext=e}return a(t,"NonRecordingSpan"),t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(e,n){return this},t.prototype.setAttributes=function(e){return this},t.prototype.addEvent=function(e,n){return this},t.prototype.addLink=function(e){return this},t.prototype.addLinks=function(e){return this},t.prototype.setStatus=function(e){return this},t.prototype.updateName=function(e){return this},t.prototype.end=function(e){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(e,n){},t})();var qp=Jb("OpenTelemetry Context Key SPAN");function Gu(t){return t.getValue(qp)||void 0}a(Gu,"getSpan");function Yb(){return Gu(No.getInstance().active())}a(Yb,"getActiveSpan");function Fs(t,e){return t.setValue(qp,e)}a(Fs,"setSpan");function Xb(t){return t.deleteValue(qp)}a(Xb,"deleteSpan");function Qb(t,e){return Fs(t,new er(e))}a(Qb,"setSpanContext");function Bu(t){var e;return(e=Gu(t))===null||e===void 0?void 0:e.spanContext()}a(Bu,"getSpanContext");var UF=/^([0-9a-f]{32})$/i,FF=/^[0-9a-f]{16}$/i;function zF(t){return UF.test(t)&&t!==Bp}a(zF,"isValidTraceId");function GF(t){return FF.test(t)&&t!==Gp}a(GF,"isValidSpanId");function qu(t){return zF(t.traceId)&&GF(t.spanId)}a(qu,"isSpanContextValid");function eR(t){return new er(t)}a(eR,"wrapSpanContext");var Vp=No.getInstance(),Vu=(function(){function t(){}return a(t,"NoopTracer"),t.prototype.startSpan=function(e,n,o){o===void 0&&(o=Vp.active());var r=!!(n!=null&&n.root);if(r)return new er;var i=o&&Bu(o);return BF(i)&&qu(i)?new er(i):new er},t.prototype.startActiveSpan=function(e,n,o,r){var i,s,u;if(!(arguments.length<2)){arguments.length===2?u=n:arguments.length===3?(i=n,u=o):(i=n,s=o,u=r);var c=s!=null?s:Vp.active(),l=this.startSpan(e,i,c),p=Fs(c,l);return Vp.with(p,u,void 0,l)}},t})();function BF(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}a(BF,"isSpanContext");var qF=new Vu,tR=(function(){function t(e,n,o,r){this._provider=e,this.name=n,this.version=o,this.options=r}return a(t,"ProxyTracer"),t.prototype.startSpan=function(e,n,o){return this._getTracer().startSpan(e,n,o)},t.prototype.startActiveSpan=function(e,n,o,r){var i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)},t.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):qF},t})();var nR=(function(){function t(){}return a(t,"NoopTracerProvider"),t.prototype.getTracer=function(e,n,o){return new Vu},t})();var VF=new nR,Zp=(function(){function t(){}return a(t,"ProxyTracerProvider"),t.prototype.getTracer=function(e,n,o){var r;return(r=this.getDelegateTracer(e,n,o))!==null&&r!==void 0?r:new tR(this,e,n,o)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:VF},t.prototype.setDelegate=function(e){this._delegate=e},t.prototype.getDelegateTracer=function(e,n,o){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getTracer(e,n,o)},t})();var $o;(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})($o||($o={}));var Ue=No.getInstance();var Hp="trace",rR=(function(){function t(){this._proxyTracerProvider=new Zp,this.wrapSpanContext=eR,this.isSpanContextValid=qu,this.deleteSpan=Xb,this.getSpan=Gu,this.getActiveSpan=Yb,this.getSpanContext=Bu,this.setSpan=Fs,this.setSpanContext=Qb}return a(t,"TraceAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var n=Ro(Hp,this._proxyTracerProvider,Po.instance());return n&&this._proxyTracerProvider.setDelegate(e),n},t.prototype.getTracerProvider=function(){return Nn(Hp)||this._proxyTracerProvider},t.prototype.getTracer=function(e,n){return this.getTracerProvider().getTracer(e,n)},t.prototype.disable=function(){ko(Hp,Po.instance()),this._proxyTracerProvider=new Zp},t})();var $e=rR.getInstance();function oR(){throw new Error("randomUUID: no cryptographically secure source of randomness is available. Neither crypto.randomUUID() nor crypto.getRandomValues() is present in this environment.")}a(oR,"randomUUID");function iR(t){throw new Error("createHash: PKCE code challenges require a synchronous SHA-256, which the Web Crypto API does not provide (crypto.subtle.digest is async).")}a(iR,"createHash");function sR(t){throw new Error("randomBytes: no cryptographically secure source of randomness is available in this environment.")}a(sR,"randomBytes");var zs="GOOGLE_GENAI_USE_ENTERPRISE",Gs="GOOGLE_GENAI_USE_VERTEXAI";function jt(){return typeof window<"u"}a(jt,"isBrowser");function fn(){var t,e;if((t=globalThis.crypto)!=null&&t.randomUUID)return globalThis.crypto.randomUUID();if((e=globalThis.crypto)!=null&&e.getRandomValues){let n=globalThis.crypto.getRandomValues(new Uint8Array(16));n[6]=n[6]&15|64,n[8]=n[8]&63|128;let o=Array.from(n,r=>r.toString(16).padStart(2,"0"));return[o.slice(0,4),o.slice(4,6),o.slice(6,8),o.slice(8,10),o.slice(10,16)].map(r=>r.join("")).join("-")}return oR()}a(fn,"randomUUID");function lR(t){return jt()?window.atob(t):Buffer.from(t,"base64").toString()}a(lR,"base64Decode");function Ur(t){if(!process.env)return!1;let e=(process.env[t]||"").toLowerCase();return["true","1"].includes(e)}a(Ur,"getBooleanEnvVar");var aR=!1;function uR(t){aR||(aR=!0,N.warn(t))}a(uR,"warnDeprecatedEnterpriseModeEnvVar");function Zu(){var e,n;let t=((e=process.env)==null?void 0:e[Gs])!==void 0;return((n=process.env)==null?void 0:n[zs])!==void 0?(t&&uR(`${Gs} is set but ignored because ${zs} takes precedence. ${Gs} is deprecated, please use ${zs} instead.`),Ur(zs)):t?(uR(`${Gs} is deprecated, please use ${zs} instead`),Ur(Gs)):!1}a(Zu,"isEnterpriseModeEnabled");var ZF=typeof global=="object"&&global&&global.Object===Object&&global,Hu=ZF;var HF=typeof self=="object"&&self&&self.Object===Object&&self,JF=Hu||HF||Function("return this")(),Oe=JF;var KF=Oe.Symbol,Ut=KF;var cR=Object.prototype,WF=cR.hasOwnProperty,jF=cR.toString,Bs=Ut?Ut.toStringTag:void 0;function YF(t){var e=WF.call(t,Bs),n=t[Bs];try{t[Bs]=void 0;var o=!0}catch(i){}var r=jF.call(t);return o&&(e?t[Bs]=n:delete t[Bs]),r}a(YF,"getRawTag");var dR=YF;var XF=Object.prototype,QF=XF.toString;function ez(t){return QF.call(t)}a(ez,"objectToString");var fR=ez;var tz="[object Null]",nz="[object Undefined]",pR=Ut?Ut.toStringTag:void 0;function rz(t){return t==null?t===void 0?nz:tz:pR&&pR in Object(t)?dR(t):fR(t)}a(rz,"baseGetTag");var $n=rz;function oz(t){return t!=null&&typeof t=="object"}a(oz,"isObjectLike");var wt=oz;var iz=Array.isArray,Yt=iz;function sz(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}a(sz,"isObject");var pn=sz;var az="[object AsyncFunction]",uz="[object Function]",lz="[object GeneratorFunction]",cz="[object Proxy]";function dz(t){if(!pn(t))return!1;var e=$n(t);return e==uz||e==lz||e==az||e==cz}a(dz,"isFunction");var Ju=dz;var fz=Oe["__core-js_shared__"],Ku=fz;var mR=(function(){var t=/[^.]+$/.exec(Ku&&Ku.keys&&Ku.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function pz(t){return!!mR&&mR in t}a(pz,"isMasked");var gR=pz;var mz=Function.prototype,gz=mz.toString;function hz(t){if(t!=null){try{return gz.call(t)}catch(e){}try{return t+""}catch(e){}}return""}a(hz,"toSource");var Dn=hz;var vz=/[\\^$.*+?()[\]{}|]/g,yz=/^\[object .+?Constructor\]$/,_z=Function.prototype,xz=Object.prototype,Ez=_z.toString,Sz=xz.hasOwnProperty,Tz=RegExp("^"+Ez.call(Sz).replace(vz,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Cz(t){if(!pn(t)||gR(t))return!1;var e=Ju(t)?Tz:yz;return e.test(Dn(t))}a(Cz,"baseIsNative");var hR=Cz;function Iz(t,e){return t==null?void 0:t[e]}a(Iz,"getValue");var vR=Iz;function Az(t,e){var n=vR(t,e);return hR(n)?n:void 0}a(Az,"getNative");var ht=Az;var wz=ht(Oe,"WeakMap"),Wu=wz;var yR=Object.create,bz=(function(){function t(){}return a(t,"object"),function(e){if(!pn(e))return{};if(yR)return yR(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})(),_R=bz;function Rz(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}a(Rz,"copyArray");var xR=Rz;var kz=(function(){try{var t=ht(Object,"defineProperty");return t({},"",{}),t}catch(e){}})(),Jp=kz;function Pz(t,e){for(var n=-1,o=t==null?0:t.length;++n<o&&e(t[n],n,t)!==!1;);return t}a(Pz,"arrayEach");var ER=Pz;var Nz=9007199254740991,$z=/^(?:0|[1-9]\d*)$/;function Dz(t,e){var n=typeof t;return e=e==null?Nz:e,!!e&&(n=="number"||n!="symbol"&&$z.test(t))&&t>-1&&t%1==0&&t<e}a(Dz,"isIndex");var SR=Dz;function Oz(t,e,n){e=="__proto__"&&Jp?Jp(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}a(Oz,"baseAssignValue");var ju=Oz;function Lz(t,e){return t===e||t!==t&&e!==e}a(Lz,"eq");var Do=Lz;var Mz=Object.prototype,Uz=Mz.hasOwnProperty;function Fz(t,e,n){var o=t[e];(!(Uz.call(t,e)&&Do(o,n))||n===void 0&&!(e in t))&&ju(t,e,n)}a(Fz,"assignValue");var Yu=Fz;function zz(t,e,n,o){var r=!n;n||(n={});for(var i=-1,s=e.length;++i<s;){var u=e[i],c=o?o(n[u],t[u],u,n,t):void 0;c===void 0&&(c=t[u]),r?ju(n,u,c):Yu(n,u,c)}return n}a(zz,"copyObject");var tr=zz;var Gz=9007199254740991;function Bz(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Gz}a(Bz,"isLength");var Xu=Bz;function qz(t){return t!=null&&Xu(t.length)&&!Ju(t)}a(qz,"isArrayLike");var Oo=qz;var Vz=Object.prototype;function Zz(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Vz;return t===n}a(Zz,"isPrototype");var nr=Zz;function Hz(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o}a(Hz,"baseTimes");var TR=Hz;var Jz="[object Arguments]";function Kz(t){return wt(t)&&$n(t)==Jz}a(Kz,"baseIsArguments");var Kp=Kz;var CR=Object.prototype,Wz=CR.hasOwnProperty,jz=CR.propertyIsEnumerable,Yz=Kp((function(){return arguments})())?Kp:function(t){return wt(t)&&Wz.call(t,"callee")&&!jz.call(t,"callee")},Qu=Yz;function Xz(){return!1}a(Xz,"stubFalse");var IR=Xz;var bR=typeof exports=="object"&&exports&&!exports.nodeType&&exports,AR=bR&&typeof module=="object"&&module&&!module.nodeType&&module,Qz=AR&&AR.exports===bR,wR=Qz?Oe.Buffer:void 0,eG=wR?wR.isBuffer:void 0,tG=eG||IR,On=tG;var nG="[object Arguments]",rG="[object Array]",oG="[object Boolean]",iG="[object Date]",sG="[object Error]",aG="[object Function]",uG="[object Map]",lG="[object Number]",cG="[object Object]",dG="[object RegExp]",fG="[object Set]",pG="[object String]",mG="[object WeakMap]",gG="[object ArrayBuffer]",hG="[object DataView]",vG="[object Float32Array]",yG="[object Float64Array]",_G="[object Int8Array]",xG="[object Int16Array]",EG="[object Int32Array]",SG="[object Uint8Array]",TG="[object Uint8ClampedArray]",CG="[object Uint16Array]",IG="[object Uint32Array]",Se={};Se[vG]=Se[yG]=Se[_G]=Se[xG]=Se[EG]=Se[SG]=Se[TG]=Se[CG]=Se[IG]=!0;Se[nG]=Se[rG]=Se[gG]=Se[oG]=Se[hG]=Se[iG]=Se[sG]=Se[aG]=Se[uG]=Se[lG]=Se[cG]=Se[dG]=Se[fG]=Se[pG]=Se[mG]=!1;function AG(t){return wt(t)&&Xu(t.length)&&!!Se[$n(t)]}a(AG,"baseIsTypedArray");var RR=AG;function wG(t){return function(e){return t(e)}}a(wG,"baseUnary");var Lo=wG;var kR=typeof exports=="object"&&exports&&!exports.nodeType&&exports,qs=kR&&typeof module=="object"&&module&&!module.nodeType&&module,bG=qs&&qs.exports===kR,Wp=bG&&Hu.process,RG=(function(){try{var t=qs&&qs.require&&qs.require("util").types;return t||Wp&&Wp.binding&&Wp.binding("util")}catch(e){}})(),Ln=RG;var PR=Ln&&Ln.isTypedArray,kG=PR?Lo(PR):RR,Mo=kG;var PG=Object.prototype,NG=PG.hasOwnProperty;function $G(t,e){var n=Yt(t),o=!n&&Qu(t),r=!n&&!o&&On(t),i=!n&&!o&&!r&&Mo(t),s=n||o||r||i,u=s?TR(t.length,String):[],c=u.length;for(var l in t)(e||NG.call(t,l))&&!(s&&(l=="length"||r&&(l=="offset"||l=="parent")||i&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||SR(l,c)))&&u.push(l);return u}a($G,"arrayLikeKeys");var el=$G;function DG(t,e){return function(n){return t(e(n))}}a(DG,"overArg");var tl=DG;var OG=tl(Object.keys,Object),NR=OG;var LG=Object.prototype,MG=LG.hasOwnProperty;function UG(t){if(!nr(t))return NR(t);var e=[];for(var n in Object(t))MG.call(t,n)&&n!="constructor"&&e.push(n);return e}a(UG,"baseKeys");var nl=UG;function FG(t){return Oo(t)?el(t):nl(t)}a(FG,"keys");var Uo=FG;function zG(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}a(zG,"nativeKeysIn");var $R=zG;var GG=Object.prototype,BG=GG.hasOwnProperty;function qG(t){if(!pn(t))return $R(t);var e=nr(t),n=[];for(var o in t)o=="constructor"&&(e||!BG.call(t,o))||n.push(o);return n}a(qG,"baseKeysIn");var DR=qG;function VG(t){return Oo(t)?el(t,!0):DR(t)}a(VG,"keysIn");var Fo=VG;var ZG=ht(Object,"create"),Mn=ZG;function HG(){this.__data__=Mn?Mn(null):{},this.size=0}a(HG,"hashClear");var OR=HG;function JG(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}a(JG,"hashDelete");var LR=JG;var KG="__lodash_hash_undefined__",WG=Object.prototype,jG=WG.hasOwnProperty;function YG(t){var e=this.__data__;if(Mn){var n=e[t];return n===KG?void 0:n}return jG.call(e,t)?e[t]:void 0}a(YG,"hashGet");var MR=YG;var XG=Object.prototype,QG=XG.hasOwnProperty;function eB(t){var e=this.__data__;return Mn?e[t]!==void 0:QG.call(e,t)}a(eB,"hashHas");var UR=eB;var tB="__lodash_hash_undefined__";function nB(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Mn&&e===void 0?tB:e,this}a(nB,"hashSet");var FR=nB;function zo(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}a(zo,"Hash");zo.prototype.clear=OR;zo.prototype.delete=LR;zo.prototype.get=MR;zo.prototype.has=UR;zo.prototype.set=FR;var jp=zo;function rB(){this.__data__=[],this.size=0}a(rB,"listCacheClear");var zR=rB;function oB(t,e){for(var n=t.length;n--;)if(Do(t[n][0],e))return n;return-1}a(oB,"assocIndexOf");var rr=oB;var iB=Array.prototype,sB=iB.splice;function aB(t){var e=this.__data__,n=rr(e,t);if(n<0)return!1;var o=e.length-1;return n==o?e.pop():sB.call(e,n,1),--this.size,!0}a(aB,"listCacheDelete");var GR=aB;function uB(t){var e=this.__data__,n=rr(e,t);return n<0?void 0:e[n][1]}a(uB,"listCacheGet");var BR=uB;function lB(t){return rr(this.__data__,t)>-1}a(lB,"listCacheHas");var qR=lB;function cB(t,e){var n=this.__data__,o=rr(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}a(cB,"listCacheSet");var VR=cB;function Go(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}a(Go,"ListCache");Go.prototype.clear=zR;Go.prototype.delete=GR;Go.prototype.get=BR;Go.prototype.has=qR;Go.prototype.set=VR;var or=Go;var dB=ht(Oe,"Map"),ir=dB;function fB(){this.size=0,this.__data__={hash:new jp,map:new(ir||or),string:new jp}}a(fB,"mapCacheClear");var ZR=fB;function pB(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}a(pB,"isKeyable");var HR=pB;function mB(t,e){var n=t.__data__;return HR(e)?n[typeof e=="string"?"string":"hash"]:n.map}a(mB,"getMapData");var sr=mB;function gB(t){var e=sr(this,t).delete(t);return this.size-=e?1:0,e}a(gB,"mapCacheDelete");var JR=gB;function hB(t){return sr(this,t).get(t)}a(hB,"mapCacheGet");var KR=hB;function vB(t){return sr(this,t).has(t)}a(vB,"mapCacheHas");var WR=vB;function yB(t,e){var n=sr(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this}a(yB,"mapCacheSet");var jR=yB;function Bo(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}a(Bo,"MapCache");Bo.prototype.clear=ZR;Bo.prototype.delete=JR;Bo.prototype.get=KR;Bo.prototype.has=WR;Bo.prototype.set=jR;var rl=Bo;function _B(t,e){for(var n=-1,o=e.length,r=t.length;++n<o;)t[r+n]=e[n];return t}a(_B,"arrayPush");var ol=_B;var xB=tl(Object.getPrototypeOf,Object),il=xB;function EB(){this.__data__=new or,this.size=0}a(EB,"stackClear");var YR=EB;function SB(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}a(SB,"stackDelete");var XR=SB;function TB(t){return this.__data__.get(t)}a(TB,"stackGet");var QR=TB;function CB(t){return this.__data__.has(t)}a(CB,"stackHas");var ek=CB;var IB=200;function AB(t,e){var n=this.__data__;if(n instanceof or){var o=n.__data__;if(!ir||o.length<IB-1)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new rl(o)}return n.set(t,e),this.size=n.size,this}a(AB,"stackSet");var tk=AB;function qo(t){var e=this.__data__=new or(t);this.size=e.size}a(qo,"Stack");qo.prototype.clear=YR;qo.prototype.delete=XR;qo.prototype.get=QR;qo.prototype.has=ek;qo.prototype.set=tk;var Vo=qo;function wB(t,e){return t&&tr(e,Uo(e),t)}a(wB,"baseAssign");var nk=wB;function bB(t,e){return t&&tr(e,Fo(e),t)}a(bB,"baseAssignIn");var rk=bB;var ak=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ok=ak&&typeof module=="object"&&module&&!module.nodeType&&module,RB=ok&&ok.exports===ak,ik=RB?Oe.Buffer:void 0,sk=ik?ik.allocUnsafe:void 0;function kB(t,e){if(e)return t.slice();var n=t.length,o=sk?sk(n):new t.constructor(n);return t.copy(o),o}a(kB,"cloneBuffer");var uk=kB;function PB(t,e){for(var n=-1,o=t==null?0:t.length,r=0,i=[];++n<o;){var s=t[n];e(s,n,t)&&(i[r++]=s)}return i}a(PB,"arrayFilter");var lk=PB;function NB(){return[]}a(NB,"stubArray");var sl=NB;var $B=Object.prototype,DB=$B.propertyIsEnumerable,ck=Object.getOwnPropertySymbols,OB=ck?function(t){return t==null?[]:(t=Object(t),lk(ck(t),function(e){return DB.call(t,e)}))}:sl,Zo=OB;function LB(t,e){return tr(t,Zo(t),e)}a(LB,"copySymbols");var dk=LB;var MB=Object.getOwnPropertySymbols,UB=MB?function(t){for(var e=[];t;)ol(e,Zo(t)),t=il(t);return e}:sl,al=UB;function FB(t,e){return tr(t,al(t),e)}a(FB,"copySymbolsIn");var fk=FB;function zB(t,e,n){var o=e(t);return Yt(t)?o:ol(o,n(t))}a(zB,"baseGetAllKeys");var ul=zB;function GB(t){return ul(t,Uo,Zo)}a(GB,"getAllKeys");var Vs=GB;function BB(t){return ul(t,Fo,al)}a(BB,"getAllKeysIn");var pk=BB;var qB=ht(Oe,"DataView"),ll=qB;var VB=ht(Oe,"Promise"),cl=VB;var ZB=ht(Oe,"Set"),dl=ZB;var mk="[object Map]",HB="[object Object]",gk="[object Promise]",hk="[object Set]",vk="[object WeakMap]",yk="[object DataView]",JB=Dn(ll),KB=Dn(ir),WB=Dn(cl),jB=Dn(dl),YB=Dn(Wu),Fr=$n;(ll&&Fr(new ll(new ArrayBuffer(1)))!=yk||ir&&Fr(new ir)!=mk||cl&&Fr(cl.resolve())!=gk||dl&&Fr(new dl)!=hk||Wu&&Fr(new Wu)!=vk)&&(Fr=a(function(t){var e=$n(t),n=e==HB?t.constructor:void 0,o=n?Dn(n):"";if(o)switch(o){case JB:return yk;case KB:return mk;case WB:return gk;case jB:return hk;case YB:return vk}return e},"getTag"));var Xt=Fr;var XB=Object.prototype,QB=XB.hasOwnProperty;function eq(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&QB.call(t,"index")&&(n.index=t.index,n.input=t.input),n}a(eq,"initCloneArray");var _k=eq;var tq=Oe.Uint8Array,Ho=tq;function nq(t){var e=new t.constructor(t.byteLength);return new Ho(e).set(new Ho(t)),e}a(nq,"cloneArrayBuffer");var Jo=nq;function rq(t,e){var n=e?Jo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}a(rq,"cloneDataView");var xk=rq;var oq=/\w*$/;function iq(t){var e=new t.constructor(t.source,oq.exec(t));return e.lastIndex=t.lastIndex,e}a(iq,"cloneRegExp");var Ek=iq;var Sk=Ut?Ut.prototype:void 0,Tk=Sk?Sk.valueOf:void 0;function sq(t){return Tk?Object(Tk.call(t)):{}}a(sq,"cloneSymbol");var Ck=sq;function aq(t,e){var n=e?Jo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}a(aq,"cloneTypedArray");var Ik=aq;var uq="[object Boolean]",lq="[object Date]",cq="[object Map]",dq="[object Number]",fq="[object RegExp]",pq="[object Set]",mq="[object String]",gq="[object Symbol]",hq="[object ArrayBuffer]",vq="[object DataView]",yq="[object Float32Array]",_q="[object Float64Array]",xq="[object Int8Array]",Eq="[object Int16Array]",Sq="[object Int32Array]",Tq="[object Uint8Array]",Cq="[object Uint8ClampedArray]",Iq="[object Uint16Array]",Aq="[object Uint32Array]";function wq(t,e,n){var o=t.constructor;switch(e){case hq:return Jo(t);case uq:case lq:return new o(+t);case vq:return xk(t,n);case yq:case _q:case xq:case Eq:case Sq:case Tq:case Cq:case Iq:case Aq:return Ik(t,n);case cq:return new o;case dq:case mq:return new o(t);case fq:return Ek(t);case pq:return new o;case gq:return Ck(t)}}a(wq,"initCloneByTag");var Ak=wq;function bq(t){return typeof t.constructor=="function"&&!nr(t)?_R(il(t)):{}}a(bq,"initCloneObject");var wk=bq;var Rq="[object Map]";function kq(t){return wt(t)&&Xt(t)==Rq}a(kq,"baseIsMap");var bk=kq;var Rk=Ln&&Ln.isMap,Pq=Rk?Lo(Rk):bk,kk=Pq;var Nq="[object Set]";function $q(t){return wt(t)&&Xt(t)==Nq}a($q,"baseIsSet");var Pk=$q;var Nk=Ln&&Ln.isSet,Dq=Nk?Lo(Nk):Pk,$k=Dq;var Oq=1,Lq=2,Mq=4,Dk="[object Arguments]",Uq="[object Array]",Fq="[object Boolean]",zq="[object Date]",Gq="[object Error]",Ok="[object Function]",Bq="[object GeneratorFunction]",qq="[object Map]",Vq="[object Number]",Lk="[object Object]",Zq="[object RegExp]",Hq="[object Set]",Jq="[object String]",Kq="[object Symbol]",Wq="[object WeakMap]",jq="[object ArrayBuffer]",Yq="[object DataView]",Xq="[object Float32Array]",Qq="[object Float64Array]",eV="[object Int8Array]",tV="[object Int16Array]",nV="[object Int32Array]",rV="[object Uint8Array]",oV="[object Uint8ClampedArray]",iV="[object Uint16Array]",sV="[object Uint32Array]",xe={};xe[Dk]=xe[Uq]=xe[jq]=xe[Yq]=xe[Fq]=xe[zq]=xe[Xq]=xe[Qq]=xe[eV]=xe[tV]=xe[nV]=xe[qq]=xe[Vq]=xe[Lk]=xe[Zq]=xe[Hq]=xe[Jq]=xe[Kq]=xe[rV]=xe[oV]=xe[iV]=xe[sV]=!0;xe[Gq]=xe[Ok]=xe[Wq]=!1;function fl(t,e,n,o,r,i){var s,u=e&Oq,c=e&Lq,l=e&Mq;if(n&&(s=r?n(t,o,r,i):n(t)),s!==void 0)return s;if(!pn(t))return t;var p=Yt(t);if(p){if(s=_k(t),!u)return xR(t,s)}else{var d=Xt(t),g=d==Ok||d==Bq;if(On(t))return uk(t,u);if(d==Lk||d==Dk||g&&!r){if(s=c||g?{}:wk(t),!u)return c?fk(t,rk(s,t)):dk(t,nk(s,t))}else{if(!xe[d])return r?t:{};s=Ak(t,d,u)}}i||(i=new Vo);var h=i.get(t);if(h)return h;i.set(t,s),$k(t)?t.forEach(function(_){s.add(fl(_,e,n,_,t,i))}):kk(t)&&t.forEach(function(_,x){s.set(x,fl(_,e,n,x,t,i))});var v=l?c?pk:Vs:c?Fo:Uo,y=p?void 0:v(t);return ER(y||t,function(_,x){y&&(x=_,_=t[x]),Yu(s,x,fl(_,e,n,x,t,i))}),s}a(fl,"baseClone");var Mk=fl;var aV=1,uV=4;function lV(t){return Mk(t,aV|uV)}a(lV,"cloneDeep");var ze=lV;var cV="__lodash_hash_undefined__";function dV(t){return this.__data__.set(t,cV),this}a(dV,"setCacheAdd");var Uk=dV;function fV(t){return this.__data__.has(t)}a(fV,"setCacheHas");var Fk=fV;function pl(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new rl;++e<n;)this.add(t[e])}a(pl,"SetCache");pl.prototype.add=pl.prototype.push=Uk;pl.prototype.has=Fk;var zk=pl;function pV(t,e){for(var n=-1,o=t==null?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1}a(pV,"arraySome");var Gk=pV;function mV(t,e){return t.has(e)}a(mV,"cacheHas");var Bk=mV;var gV=1,hV=2;function vV(t,e,n,o,r,i){var s=n&gV,u=t.length,c=e.length;if(u!=c&&!(s&&c>u))return!1;var l=i.get(t),p=i.get(e);if(l&&p)return l==e&&p==t;var d=-1,g=!0,h=n&hV?new zk:void 0;for(i.set(t,e),i.set(e,t);++d<u;){var v=t[d],y=e[d];if(o)var _=s?o(y,v,d,e,t,i):o(v,y,d,t,e,i);if(_!==void 0){if(_)continue;g=!1;break}if(h){if(!Gk(e,function(x,E){if(!Bk(h,E)&&(v===x||r(v,x,n,o,i)))return h.push(E)})){g=!1;break}}else if(!(v===y||r(v,y,n,o,i))){g=!1;break}}return i.delete(t),i.delete(e),g}a(vV,"equalArrays");var ml=vV;function yV(t){var e=-1,n=Array(t.size);return t.forEach(function(o,r){n[++e]=[r,o]}),n}a(yV,"mapToArray");var qk=yV;function _V(t){var e=-1,n=Array(t.size);return t.forEach(function(o){n[++e]=o}),n}a(_V,"setToArray");var Vk=_V;var xV=1,EV=2,SV="[object Boolean]",TV="[object Date]",CV="[object Error]",IV="[object Map]",AV="[object Number]",wV="[object RegExp]",bV="[object Set]",RV="[object String]",kV="[object Symbol]",PV="[object ArrayBuffer]",NV="[object DataView]",Zk=Ut?Ut.prototype:void 0,Yp=Zk?Zk.valueOf:void 0;function $V(t,e,n,o,r,i,s){switch(n){case NV:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case PV:return!(t.byteLength!=e.byteLength||!i(new Ho(t),new Ho(e)));case SV:case TV:case AV:return Do(+t,+e);case CV:return t.name==e.name&&t.message==e.message;case wV:case RV:return t==e+"";case IV:var u=qk;case bV:var c=o&xV;if(u||(u=Vk),t.size!=e.size&&!c)return!1;var l=s.get(t);if(l)return l==e;o|=EV,s.set(t,e);var p=ml(u(t),u(e),o,r,i,s);return s.delete(t),p;case kV:if(Yp)return Yp.call(t)==Yp.call(e)}return!1}a($V,"equalByTag");var Hk=$V;var DV=1,OV=Object.prototype,LV=OV.hasOwnProperty;function MV(t,e,n,o,r,i){var s=n&DV,u=Vs(t),c=u.length,l=Vs(e),p=l.length;if(c!=p&&!s)return!1;for(var d=c;d--;){var g=u[d];if(!(s?g in e:LV.call(e,g)))return!1}var h=i.get(t),v=i.get(e);if(h&&v)return h==e&&v==t;var y=!0;i.set(t,e),i.set(e,t);for(var _=s;++d<c;){g=u[d];var x=t[g],E=e[g];if(o)var T=s?o(E,x,g,e,t,i):o(x,E,g,t,e,i);if(!(T===void 0?x===E||r(x,E,n,o,i):T)){y=!1;break}_||(_=g=="constructor")}if(y&&!_){var S=t.constructor,I=e.constructor;S!=I&&"constructor"in t&&"constructor"in e&&!(typeof S=="function"&&S instanceof S&&typeof I=="function"&&I instanceof I)&&(y=!1)}return i.delete(t),i.delete(e),y}a(MV,"equalObjects");var Jk=MV;var UV=1,Kk="[object Arguments]",Wk="[object Array]",gl="[object Object]",FV=Object.prototype,jk=FV.hasOwnProperty;function zV(t,e,n,o,r,i){var s=Yt(t),u=Yt(e),c=s?Wk:Xt(t),l=u?Wk:Xt(e);c=c==Kk?gl:c,l=l==Kk?gl:l;var p=c==gl,d=l==gl,g=c==l;if(g&&On(t)){if(!On(e))return!1;s=!0,p=!1}if(g&&!p)return i||(i=new Vo),s||Mo(t)?ml(t,e,n,o,r,i):Hk(t,e,c,n,o,r,i);if(!(n&UV)){var h=p&&jk.call(t,"__wrapped__"),v=d&&jk.call(e,"__wrapped__");if(h||v){var y=h?t.value():t,_=v?e.value():e;return i||(i=new Vo),r(y,_,n,o,i)}}return g?(i||(i=new Vo),Jk(t,e,n,o,r,i)):!1}a(zV,"baseIsEqualDeep");var Yk=zV;function Xk(t,e,n,o,r){return t===e?!0:t==null||e==null||!wt(t)&&!wt(e)?t!==t&&e!==e:Yk(t,e,n,o,Xk,r)}a(Xk,"baseIsEqual");var Qk=Xk;var GV="[object Map]",BV="[object Set]",qV=Object.prototype,VV=qV.hasOwnProperty;function ZV(t){if(t==null)return!0;if(Oo(t)&&(Yt(t)||typeof t=="string"||typeof t.splice=="function"||On(t)||Mo(t)||Qu(t)))return!t.length;var e=Xt(t);if(e==GV||e==BV)return!t.size;if(nr(t))return!nl(t).length;for(var n in t)if(VV.call(t,n))return!1;return!0}a(ZV,"isEmpty");var rt=ZV;function HV(t,e){return Qk(t,e)}a(HV,"isEqual");var Xp=HV;var eP=0,Qp=new WeakMap,Ko=new WeakMap;function Zs(t,e){let n=t.get(e);return n||(n=new Map,t.set(e,n)),n}a(Zs,"stampsFor");function em(t,e,n){let o=++eP;Zs(Qp,t).set(n,o),e&&e!==t&&Zs(Ko,e).set(n,o)}a(em,"recordStateWrite");function tP(t,e,n){var i,s;let o=(i=Ko.get(e))==null?void 0:i.get(n),r=(s=Qp.get(t))==null?void 0:s.get(n);return o!==void 0&&r!==void 0&&r>o?!1:(Zs(Qp,t).set(n,o!=null?o:++eP),!0)}a(tP,"shouldApplyDeltaWrite");function nP(t,e,n){var r;let o=(r=Ko.get(t))==null?void 0:r.get(n);o!==void 0&&Zs(Ko,e).set(n,o)}a(nP,"carryDeltaStamp");function hl(t,e){let n=Ko.get(t);if(!n)return;let o=Zs(Ko,e);for(let[r,i]of n)o.set(r,i)}a(hl,"carryDeltaStamps");function Ft(t={}){return{stateDelta:{},artifactDelta:{},requestedAuthConfigs:{},requestedToolConfirmations:{},...t}}a(Ft,"createEventActions");function vl(t){return rt(t.stateDelta)&&rt(t.artifactDelta)&&rt(t.requestedAuthConfigs)&&rt(t.requestedToolConfirmations)&&t.skipSummarization===void 0&&t.transferToAgent===void 0&&t.escalate===void 0}a(vl,"isDefaultEventActions");function rP(t,e){let n=Ft();e&&Object.assign(n,e);for(let o of t)o&&(o.stateDelta&&(Object.assign(n.stateDelta,o.stateDelta),hl(o.stateDelta,n.stateDelta)),o.artifactDelta&&Object.assign(n.artifactDelta,o.artifactDelta),o.requestedAuthConfigs&&Object.assign(n.requestedAuthConfigs,o.requestedAuthConfigs),o.requestedToolConfirmations&&Object.assign(n.requestedToolConfirmations,o.requestedToolConfirmations),o.skipSummarization!==void 0&&(n.skipSummarization=o.skipSummarization),o.transferToAgent!==void 0&&(n.transferToAgent=o.transferToAgent),o.escalate!==void 0&&(n.escalate=o.escalate));return n}a(rP,"mergeEventActions");var tm=Symbol.for("google.adk.event");function J(t={}){return{...t,[tm]:!0,id:t.id||rm(),invocationId:t.invocationId||"",author:t.author,actions:Ft(t.actions),longRunningToolIds:t.longRunningToolIds||[],branch:t.branch,timestamp:t.timestamp||Date.now()}}a(J,"createEvent");function ar(t){return t.actions.skipSummarization||t.longRunningToolIds&&t.longRunningToolIds.length>0||t.actions.requestedAuthConfigs&&Object.keys(t.actions.requestedAuthConfigs).length>0?!0:le(t).length===0&&fe(t).length===0&&!t.partial&&!iP(t)}a(ar,"isFinalResponse");function le(t){let e=[];if(t.content&&t.content.parts)for(let n of t.content.parts)n.functionCall&&e.push(n.functionCall);return e}a(le,"getFunctionCalls");var Hs="adk-";function bt(){return`${Hs}${fn()}`}a(bt,"generateClientFunctionCallId");function Js(t){for(let e of le(t))e.id||(e.id=bt())}a(Js,"populateClientFunctionCallId");function fe(t){let e=[];if(t.content&&t.content.parts)for(let n of t.content.parts)n.functionResponse&&e.push(n.functionResponse);return e}a(fe,"getFunctionResponses");function iP(t){var e;return t.content&&((e=t.content.parts)!=null&&e.length)?t.content.parts[t.content.parts.length-1].codeExecutionResult!==void 0:!1}a(iP,"hasTrailingCodeExecutionResult");function yl(t){var e;return(e=t.content)!=null&&e.parts?t.content.parts.filter(n=>!n.thought).map(n=>{var o;return(o=n.text)!=null?o:""}).join(""):""}a(yl,"stringifyContent");function sP(t){var n;if(((n=t.usageMetadata)==null?void 0:n.promptTokenCount)!==void 0)return t.usageMetadata.promptTokenCount;let e=yl(t);return Math.ceil(e.length/4)}a(sP,"getEventTokens");function _l(t){var e,n;return!!((n=(e=t.content)==null?void 0:e.parts)!=null&&n.some(o=>o.thought===!0))}a(_l,"hasThoughts");function nm(t){var n;if(!((n=t.content)!=null&&n.parts))return t;let e=t.content.parts.filter(o=>o.thought!==!0);return{...t,content:{...t.content,parts:e}}}a(nm,"pruneThoughts");var oP="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function xl(t){return typeof t=="object"&&t!==null&&tm in t&&t[tm]===!0}a(xl,"isEvent");function rm(){let t="";for(let e=0;e<8;e++)t+=oP[Math.floor(Math.random()*oP.length)];return t}a(rm,"createNewEventId");var Ks="2.1.0";var JV="gen_ai.agent.description",aP="gen_ai.agent.name",uP="gen_ai.conversation.id",Ys="gen_ai.operation.name",lP="gen_ai.tool.call.id",cP="gen_ai.tool.description",dP="gen_ai.tool.name",KV="gen_ai.tool.type",WV="adk.workflow.name",fP="adk.node.path",jV="adk.node.run_id",YV="adk.node.attempt",XV="adk.node.status",QV="adk.node.interrupt_count",Ze=$e.getTracer("gcp.vertex.agent",Ks);function Ws(t){try{return JSON.stringify(t)}catch(e){return"<not serializable>"}}a(Ws,"safeJsonSerialize");function pP({agent:t,invocationContext:e}){let n=$e.getActiveSpan();n&&n.setAttributes({[Ys]:"invoke_agent",[JV]:t.description,[aP]:t.name,[uP]:e.session.id})}a(pP,"traceAgentInvocation");function mP({workflowName:t,nodePath:e,sessionId:n}){let o=$e.getActiveSpan();o&&o.setAttributes({[Ys]:"invoke_workflow",[uP]:n,[WV]:t,[fP]:e})}a(mP,"traceWorkflowInvocation");function Wo({nodePath:t,runId:e,attempt:n,status:o,interruptCount:r}){let i=$e.getActiveSpan();i&&i.setAttributes({[Ys]:"execute_node",[fP]:t,[jV]:e,[YV]:n,[XV]:o,[QV]:r})}a(Wo,"traceNodeExecution");function gP({tool:t,args:e,functionResponseEvent:n}){var s,u;let o=$e.getActiveSpan();if(!o)return;o.setAttributes({[Ys]:"execute_tool",[cP]:t.description||"",[dP]:t.name,[KV]:t.constructor.name,"gcp.vertex.agent.llm_request":"{}","gcp.vertex.agent.llm_response":"{}","gcp.vertex.agent.tool_call_args":js()?Ws(e):"{}"});let r="<not specified>",i="<not specified>";if((s=n.content)!=null&&s.parts){let l=(u=n.content.parts[0])==null?void 0:u.functionResponse;l!=null&&l.id&&(r=l.id),l!=null&&l.response&&(i=l.response)}(typeof i!="object"||i===null)&&(i={result:i}),o.setAttributes({[lP]:r,"gcp.vertex.agent.event_id":n.id,"gcp.vertex.agent.tool_response":js()?Ws(i):"{}"})}a(gP,"traceToolCall");function hP({responseEventId:t,functionResponseEvent:e}){let n=$e.getActiveSpan();n&&(n.setAttributes({[Ys]:"execute_tool",[dP]:"(merged tools)",[cP]:"(merged tools)",[lP]:t,"gcp.vertex.agent.tool_call_args":"N/A","gcp.vertex.agent.event_id":t,"gcp.vertex.agent.llm_request":"{}","gcp.vertex.agent.llm_response":"{}"}),n.setAttribute("gcp.vertex.agent.tool_response",js()?Ws(e):"{}"))}a(hP,"traceMergedToolCalls");function vP({invocationContext:t,eventId:e,llmRequest:n,llmResponse:o}){var i,s,u,c;let r=$e.getActiveSpan();if(r&&(r.setAttributes({"gen_ai.system":"gcp.vertex.agent","gen_ai.request.model":n.model,...(i=t.agent)!=null&&i.name?{[aP]:t.agent.name}:{},"gcp.vertex.agent.invocation_id":t.invocationId,"gcp.vertex.agent.session_id":t.session.id,"gcp.vertex.agent.event_id":e,"gcp.vertex.agent.llm_request":js()?Ws(t4(n)):"{}"}),(s=n.config)!=null&&s.topP&&r.setAttribute("gen_ai.request.top_p",n.config.topP),((u=n.config)==null?void 0:u.maxOutputTokens)!==void 0&&r.setAttribute("gen_ai.request.max_tokens",n.config.maxOutputTokens),r.setAttribute("gcp.vertex.agent.llm_response",js()?Ws(o):"{}"),o.usageMetadata&&r.setAttribute("gen_ai.usage.input_tokens",o.usageMetadata.promptTokenCount||0),(c=o.usageMetadata)!=null&&c.candidatesTokenCount&&r.setAttribute("gen_ai.usage.output_tokens",o.usageMetadata.candidatesTokenCount),o.finishReason)){let l=typeof o.finishReason=="string"?o.finishReason.toLowerCase():String(o.finishReason).toLowerCase();r.setAttribute("gen_ai.response.finish_reasons",[l])}}a(vP,"traceCallLlm");function e4(t){let e={...t};return delete e.headers,delete e.extraBody,e}a(e4,"redactHttpOptions");function t4(t){let e={model:t.model,contents:[]};if(t.config){let{responseSchema:n,...o}=t.config;o.httpOptions&&(o.httpOptions=e4(o.httpOptions)),e.config=o}return e.contents=t.contents.map(n=>{var o;return{role:n.role,parts:((o=n.parts)==null?void 0:o.filter(r=>!r.inlineData))||[]}}),e}a(t4,"buildLlmRequestForTrace");function yP(t,e){return{next:Ue.bind(t,e.next.bind(e)),return:Ue.bind(t,e.return.bind(e)),throw:Ue.bind(t,e.throw.bind(e)),[Symbol.asyncIterator](){return yP(t,e[Symbol.asyncIterator]())}}}a(yP,"bindOtelContextToAsyncGenerator");function ur(t,e,n){let o=n.call(e);return yP(t,o)}a(ur,"runAsyncGeneratorWithOtelContext");function js(){let t=process.env.ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS||"true";return t==="true"||t==="1"}a(js,"shouldAddRequestResponseToSpans");var ac=xF(IP(),1);var a4,u4;function l4(){return{geminiUrl:a4,vertexUrl:u4}}a(l4,"getDefaultBaseUrls");function c4(t,e,n,o){var r,i;if(!(t!=null&&t.baseUrl)){let s=l4();return e?(r=s.vertexUrl)!==null&&r!==void 0?r:n:(i=s.geminiUrl)!==null&&i!==void 0?i:o}return t.baseUrl}a(c4,"getBaseUrl");var zg=class zg{};a(zg,"BaseModule");var en=zg;function q(t,e){let n=/\{([^}]+)\}/g;return t.replace(n,(o,r)=>{if(Object.prototype.hasOwnProperty.call(e,r)){let i=e[r];return i!=null?String(i):""}else throw new Error(`Key '${r}' not found in valueMap.`)})}a(q,"formatMap");function m(t,e,n){for(let i=0;i<e.length-1;i++){let s=e[i];if(s.endsWith("[]")){let u=s.slice(0,-2);if(!(u in t))if(Array.isArray(n))t[u]=Array.from({length:n.length},()=>({}));else throw new Error(`Value must be a list given an array path ${s}`);if(Array.isArray(t[u])){let c=t[u];if(Array.isArray(n))for(let l=0;l<c.length;l++){let p=c[l];m(p,e.slice(i+1),n[l])}else for(let l of c)m(l,e.slice(i+1),n)}return}else if(s.endsWith("[0]")){let u=s.slice(0,-3);u in t||(t[u]=[{}]);let c=t[u];m(c[0],e.slice(i+1),n);return}(!t[s]||typeof t[s]!="object")&&(t[s]={}),t=t[s]}let o=e[e.length-1],r=t[o];if(r!==void 0){if(!n||typeof n=="object"&&Object.keys(n).length===0||n===r)return;if(typeof r=="object"&&typeof n=="object"&&r!==null&&n!==null)Object.assign(r,n);else throw new Error(`Cannot set value for an existing key. Key: ${o}`)}else o==="_self"&&typeof n=="object"&&n!==null&&!Array.isArray(n)?Object.assign(t,n):t[o]=n}a(m,"setValueByPath");function f(t,e,n=void 0){try{if(e.length===1&&e[0]==="_self")return t;for(let o=0;o<e.length;o++){if(typeof t!="object"||t===null)return n;let r=e[o];if(r.endsWith("[]")){let i=r.slice(0,-2);if(i in t){let s=t[i];return Array.isArray(s)?s.map(u=>f(u,e.slice(o+1),n)):n}else return n}else t=t[r]}return t}catch(o){if(o instanceof TypeError)return n;throw o}}a(f,"getValueByPath");function d4(t,e){for(let[n,o]of Object.entries(e)){let r=n.split("."),i=o.split("."),s=new Set,u=-1;for(let c=0;c<r.length;c++)if(r[c]==="*"){u=c;break}if(u!==-1&&i.length>u)for(let c=u;c<i.length;c++){let l=i[c];l!=="*"&&!l.endsWith("[]")&&!l.endsWith("[0]")&&s.add(l)}am(t,r,i,0,s)}}a(d4,"moveValueByPath");function am(t,e,n,o,r){if(o>=e.length||typeof t!="object"||t===null)return;let i=e[o];if(i.endsWith("[]")){let s=i.slice(0,-2),u=t;if(s in u&&Array.isArray(u[s]))for(let c of u[s])am(c,e,n,o+1,r)}else if(i==="*"){if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let s=t,u=Object.keys(s).filter(l=>!l.startsWith("_")&&!r.has(l)),c={};for(let l of u)c[l]=s[l];for(let[l,p]of Object.entries(c)){let d=[];for(let g of n.slice(o))g==="*"?d.push(l):d.push(g);m(s,d,p)}for(let l of u)delete s[l]}}else{let s=t;i in s&&am(s[i],e,n,o+1,r)}}a(am,"_moveValueRecursive");function $g(t){if(typeof t!="string")throw new Error("fromImageBytes must be a string");return t}a($g,"tBytes$1");function f4(t){let e={},n=f(t,["operationName"]);n!=null&&m(e,["operationName"],n);let o=f(t,["resourceName"]);return o!=null&&m(e,["_url","resourceName"],o),e}a(f4,"fetchPredictOperationParametersToVertex");function p4(t){let e={},n=f(t,["name"]);n!=null&&m(e,["name"],n);let o=f(t,["metadata"]);o!=null&&m(e,["metadata"],o);let r=f(t,["done"]);r!=null&&m(e,["done"],r);let i=f(t,["error"]);i!=null&&m(e,["error"],i);let s=f(t,["response","generateVideoResponse"]);return s!=null&&m(e,["response"],g4(s)),e}a(p4,"generateVideosOperationFromMldev$1");function m4(t){let e={},n=f(t,["name"]);n!=null&&m(e,["name"],n);let o=f(t,["metadata"]);o!=null&&m(e,["metadata"],o);let r=f(t,["done"]);r!=null&&m(e,["done"],r);let i=f(t,["error"]);i!=null&&m(e,["error"],i);let s=f(t,["response"]);return s!=null&&m(e,["response"],h4(s)),e}a(m4,"generateVideosOperationFromVertex$1");function g4(t){let e={},n=f(t,["generatedSamples"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(s=>v4(s))),m(e,["generatedVideos"],i)}let o=f(t,["raiMediaFilteredCount"]);o!=null&&m(e,["raiMediaFilteredCount"],o);let r=f(t,["raiMediaFilteredReasons"]);return r!=null&&m(e,["raiMediaFilteredReasons"],r),e}a(g4,"generateVideosResponseFromMldev$1");function h4(t){let e={},n=f(t,["videos"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(s=>y4(s))),m(e,["generatedVideos"],i)}let o=f(t,["raiMediaFilteredCount"]);o!=null&&m(e,["raiMediaFilteredCount"],o);let r=f(t,["raiMediaFilteredReasons"]);return r!=null&&m(e,["raiMediaFilteredReasons"],r),e}a(h4,"generateVideosResponseFromVertex$1");function v4(t){let e={},n=f(t,["video"]);return n!=null&&m(e,["video"],C4(n)),e}a(v4,"generatedVideoFromMldev$1");function y4(t){let e={},n=f(t,["_self"]);return n!=null&&m(e,["video"],I4(n)),e}a(y4,"generatedVideoFromVertex$1");function _4(t){let e={},n=f(t,["operationName"]);return n!=null&&m(e,["_url","operationName"],n),e}a(_4,"getOperationParametersToMldev");function x4(t){let e={},n=f(t,["operationName"]);return n!=null&&m(e,["_url","operationName"],n),e}a(x4,"getOperationParametersToVertex");function E4(t){let e={},n=f(t,["name"]);n!=null&&m(e,["name"],n);let o=f(t,["metadata"]);o!=null&&m(e,["metadata"],o);let r=f(t,["done"]);r!=null&&m(e,["done"],r);let i=f(t,["error"]);i!=null&&m(e,["error"],i);let s=f(t,["response"]);return s!=null&&m(e,["response"],S4(s)),e}a(E4,"importFileOperationFromMldev$1");function S4(t){let e={},n=f(t,["sdkHttpResponse"]);n!=null&&m(e,["sdkHttpResponse"],n);let o=f(t,["parent"]);o!=null&&m(e,["parent"],o);let r=f(t,["documentName"]);return r!=null&&m(e,["documentName"],r),e}a(S4,"importFileResponseFromMldev$1");function g$(t){let e={},n=f(t,["name"]);n!=null&&m(e,["name"],n);let o=f(t,["metadata"]);o!=null&&m(e,["metadata"],o);let r=f(t,["done"]);r!=null&&m(e,["done"],r);let i=f(t,["error"]);i!=null&&m(e,["error"],i);let s=f(t,["response"]);return s!=null&&m(e,["response"],T4(s)),e}a(g$,"uploadToFileSearchStoreOperationFromMldev");function T4(t){let e={},n=f(t,["sdkHttpResponse"]);n!=null&&m(e,["sdkHttpResponse"],n);let o=f(t,["parent"]);o!=null&&m(e,["parent"],o);let r=f(t,["documentName"]);return r!=null&&m(e,["documentName"],r),e}a(T4,"uploadToFileSearchStoreResponseFromMldev");function C4(t){let e={},n=f(t,["uri"]);n!=null&&m(e,["uri"],n);let o=f(t,["encodedVideo"]);o!=null&&m(e,["videoBytes"],$g(o));let r=f(t,["encoding"]);return r!=null&&m(e,["mimeType"],r),e}a(C4,"videoFromMldev$1");function I4(t){let e={},n=f(t,["gcsUri"]);n!=null&&m(e,["uri"],n);let o=f(t,["bytesBase64Encoded"]);o!=null&&m(e,["videoBytes"],$g(o));let r=f(t,["mimeType"]);return r!=null&&m(e,["mimeType"],r),e}a(I4,"videoFromVertex$1");var mn;(function(t){t.OUTCOME_UNSPECIFIED="OUTCOME_UNSPECIFIED",t.OUTCOME_OK="OUTCOME_OK",t.OUTCOME_FAILED="OUTCOME_FAILED",t.OUTCOME_DEADLINE_EXCEEDED="OUTCOME_DEADLINE_EXCEEDED"})(mn||(mn={}));var Rl;(function(t){t.LANGUAGE_UNSPECIFIED="LANGUAGE_UNSPECIFIED",t.PYTHON="PYTHON"})(Rl||(Rl={}));var AP;(function(t){t.SCHEDULING_UNSPECIFIED="SCHEDULING_UNSPECIFIED",t.SILENT="SILENT",t.WHEN_IDLE="WHEN_IDLE",t.INTERRUPT="INTERRUPT"})(AP||(AP={}));var j;(function(t){t.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",t.STRING="STRING",t.NUMBER="NUMBER",t.INTEGER="INTEGER",t.BOOLEAN="BOOLEAN",t.ARRAY="ARRAY",t.OBJECT="OBJECT",t.NULL="NULL"})(j||(j={}));var wP;(function(t){t.ENVIRONMENT_UNSPECIFIED="ENVIRONMENT_UNSPECIFIED",t.ENVIRONMENT_BROWSER="ENVIRONMENT_BROWSER",t.ENVIRONMENT_MOBILE="ENVIRONMENT_MOBILE",t.ENVIRONMENT_DESKTOP="ENVIRONMENT_DESKTOP"})(wP||(wP={}));var bP;(function(t){t.AUTH_TYPE_UNSPECIFIED="AUTH_TYPE_UNSPECIFIED",t.NO_AUTH="NO_AUTH",t.API_KEY_AUTH="API_KEY_AUTH",t.HTTP_BASIC_AUTH="HTTP_BASIC_AUTH",t.GOOGLE_SERVICE_ACCOUNT_AUTH="GOOGLE_SERVICE_ACCOUNT_AUTH",t.OAUTH="OAUTH",t.OIDC_AUTH="OIDC_AUTH"})(bP||(bP={}));var RP;(function(t){t.HTTP_IN_UNSPECIFIED="HTTP_IN_UNSPECIFIED",t.HTTP_IN_QUERY="HTTP_IN_QUERY",t.HTTP_IN_HEADER="HTTP_IN_HEADER",t.HTTP_IN_PATH="HTTP_IN_PATH",t.HTTP_IN_BODY="HTTP_IN_BODY",t.HTTP_IN_COOKIE="HTTP_IN_COOKIE"})(RP||(RP={}));var kP;(function(t){t.API_SPEC_UNSPECIFIED="API_SPEC_UNSPECIFIED",t.SIMPLE_SEARCH="SIMPLE_SEARCH",t.ELASTIC_SEARCH="ELASTIC_SEARCH"})(kP||(kP={}));var PP;(function(t){t.PHISH_BLOCK_THRESHOLD_UNSPECIFIED="PHISH_BLOCK_THRESHOLD_UNSPECIFIED",t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_HIGH_AND_ABOVE="BLOCK_HIGH_AND_ABOVE",t.BLOCK_HIGHER_AND_ABOVE="BLOCK_HIGHER_AND_ABOVE",t.BLOCK_VERY_HIGH_AND_ABOVE="BLOCK_VERY_HIGH_AND_ABOVE",t.BLOCK_ONLY_EXTREMELY_HIGH="BLOCK_ONLY_EXTREMELY_HIGH"})(PP||(PP={}));var NP;(function(t){t.UNSPECIFIED="UNSPECIFIED",t.BLOCKING="BLOCKING",t.NON_BLOCKING="NON_BLOCKING"})(NP||(NP={}));var $P;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.MODE_DYNAMIC="MODE_DYNAMIC"})($P||($P={}));var DP;(function(t){t.THINKING_LEVEL_UNSPECIFIED="THINKING_LEVEL_UNSPECIFIED",t.MINIMAL="MINIMAL",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"})(DP||(DP={}));var OP;(function(t){t.DONT_ALLOW="DONT_ALLOW",t.ALLOW_ADULT="ALLOW_ADULT",t.ALLOW_ALL="ALLOW_ALL"})(OP||(OP={}));var LP;(function(t){t.PROMINENT_PEOPLE_UNSPECIFIED="PROMINENT_PEOPLE_UNSPECIFIED",t.ALLOW_PROMINENT_PEOPLE="ALLOW_PROMINENT_PEOPLE",t.BLOCK_PROMINENT_PEOPLE="BLOCK_PROMINENT_PEOPLE"})(LP||(LP={}));var MP;(function(t){t.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",t.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",t.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",t.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",t.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",t.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY",t.HARM_CATEGORY_IMAGE_HATE="HARM_CATEGORY_IMAGE_HATE",t.HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT="HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT",t.HARM_CATEGORY_IMAGE_HARASSMENT="HARM_CATEGORY_IMAGE_HARASSMENT",t.HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT="HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT",t.HARM_CATEGORY_JAILBREAK="HARM_CATEGORY_JAILBREAK"})(MP||(MP={}));var UP;(function(t){t.HARM_BLOCK_METHOD_UNSPECIFIED="HARM_BLOCK_METHOD_UNSPECIFIED",t.SEVERITY="SEVERITY",t.PROBABILITY="PROBABILITY"})(UP||(UP={}));var FP;(function(t){t.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",t.BLOCK_NONE="BLOCK_NONE",t.OFF="OFF"})(FP||(FP={}));var zP;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.AUTO="AUTO",t.ANY="ANY",t.NONE="NONE",t.VALIDATED="VALIDATED"})(zP||(zP={}));var gn;(function(t){t.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",t.STOP="STOP",t.MAX_TOKENS="MAX_TOKENS",t.SAFETY="SAFETY",t.RECITATION="RECITATION",t.LANGUAGE="LANGUAGE",t.OTHER="OTHER",t.BLOCKLIST="BLOCKLIST",t.PROHIBITED_CONTENT="PROHIBITED_CONTENT",t.SPII="SPII",t.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",t.IMAGE_SAFETY="IMAGE_SAFETY",t.UNEXPECTED_TOOL_CALL="UNEXPECTED_TOOL_CALL",t.IMAGE_PROHIBITED_CONTENT="IMAGE_PROHIBITED_CONTENT",t.NO_IMAGE="NO_IMAGE",t.IMAGE_RECITATION="IMAGE_RECITATION",t.IMAGE_OTHER="IMAGE_OTHER"})(gn||(gn={}));var GP;(function(t){t.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",t.NEGLIGIBLE="NEGLIGIBLE",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"})(GP||(GP={}));var BP;(function(t){t.HARM_SEVERITY_UNSPECIFIED="HARM_SEVERITY_UNSPECIFIED",t.HARM_SEVERITY_NEGLIGIBLE="HARM_SEVERITY_NEGLIGIBLE",t.HARM_SEVERITY_LOW="HARM_SEVERITY_LOW",t.HARM_SEVERITY_MEDIUM="HARM_SEVERITY_MEDIUM",t.HARM_SEVERITY_HIGH="HARM_SEVERITY_HIGH"})(BP||(BP={}));var qP;(function(t){t.URL_RETRIEVAL_STATUS_UNSPECIFIED="URL_RETRIEVAL_STATUS_UNSPECIFIED",t.URL_RETRIEVAL_STATUS_SUCCESS="URL_RETRIEVAL_STATUS_SUCCESS",t.URL_RETRIEVAL_STATUS_ERROR="URL_RETRIEVAL_STATUS_ERROR",t.URL_RETRIEVAL_STATUS_PAYWALL="URL_RETRIEVAL_STATUS_PAYWALL",t.URL_RETRIEVAL_STATUS_UNSAFE="URL_RETRIEVAL_STATUS_UNSAFE"})(qP||(qP={}));var VP;(function(t){t.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",t.SAFETY="SAFETY",t.OTHER="OTHER",t.BLOCKLIST="BLOCKLIST",t.PROHIBITED_CONTENT="PROHIBITED_CONTENT",t.IMAGE_SAFETY="IMAGE_SAFETY",t.MODEL_ARMOR="MODEL_ARMOR",t.JAILBREAK="JAILBREAK"})(VP||(VP={}));var ZP;(function(t){t.TRAFFIC_TYPE_UNSPECIFIED="TRAFFIC_TYPE_UNSPECIFIED",t.ON_DEMAND="ON_DEMAND",t.ON_DEMAND_PRIORITY="ON_DEMAND_PRIORITY",t.ON_DEMAND_FLEX="ON_DEMAND_FLEX",t.PROVISIONED_THROUGHPUT="PROVISIONED_THROUGHPUT"})(ZP||(ZP={}));var HP;(function(t){t.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",t.TEXT="TEXT",t.IMAGE="IMAGE",t.VIDEO="VIDEO",t.AUDIO="AUDIO",t.DOCUMENT="DOCUMENT"})(HP||(HP={}));var JP;(function(t){t.MODEL_STAGE_UNSPECIFIED="MODEL_STAGE_UNSPECIFIED",t.UNSTABLE_EXPERIMENTAL="UNSTABLE_EXPERIMENTAL",t.EXPERIMENTAL="EXPERIMENTAL",t.PREVIEW="PREVIEW",t.STABLE="STABLE",t.LEGACY="LEGACY",t.DEPRECATED="DEPRECATED",t.RETIRED="RETIRED"})(JP||(JP={}));var KP;(function(t){t.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",t.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",t.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",t.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH"})(KP||(KP={}));var Br;(function(t){t.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",t.TEXT="TEXT",t.IMAGE="IMAGE",t.AUDIO="AUDIO",t.VIDEO="VIDEO"})(Br||(Br={}));var WP;(function(t){t.TUNING_MODE_UNSPECIFIED="TUNING_MODE_UNSPECIFIED",t.TUNING_MODE_FULL="TUNING_MODE_FULL",t.TUNING_MODE_PEFT_ADAPTER="TUNING_MODE_PEFT_ADAPTER"})(WP||(WP={}));var jP;(function(t){t.ADAPTER_SIZE_UNSPECIFIED="ADAPTER_SIZE_UNSPECIFIED",t.ADAPTER_SIZE_ONE="ADAPTER_SIZE_ONE",t.ADAPTER_SIZE_TWO="ADAPTER_SIZE_TWO",t.ADAPTER_SIZE_FOUR="ADAPTER_SIZE_FOUR",t.ADAPTER_SIZE_EIGHT="ADAPTER_SIZE_EIGHT",t.ADAPTER_SIZE_SIXTEEN="ADAPTER_SIZE_SIXTEEN",t.ADAPTER_SIZE_THIRTY_TWO="ADAPTER_SIZE_THIRTY_TWO"})(jP||(jP={}));var um;(function(t){t.JOB_STATE_UNSPECIFIED="JOB_STATE_UNSPECIFIED",t.JOB_STATE_QUEUED="JOB_STATE_QUEUED",t.JOB_STATE_PENDING="JOB_STATE_PENDING",t.JOB_STATE_RUNNING="JOB_STATE_RUNNING",t.JOB_STATE_SUCCEEDED="JOB_STATE_SUCCEEDED",t.JOB_STATE_FAILED="JOB_STATE_FAILED",t.JOB_STATE_CANCELLING="JOB_STATE_CANCELLING",t.JOB_STATE_CANCELLED="JOB_STATE_CANCELLED",t.JOB_STATE_PAUSED="JOB_STATE_PAUSED",t.JOB_STATE_EXPIRED="JOB_STATE_EXPIRED",t.JOB_STATE_UPDATING="JOB_STATE_UPDATING",t.JOB_STATE_PARTIALLY_SUCCEEDED="JOB_STATE_PARTIALLY_SUCCEEDED"})(um||(um={}));var YP;(function(t){t.TUNING_JOB_STATE_UNSPECIFIED="TUNING_JOB_STATE_UNSPECIFIED",t.TUNING_JOB_STATE_WAITING_FOR_QUOTA="TUNING_JOB_STATE_WAITING_FOR_QUOTA",t.TUNING_JOB_STATE_PROCESSING_DATASET="TUNING_JOB_STATE_PROCESSING_DATASET",t.TUNING_JOB_STATE_WAITING_FOR_CAPACITY="TUNING_JOB_STATE_WAITING_FOR_CAPACITY",t.TUNING_JOB_STATE_TUNING="TUNING_JOB_STATE_TUNING",t.TUNING_JOB_STATE_POST_PROCESSING="TUNING_JOB_STATE_POST_PROCESSING"})(YP||(YP={}));var XP;(function(t){t.AGGREGATION_METRIC_UNSPECIFIED="AGGREGATION_METRIC_UNSPECIFIED",t.AVERAGE="AVERAGE",t.MODE="MODE",t.STANDARD_DEVIATION="STANDARD_DEVIATION",t.VARIANCE="VARIANCE",t.MINIMUM="MINIMUM",t.MAXIMUM="MAXIMUM",t.MEDIAN="MEDIAN",t.PERCENTILE_P90="PERCENTILE_P90",t.PERCENTILE_P95="PERCENTILE_P95",t.PERCENTILE_P99="PERCENTILE_P99"})(XP||(XP={}));var QP;(function(t){t.PAIRWISE_CHOICE_UNSPECIFIED="PAIRWISE_CHOICE_UNSPECIFIED",t.BASELINE="BASELINE",t.CANDIDATE="CANDIDATE",t.TIE="TIE"})(QP||(QP={}));var eN;(function(t){t.TUNING_SPEED_UNSPECIFIED="TUNING_SPEED_UNSPECIFIED",t.REGULAR="REGULAR",t.FAST="FAST"})(eN||(eN={}));var tN;(function(t){t.TUNING_TASK_UNSPECIFIED="TUNING_TASK_UNSPECIFIED",t.TUNING_TASK_I2V="TUNING_TASK_I2V",t.TUNING_TASK_T2V="TUNING_TASK_T2V",t.TUNING_TASK_R2V="TUNING_TASK_R2V"})(tN||(tN={}));var nN;(function(t){t.VIDEO_ORIENTATION_UNSPECIFIED="VIDEO_ORIENTATION_UNSPECIFIED",t.LANDSCAPE="LANDSCAPE",t.PORTRAIT="PORTRAIT"})(nN||(nN={}));var rN;(function(t){t.STATE_UNSPECIFIED="STATE_UNSPECIFIED",t.STATE_PENDING="STATE_PENDING",t.STATE_ACTIVE="STATE_ACTIVE",t.STATE_FAILED="STATE_FAILED"})(rN||(rN={}));var oN;(function(t){t.UNSPECIFIED="unspecified",t.FLEX="flex",t.STANDARD="standard",t.PRIORITY="priority"})(oN||(oN={}));var iN;(function(t){t.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",t.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",t.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",t.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH",t.MEDIA_RESOLUTION_ULTRA_HIGH="MEDIA_RESOLUTION_ULTRA_HIGH"})(iN||(iN={}));var sN;(function(t){t.TOOL_TYPE_UNSPECIFIED="TOOL_TYPE_UNSPECIFIED",t.GOOGLE_SEARCH_WEB="GOOGLE_SEARCH_WEB",t.GOOGLE_SEARCH_IMAGE="GOOGLE_SEARCH_IMAGE",t.URL_CONTEXT="URL_CONTEXT",t.GOOGLE_MAPS="GOOGLE_MAPS",t.FILE_SEARCH="FILE_SEARCH"})(sN||(sN={}));var lm;(function(t){t.COLLECTION="COLLECTION"})(lm||(lm={}));var aN;(function(t){t.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED="FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",t.PRIORITIZE_QUALITY="PRIORITIZE_QUALITY",t.BALANCED="BALANCED",t.PRIORITIZE_COST="PRIORITIZE_COST"})(aN||(aN={}));var kl;(function(t){t.PREDICT="PREDICT",t.EMBED_CONTENT="EMBED_CONTENT"})(kl||(kl={}));var uN;(function(t){t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",t.BLOCK_NONE="BLOCK_NONE"})(uN||(uN={}));var lN;(function(t){t.auto="auto",t.en="en",t.ja="ja",t.ko="ko",t.hi="hi",t.zh="zh",t.pt="pt",t.es="es"})(lN||(lN={}));var cN;(function(t){t.MASK_MODE_DEFAULT="MASK_MODE_DEFAULT",t.MASK_MODE_USER_PROVIDED="MASK_MODE_USER_PROVIDED",t.MASK_MODE_BACKGROUND="MASK_MODE_BACKGROUND",t.MASK_MODE_FOREGROUND="MASK_MODE_FOREGROUND",t.MASK_MODE_SEMANTIC="MASK_MODE_SEMANTIC"})(cN||(cN={}));var dN;(function(t){t.CONTROL_TYPE_DEFAULT="CONTROL_TYPE_DEFAULT",t.CONTROL_TYPE_CANNY="CONTROL_TYPE_CANNY",t.CONTROL_TYPE_SCRIBBLE="CONTROL_TYPE_SCRIBBLE",t.CONTROL_TYPE_FACE_MESH="CONTROL_TYPE_FACE_MESH"})(dN||(dN={}));var fN;(function(t){t.SUBJECT_TYPE_DEFAULT="SUBJECT_TYPE_DEFAULT",t.SUBJECT_TYPE_PERSON="SUBJECT_TYPE_PERSON",t.SUBJECT_TYPE_ANIMAL="SUBJECT_TYPE_ANIMAL",t.SUBJECT_TYPE_PRODUCT="SUBJECT_TYPE_PRODUCT"})(fN||(fN={}));var pN;(function(t){t.EDIT_MODE_DEFAULT="EDIT_MODE_DEFAULT",t.EDIT_MODE_INPAINT_REMOVAL="EDIT_MODE_INPAINT_REMOVAL",t.EDIT_MODE_INPAINT_INSERTION="EDIT_MODE_INPAINT_INSERTION",t.EDIT_MODE_OUTPAINT="EDIT_MODE_OUTPAINT",t.EDIT_MODE_CONTROLLED_EDITING="EDIT_MODE_CONTROLLED_EDITING",t.EDIT_MODE_STYLE="EDIT_MODE_STYLE",t.EDIT_MODE_BGSWAP="EDIT_MODE_BGSWAP",t.EDIT_MODE_PRODUCT_IMAGE="EDIT_MODE_PRODUCT_IMAGE"})(pN||(pN={}));var mN;(function(t){t.FOREGROUND="FOREGROUND",t.BACKGROUND="BACKGROUND",t.PROMPT="PROMPT",t.SEMANTIC="SEMANTIC",t.INTERACTIVE="INTERACTIVE"})(mN||(mN={}));var gN;(function(t){t.ASSET="ASSET",t.STYLE="STYLE"})(gN||(gN={}));var hN;(function(t){t.INSERT="INSERT",t.REMOVE="REMOVE",t.REMOVE_STATIC="REMOVE_STATIC",t.OUTPAINT="OUTPAINT"})(hN||(hN={}));var vN;(function(t){t.OPTIMIZED="OPTIMIZED",t.LOSSLESS="LOSSLESS"})(vN||(vN={}));var yN;(function(t){t.CROP="CROP",t.PAD="PAD"})(yN||(yN={}));var _N;(function(t){t.RESPONSE_PARSE_TYPE_UNSPECIFIED="RESPONSE_PARSE_TYPE_UNSPECIFIED",t.IDENTITY="IDENTITY",t.REGEX_EXTRACT="REGEX_EXTRACT"})(_N||(_N={}));var xN;(function(t){t.MATCH_OPERATION_UNSPECIFIED="MATCH_OPERATION_UNSPECIFIED",t.REGEX_CONTAINS="REGEX_CONTAINS",t.PARTIAL_MATCH="PARTIAL_MATCH",t.EXACT_MATCH="EXACT_MATCH"})(xN||(xN={}));var EN;(function(t){t.REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED="REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED",t.MINIMAL="MINIMAL",t.HIGH="HIGH"})(EN||(EN={}));var SN;(function(t){t.SUPERVISED_FINE_TUNING="SUPERVISED_FINE_TUNING",t.PREFERENCE_TUNING="PREFERENCE_TUNING",t.DISTILLATION="DISTILLATION",t.REINFORCEMENT_TUNING="REINFORCEMENT_TUNING"})(SN||(SN={}));var TN;(function(t){t.STATE_UNSPECIFIED="STATE_UNSPECIFIED",t.PROCESSING="PROCESSING",t.ACTIVE="ACTIVE",t.FAILED="FAILED"})(TN||(TN={}));var CN;(function(t){t.SOURCE_UNSPECIFIED="SOURCE_UNSPECIFIED",t.UPLOADED="UPLOADED",t.GENERATED="GENERATED",t.REGISTERED="REGISTERED"})(CN||(CN={}));var IN;(function(t){t.TURN_COMPLETE_REASON_UNSPECIFIED="TURN_COMPLETE_REASON_UNSPECIFIED",t.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",t.RESPONSE_REJECTED="RESPONSE_REJECTED",t.NEED_MORE_INPUT="NEED_MORE_INPUT",t.PROHIBITED_INPUT_CONTENT="PROHIBITED_INPUT_CONTENT",t.IMAGE_PROHIBITED_INPUT_CONTENT="IMAGE_PROHIBITED_INPUT_CONTENT",t.INPUT_TEXT_CONTAIN_PROMINENT_PERSON_PROHIBITED="INPUT_TEXT_CONTAIN_PROMINENT_PERSON_PROHIBITED",t.INPUT_IMAGE_CELEBRITY="INPUT_IMAGE_CELEBRITY",t.INPUT_IMAGE_PHOTO_REALISTIC_CHILD_PROHIBITED="INPUT_IMAGE_PHOTO_REALISTIC_CHILD_PROHIBITED",t.INPUT_TEXT_NCII_PROHIBITED="INPUT_TEXT_NCII_PROHIBITED",t.INPUT_OTHER="INPUT_OTHER",t.INPUT_IP_PROHIBITED="INPUT_IP_PROHIBITED",t.BLOCKLIST="BLOCKLIST",t.UNSAFE_PROMPT_FOR_IMAGE_GENERATION="UNSAFE_PROMPT_FOR_IMAGE_GENERATION",t.GENERATED_IMAGE_SAFETY="GENERATED_IMAGE_SAFETY",t.GENERATED_CONTENT_SAFETY="GENERATED_CONTENT_SAFETY",t.GENERATED_AUDIO_SAFETY="GENERATED_AUDIO_SAFETY",t.GENERATED_VIDEO_SAFETY="GENERATED_VIDEO_SAFETY",t.GENERATED_CONTENT_PROHIBITED="GENERATED_CONTENT_PROHIBITED",t.GENERATED_CONTENT_BLOCKLIST="GENERATED_CONTENT_BLOCKLIST",t.GENERATED_IMAGE_PROHIBITED="GENERATED_IMAGE_PROHIBITED",t.GENERATED_IMAGE_CELEBRITY="GENERATED_IMAGE_CELEBRITY",t.GENERATED_IMAGE_PROMINENT_PEOPLE_DETECTED_BY_REWRITER="GENERATED_IMAGE_PROMINENT_PEOPLE_DETECTED_BY_REWRITER",t.GENERATED_IMAGE_IDENTIFIABLE_PEOPLE="GENERATED_IMAGE_IDENTIFIABLE_PEOPLE",t.GENERATED_IMAGE_MINORS="GENERATED_IMAGE_MINORS",t.OUTPUT_IMAGE_IP_PROHIBITED="OUTPUT_IMAGE_IP_PROHIBITED",t.GENERATED_OTHER="GENERATED_OTHER",t.MAX_REGENERATION_REACHED="MAX_REGENERATION_REACHED"})(IN||(IN={}));var AN;(function(t){t.VAD_SIGNAL_TYPE_UNSPECIFIED="VAD_SIGNAL_TYPE_UNSPECIFIED",t.VAD_SIGNAL_TYPE_SOS="VAD_SIGNAL_TYPE_SOS",t.VAD_SIGNAL_TYPE_EOS="VAD_SIGNAL_TYPE_EOS"})(AN||(AN={}));var wN;(function(t){t.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",t.ACTIVITY_START="ACTIVITY_START",t.ACTIVITY_END="ACTIVITY_END"})(wN||(wN={}));var bN;(function(t){t.START_SENSITIVITY_UNSPECIFIED="START_SENSITIVITY_UNSPECIFIED",t.START_SENSITIVITY_HIGH="START_SENSITIVITY_HIGH",t.START_SENSITIVITY_LOW="START_SENSITIVITY_LOW"})(bN||(bN={}));var RN;(function(t){t.END_SENSITIVITY_UNSPECIFIED="END_SENSITIVITY_UNSPECIFIED",t.END_SENSITIVITY_HIGH="END_SENSITIVITY_HIGH",t.END_SENSITIVITY_LOW="END_SENSITIVITY_LOW"})(RN||(RN={}));var kN;(function(t){t.ACTIVITY_HANDLING_UNSPECIFIED="ACTIVITY_HANDLING_UNSPECIFIED",t.START_OF_ACTIVITY_INTERRUPTS="START_OF_ACTIVITY_INTERRUPTS",t.NO_INTERRUPTION="NO_INTERRUPTION"})(kN||(kN={}));var PN;(function(t){t.TURN_COVERAGE_UNSPECIFIED="TURN_COVERAGE_UNSPECIFIED",t.TURN_INCLUDES_ONLY_ACTIVITY="TURN_INCLUDES_ONLY_ACTIVITY",t.TURN_INCLUDES_ALL_INPUT="TURN_INCLUDES_ALL_INPUT",t.TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO="TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO"})(PN||(PN={}));var NN;(function(t){t.SCALE_UNSPECIFIED="SCALE_UNSPECIFIED",t.C_MAJOR_A_MINOR="C_MAJOR_A_MINOR",t.D_FLAT_MAJOR_B_FLAT_MINOR="D_FLAT_MAJOR_B_FLAT_MINOR",t.D_MAJOR_B_MINOR="D_MAJOR_B_MINOR",t.E_FLAT_MAJOR_C_MINOR="E_FLAT_MAJOR_C_MINOR",t.E_MAJOR_D_FLAT_MINOR="E_MAJOR_D_FLAT_MINOR",t.F_MAJOR_D_MINOR="F_MAJOR_D_MINOR",t.G_FLAT_MAJOR_E_FLAT_MINOR="G_FLAT_MAJOR_E_FLAT_MINOR",t.G_MAJOR_E_MINOR="G_MAJOR_E_MINOR",t.A_FLAT_MAJOR_F_MINOR="A_FLAT_MAJOR_F_MINOR",t.A_MAJOR_G_FLAT_MINOR="A_MAJOR_G_FLAT_MINOR",t.B_FLAT_MAJOR_G_MINOR="B_FLAT_MAJOR_G_MINOR",t.B_MAJOR_A_FLAT_MINOR="B_MAJOR_A_FLAT_MINOR"})(NN||(NN={}));var $N;(function(t){t.MUSIC_GENERATION_MODE_UNSPECIFIED="MUSIC_GENERATION_MODE_UNSPECIFIED",t.QUALITY="QUALITY",t.DIVERSITY="DIVERSITY",t.VOCALIZATION="VOCALIZATION"})($N||($N={}));var Yo;(function(t){t.PLAYBACK_CONTROL_UNSPECIFIED="PLAYBACK_CONTROL_UNSPECIFIED",t.PLAY="PLAY",t.PAUSE="PAUSE",t.STOP="STOP",t.RESET_CONTEXT="RESET_CONTEXT"})(Yo||(Yo={}));function oi(t){return{text:t}}a(oi,"createPartFromText");function DN(t){return typeof t=="object"&&t!==null?"fileData"in t||"text"in t||"functionCall"in t||"functionResponse"in t||"inlineData"in t||"videoMetadata"in t||"codeExecutionResult"in t||"executableCode"in t:!1}a(DN,"_isPart");function h$(t){let e=[];if(typeof t=="string")e.push(oi(t));else if(DN(t))e.push(t);else if(Array.isArray(t)){if(t.length===0)throw new Error("partOrString cannot be an empty array");for(let n of t)if(typeof n=="string")e.push(oi(n));else if(DN(n))e.push(n);else throw new Error("element in PartUnion must be a Part object or string")}else throw new Error("partOrString must be a Part object, string, or array");return e}a(h$,"_toParts");function uc(t){return{role:"user",parts:h$(t)}}a(uc,"createUserContent");function Dg(t){return{role:"model",parts:h$(t)}}a(Dg,"createModelContent");var Gg=class Gg{constructor(e){let n={};for(let o of e.headers.entries())n[o[0]]=o[1];this.headers=n,this.responseInternal=e}json(){return this.responseInternal.json()}};a(Gg,"HttpResponse");var ii=Gg;var Bg=class Bg{get text(){var e,n,o,r,i,s,u,c;if(((r=(o=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||o===void 0?void 0:o.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning text from the first one.");let l="",p=!1,d=[];for(let g of(c=(u=(s=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.content)===null||u===void 0?void 0:u.parts)!==null&&c!==void 0?c:[]){for(let[h,v]of Object.entries(g))h!=="text"&&h!=="thought"&&h!=="thoughtSignature"&&(v!==null||v!==void 0)&&d.push(h);if(typeof g.text=="string"){if(typeof g.thought=="boolean"&&g.thought)continue;p=!0,l+=g.text}}return d.length>0&&console.warn(`there are non-text parts ${d} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),p?l:void 0}get data(){var e,n,o,r,i,s,u,c;if(((r=(o=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||o===void 0?void 0:o.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning data from the first one.");let l="",p=[];for(let d of(c=(u=(s=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.content)===null||u===void 0?void 0:u.parts)!==null&&c!==void 0?c:[]){for(let[g,h]of Object.entries(d))g!=="inlineData"&&(h!==null||h!==void 0)&&p.push(g);d.inlineData&&typeof d.inlineData.data=="string"&&(l+=atob(d.inlineData.data))}return p.length>0&&console.warn(`there are non-data parts ${p} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),l.length>0?btoa(l):void 0}get functionCalls(){var e,n,o,r,i,s,u,c;if(((r=(o=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||o===void 0?void 0:o.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning function calls from the first one.");let l=(c=(u=(s=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.content)===null||u===void 0?void 0:u.parts)===null||c===void 0?void 0:c.filter(p=>p.functionCall).map(p=>p.functionCall).filter(p=>p!==void 0);if((l==null?void 0:l.length)!==0)return l}get executableCode(){var e,n,o,r,i,s,u,c,l;if(((r=(o=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||o===void 0?void 0:o.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning executable code from the first one.");let p=(c=(u=(s=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.content)===null||u===void 0?void 0:u.parts)===null||c===void 0?void 0:c.filter(d=>d.executableCode).map(d=>d.executableCode).filter(d=>d!==void 0);if((p==null?void 0:p.length)!==0)return(l=p==null?void 0:p[0])===null||l===void 0?void 0:l.code}get codeExecutionResult(){var e,n,o,r,i,s,u,c,l;if(((r=(o=(n=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||n===void 0?void 0:n.content)===null||o===void 0?void 0:o.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning code execution result from the first one.");let p=(c=(u=(s=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.content)===null||u===void 0?void 0:u.parts)===null||c===void 0?void 0:c.filter(d=>d.codeExecutionResult).map(d=>d.codeExecutionResult).filter(d=>d!==void 0);if((p==null?void 0:p.length)!==0)return(l=p==null?void 0:p[0])===null||l===void 0?void 0:l.output}};a(Bg,"GenerateContentResponse");var Gr=Bg,qg=class qg{};a(qg,"EmbedContentResponse");var Pl=qg,Vg=class Vg{};a(Vg,"GenerateImagesResponse");var Nl=Vg,Zg=class Zg{};a(Zg,"EditImageResponse");var cm=Zg,Hg=class Hg{};a(Hg,"UpscaleImageResponse");var dm=Hg,Jg=class Jg{};a(Jg,"RecontextImageResponse");var fm=Jg,Kg=class Kg{};a(Kg,"SegmentImageResponse");var pm=Kg,Wg=class Wg{};a(Wg,"ListModelsResponse");var $l=Wg,jg=class jg{};a(jg,"DeleteModelResponse");var Dl=jg,Yg=class Yg{};a(Yg,"CountTokensResponse");var Ol=Yg,Xg=class Xg{};a(Xg,"ComputeTokensResponse");var mm=Xg;var Xl=class Xl{_fromAPIResponse({apiResponse:e,_isVertexAI:n}){let o=new Xl,r,i=e;return n?r=m4(i):r=p4(i),Object.assign(o,r),o}};a(Xl,"GenerateVideosOperation");var Ll=Xl;var Qg=class Qg{};a(Qg,"ListTuningJobsResponse");var gm=Qg,eh=class eh{};a(eh,"CancelTuningJobResponse");var Ml=eh,th=class th{};a(th,"ValidateRewardResponse");var hm=th,nh=class nh{};a(nh,"DeleteCachedContentResponse");var Ul=nh,rh=class rh{};a(rh,"ListCachedContentsResponse");var Fl=rh,oh=class oh{};a(oh,"ListDocumentsResponse");var vm=oh,ih=class ih{};a(ih,"ListFileSearchStoresResponse");var ym=ih,sh=class sh{};a(sh,"UploadToFileSearchStoreResumableResponse");var _m=sh;var Ql=class Ql{_fromAPIResponse({apiResponse:e,_isVertexAI:n}){let o=new Ql,i=E4(e);return Object.assign(o,i),o}};a(Ql,"ImportFileOperation");var xm=Ql,ah=class ah{};a(ah,"ListFilesResponse");var Em=ah,uh=class uh{};a(uh,"CreateFileResponse");var Sm=uh,lh=class lh{};a(lh,"DeleteFileResponse");var Tm=lh,ch=class ch{};a(ch,"RegisterFilesResponse");var Cm=ch;var dh=class dh{};a(dh,"ListBatchJobsResponse");var zl=dh;var fh=class fh{get text(){var e,n,o;let r="",i=!1,s=[];for(let u of(o=(n=(e=this.serverContent)===null||e===void 0?void 0:e.modelTurn)===null||n===void 0?void 0:n.parts)!==null&&o!==void 0?o:[]){for(let[c,l]of Object.entries(u))c!=="text"&&c!=="thought"&&l!==null&&s.push(c);if(typeof u.text=="string"){if(typeof u.thought=="boolean"&&u.thought)continue;i=!0,r+=u.text}}return s.length>0&&console.warn(`there are non-text parts ${s} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),i?r:void 0}get data(){var e,n,o;let r="",i=[];for(let s of(o=(n=(e=this.serverContent)===null||e===void 0?void 0:e.modelTurn)===null||n===void 0?void 0:n.parts)!==null&&o!==void 0?o:[]){for(let[u,c]of Object.entries(s))u!=="inlineData"&&c!==null&&i.push(u);s.inlineData&&typeof s.inlineData.data=="string"&&(r+=atob(s.inlineData.data))}return i.length>0&&console.warn(`there are non-data parts ${i} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),r.length>0?btoa(r):void 0}};a(fh,"LiveServerMessage");var Im=fh;var ph=class ph{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}};a(ph,"LiveMusicServerMessage");var Am=ph;var ec=class ec{_fromAPIResponse({apiResponse:e,_isVertexAI:n}){let o=new ec,i=g$(e);return Object.assign(o,i),o}};a(ec,"UploadToFileSearchStoreOperation");var wm=ec;function ue(t,e){if(!e||typeof e!="string")throw new Error("model is required and must be a string");if(e.includes("..")||e.includes("?")||e.includes("&"))throw new Error("invalid model parameter");if(t.isVertexAI()){if(e.startsWith("publishers/")||e.startsWith("projects/")||e.startsWith("models/"))return e;if(e.indexOf("/")>=0){let n=e.split("/",2);return`publishers/${n[0]}/models/${n[1]}`}else return`publishers/google/models/${e}`}else return e.startsWith("models/")||e.startsWith("tunedModels/")?e:`models/${e}`}a(ue,"tModel");function v$(t,e){let n=ue(t,e);return n?n.startsWith("publishers/")&&t.isVertexAI()?`projects/${t.getProject()}/locations/${t.getLocation()}/${n}`:n.startsWith("models/")&&t.isVertexAI()?`projects/${t.getProject()}/locations/${t.getLocation()}/publishers/google/${n}`:n:""}a(v$,"tCachesModel");function y$(t){return Array.isArray(t)?t.map(e=>Gl(e)):[Gl(t)]}a(y$,"tBlobs");function Gl(t){if(typeof t=="object"&&t!==null)return t;throw new Error(`Could not parse input as Blob. Unsupported blob type: ${typeof t}`)}a(Gl,"tBlob");function _$(t){let e=Gl(t);if(e.mimeType&&e.mimeType.startsWith("image/"))return e;throw new Error(`Unsupported mime type: ${e.mimeType}`)}a(_$,"tImageBlob");function x$(t){let e=Gl(t);if(e.mimeType&&e.mimeType.startsWith("audio/"))return e;throw new Error(`Unsupported mime type: ${e.mimeType}`)}a(x$,"tAudioBlob");function ON(t){if(t==null)throw new Error("PartUnion is required");if(typeof t=="object")return t;if(typeof t=="string")return{text:t};throw new Error(`Unsupported part type: ${typeof t}`)}a(ON,"tPart");function E$(t){if(t==null||Array.isArray(t)&&t.length===0)throw new Error("PartListUnion is required");return Array.isArray(t)?t.map(e=>ON(e)):[ON(t)]}a(E$,"tParts");function bm(t){return t!=null&&typeof t=="object"&&"parts"in t&&Array.isArray(t.parts)}a(bm,"_isContent");function LN(t){return t!=null&&typeof t=="object"&&"functionCall"in t}a(LN,"_isFunctionCallPart");function MN(t){return t!=null&&typeof t=="object"&&"functionResponse"in t}a(MN,"_isFunctionResponsePart");function Ge(t){if(t==null)throw new Error("ContentUnion is required");return bm(t)?t:{role:"user",parts:E$(t)}}a(Ge,"tContent");function Og(t,e){if(!e)return[];if(t.isVertexAI()&&Array.isArray(e))return e.flatMap(n=>{let o=Ge(n);return o.parts&&o.parts.length>0&&o.parts[0].text!==void 0?[o.parts[0].text]:[]});if(t.isVertexAI()){let n=Ge(e);return n.parts&&n.parts.length>0&&n.parts[0].text!==void 0?[n.parts[0].text]:[]}return Array.isArray(e)?e.map(n=>Ge(n)):[Ge(e)]}a(Og,"tContentsForEmbed");function yt(t){if(t==null||Array.isArray(t)&&t.length===0)throw new Error("contents are required");if(!Array.isArray(t)){if(LN(t)||MN(t))throw new Error("To specify functionCall or functionResponse parts, please wrap them in a Content object, specifying the role for them");return[Ge(t)]}let e=[],n=[],o=bm(t[0]);for(let r of t){let i=bm(r);if(i!=o)throw new Error("Mixing Content and Parts is not supported, please group the parts into a the appropriate Content objects and specify the roles for them");if(i)e.push(r);else{if(LN(r)||MN(r))throw new Error("To specify functionCall or functionResponse parts, please wrap them, and any other parts, in Content objects as appropriate, specifying the role for them");n.push(r)}}return o||e.push({role:"user",parts:E$(n)}),e}a(yt,"tContents");function A4(t,e){t.includes("null")&&(e.nullable=!0);let n=t.filter(o=>o!=="null");if(n.length===1)e.type=Object.values(j).includes(n[0].toUpperCase())?n[0].toUpperCase():j.TYPE_UNSPECIFIED;else{e.anyOf=[];for(let o of n)e.anyOf.push({type:Object.values(j).includes(o.toUpperCase())?o.toUpperCase():j.TYPE_UNSPECIFIED})}}a(A4,"flattenTypeArrayToAnyOf");function ei(t){let e={},n=["items"],o=["anyOf"],r=["properties"];if(t.type&&t.anyOf)throw new Error("type and anyOf cannot be both populated.");let i=t.anyOf;i!=null&&i.length==2&&(i[0].type==="null"?(e.nullable=!0,t=i[1]):i[1].type==="null"&&(e.nullable=!0,t=i[0])),t.type instanceof Array&&A4(t.type,e);for(let[s,u]of Object.entries(t))if(u!=null)if(s=="type"){if(u==="null")throw new Error("type: null can not be the only possible type for the field.");if(u instanceof Array)continue;e.type=Object.values(j).includes(u.toUpperCase())?u.toUpperCase():j.TYPE_UNSPECIFIED}else if(n.includes(s))e[s]=ei(u);else if(o.includes(s)){let c=[];for(let l of u){if(l.type=="null"){e.nullable=!0;continue}c.push(ei(l))}e[s]=c}else if(r.includes(s)){let c={};for(let[l,p]of Object.entries(u))c[l]=ei(p);e[s]=c}else{if(s==="additionalProperties")continue;e[s]=u}return e}a(ei,"processJsonSchema");function Lg(t){return ei(t)}a(Lg,"tSchema");function Mg(t){if(typeof t=="object")return t;if(typeof t=="string")return{voiceConfig:{prebuiltVoiceConfig:{voiceName:t}}};throw new Error(`Unsupported speechConfig type: ${typeof t}`)}a(Mg,"tSpeechConfig");function Ug(t){if("multiSpeakerVoiceConfig"in t)throw new Error("multiSpeakerVoiceConfig is not supported in the live API.");return t}a(Ug,"tLiveSpeechConfig");function li(t){if(t.functionDeclarations)for(let e of t.functionDeclarations)e.parameters&&(Object.keys(e.parameters).includes("$schema")?e.parametersJsonSchema||(e.parametersJsonSchema=e.parameters,delete e.parameters):e.parameters=ei(e.parameters)),e.response&&(Object.keys(e.response).includes("$schema")?e.responseJsonSchema||(e.responseJsonSchema=e.response,delete e.response):e.response=ei(e.response));return t}a(li,"tTool");function ci(t){if(t==null)throw new Error("tools is required");if(!Array.isArray(t))throw new Error("tools is required and must be an array of Tools");let e=[];for(let n of t)e.push(n);return e}a(ci,"tTools");function w4(t,e,n,o=1){let r=!e.startsWith(`${n}/`)&&e.split("/").length===o;return t.isVertexAI()?e.startsWith("projects/")?e:e.startsWith("locations/")?`projects/${t.getProject()}/${e}`:e.startsWith(`${n}/`)?`projects/${t.getProject()}/locations/${t.getLocation()}/${e}`:r?`projects/${t.getProject()}/locations/${t.getLocation()}/${n}/${e}`:e:r?`${n}/${e}`:e}a(w4,"resourceName");function Gn(t,e){if(typeof e!="string")throw new Error("name must be a string");return w4(t,e,"cachedContents")}a(Gn,"tCachedContentName");function S$(t){switch(t){case"STATE_UNSPECIFIED":return"JOB_STATE_UNSPECIFIED";case"CREATING":return"JOB_STATE_RUNNING";case"ACTIVE":return"JOB_STATE_SUCCEEDED";case"FAILED":return"JOB_STATE_FAILED";default:return t}}a(S$,"tTuningJobStatus");function pr(t){return $g(t)}a(pr,"tBytes");function b4(t){return t!=null&&typeof t=="object"&&"name"in t}a(b4,"_isFile");function R4(t){return t!=null&&typeof t=="object"&&"video"in t}a(R4,"isGeneratedVideo");function k4(t){return t!=null&&typeof t=="object"&&"uri"in t}a(k4,"isVideo");function T$(t){var e;let n;if(b4(t)&&(n=t.name),!(k4(t)&&(n=t.uri,n===void 0))&&!(R4(t)&&(n=(e=t.video)===null||e===void 0?void 0:e.uri,n===void 0))){if(typeof t=="string"&&(n=t),n===void 0)throw new Error("Could not extract file name from the provided input.");if(n.startsWith("https://")){let r=n.split("files/")[1].match(/[a-z0-9]+/);if(r===null)throw new Error(`Could not extract file name from URI ${n}`);n=r[0]}else n.startsWith("files/")&&(n=n.split("files/")[1]);return n}}a(T$,"tFileName");function C$(t,e){let n;return t.isVertexAI()?n=e?"publishers/google/models":"models":n=e?"models":"tunedModels",n}a(C$,"tModelsUrl");function I$(t){for(let e of["models","tunedModels","publisherModels"])if(P4(t,e))return t[e];return[]}a(I$,"tExtractModels");function P4(t,e){return t!==null&&typeof t=="object"&&e in t}a(P4,"hasField");function N4(t,e={}){let n=t,o={name:n.name,description:n.description,parametersJsonSchema:n.inputSchema};return n.outputSchema&&(o.responseJsonSchema=n.outputSchema),e.behavior&&(o.behavior=e.behavior),{functionDeclarations:[o]}}a(N4,"mcpToGeminiTool");function $4(t,e={}){let n=[],o=new Set;for(let r of t){let i=r.name;if(o.has(i))throw new Error(`Duplicate function name ${i} found in MCP tools. Please ensure function names are unique.`);o.add(i);let s=N4(r,e);s.functionDeclarations&&n.push(...s.functionDeclarations)}return{functionDeclarations:n}}a($4,"mcpToolsToGeminiTool");function A$(t,e){let n;if(typeof e=="string")if(t.isVertexAI())if(e.startsWith("gs://"))n={format:"jsonl",gcsUri:[e]};else if(e.startsWith("bq://"))n={format:"bigquery",bigqueryUri:e};else if(/^projects\/[^/]+\/locations\/[^/]+\/datasets\/[^/]+$/.test(e))n={format:"vertex-dataset",vertexDatasetName:e};else throw new Error(`Unsupported string source for Vertex AI: ${e}`);else if(e.startsWith("files/"))n={fileName:e};else throw new Error(`Unsupported string source for Gemini API: ${e}`);else if(Array.isArray(e)){if(t.isVertexAI())throw new Error("InlinedRequest[] is not supported in Vertex AI.");n={inlinedRequests:e}}else n=e;let o=[n.gcsUri,n.bigqueryUri,n.vertexDatasetName].filter(Boolean).length,r=[n.inlinedRequests,n.fileName].filter(Boolean).length;if(t.isVertexAI()){if(r>0||o!==1)throw new Error("Exactly one of `gcsUri`, `bigqueryUri`, or `vertexDatasetName` must be set for Vertex AI.")}else if(o>0||r!==1)throw new Error("Exactly one of `inlinedRequests`, `fileName`, must be set for Gemini API.");return n}a(A$,"tBatchJobSource");function D4(t){if(typeof t!="string")return t;let e=t;if(e.startsWith("gs://"))return{format:"jsonl",gcsUri:e};if(e.startsWith("bq://"))return{format:"bigquery",bigqueryUri:e};throw new Error(`Unsupported destination: ${e}`)}a(D4,"tBatchJobDestination");function w$(t){if(typeof t!="object"||t===null)return{};let e=t,n=e.inlinedResponses;if(typeof n!="object"||n===null)return t;let r=n.inlinedResponses;if(!Array.isArray(r)||r.length===0)return t;let i=!1;for(let s of r){if(typeof s!="object"||s===null)continue;let c=s.response;if(typeof c!="object"||c===null)continue;if(c.embedding!==void 0){i=!0;break}}return i&&(e.inlinedEmbedContentResponses=e.inlinedResponses,delete e.inlinedResponses),t}a(w$,"tRecvBatchJobDestination");function di(t,e){let n=e;if(!t.isVertexAI()){if(/batches\/[^/]+$/.test(n))return n.split("/").pop();throw new Error(`Invalid batch job name: ${n}.`)}if(/^projects\/[^/]+\/locations\/[^/]+\/batchPredictionJobs\/[^/]+$/.test(n))return n.split("/").pop();if(/^\d+$/.test(n))return n;throw new Error(`Invalid batch job name: ${n}.`)}a(di,"tBatchJobName");function b$(t){let e=t;return e==="BATCH_STATE_UNSPECIFIED"?"JOB_STATE_UNSPECIFIED":e==="BATCH_STATE_PENDING"?"JOB_STATE_PENDING":e==="BATCH_STATE_RUNNING"?"JOB_STATE_RUNNING":e==="BATCH_STATE_SUCCEEDED"?"JOB_STATE_SUCCEEDED":e==="BATCH_STATE_FAILED"?"JOB_STATE_FAILED":e==="BATCH_STATE_CANCELLED"?"JOB_STATE_CANCELLED":e==="BATCH_STATE_EXPIRED"?"JOB_STATE_EXPIRED":e}a(b$,"tJobState");function O4(t){return t.includes("gemini")&&t!=="gemini-embedding-001"||t.includes("maas")}a(O4,"tIsVertexEmbedContentModel");function L4(t){let e={},n=f(t,["apiKey"]);if(n!=null&&m(e,["apiKey"],n),f(t,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["authType"])!==void 0)throw new Error("authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}a(L4,"authConfigToMldev$4");function M4(t){let e={},n=f(t,["responsesFile"]);n!=null&&m(e,["fileName"],n);let o=f(t,["inlinedResponses","inlinedResponses"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>v1(s))),m(e,["inlinedResponses"],i)}let r=f(t,["inlinedEmbedContentResponses","inlinedResponses"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),m(e,["inlinedEmbedContentResponses"],i)}return e}a(M4,"batchJobDestinationFromMldev");function U4(t){let e={},n=f(t,["predictionsFormat"]);n!=null&&m(e,["format"],n);let o=f(t,["gcsDestination","outputUriPrefix"]);o!=null&&m(e,["gcsUri"],o);let r=f(t,["bigqueryDestination","outputUri"]);r!=null&&m(e,["bigqueryUri"],r);let i=f(t,["vertexMultimodalDatasetDestination"]);return i!=null&&m(e,["vertexDataset"],b1(i)),e}a(U4,"batchJobDestinationFromVertex");function F4(t){let e={},n=f(t,["format"]);n!=null&&m(e,["predictionsFormat"],n);let o=f(t,["gcsUri"]);o!=null&&m(e,["gcsDestination","outputUriPrefix"],o);let r=f(t,["bigqueryUri"]);if(r!=null&&m(e,["bigqueryDestination","outputUri"],r),f(t,["fileName"])!==void 0)throw new Error("fileName parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(f(t,["inlinedResponses"])!==void 0)throw new Error("inlinedResponses parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(f(t,["inlinedEmbedContentResponses"])!==void 0)throw new Error("inlinedEmbedContentResponses parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");let i=f(t,["vertexDataset"]);return i!=null&&m(e,["vertexMultimodalDatasetDestination"],R1(i)),e}a(F4,"batchJobDestinationToVertex");function wl(t){let e={},n=f(t,["name"]);n!=null&&m(e,["name"],n);let o=f(t,["metadata","displayName"]);o!=null&&m(e,["displayName"],o);let r=f(t,["metadata","state"]);r!=null&&m(e,["state"],b$(r));let i=f(t,["metadata","createTime"]);i!=null&&m(e,["createTime"],i);let s=f(t,["metadata","endTime"]);s!=null&&m(e,["endTime"],s);let u=f(t,["metadata","updateTime"]);u!=null&&m(e,["updateTime"],u);let c=f(t,["metadata","model"]);c!=null&&m(e,["model"],c);let l=f(t,["metadata","output"]);return l!=null&&m(e,["dest"],M4(w$(l))),e}a(wl,"batchJobFromMldev");function Rm(t){let e={},n=f(t,["name"]);n!=null&&m(e,["name"],n);let o=f(t,["displayName"]);o!=null&&m(e,["displayName"],o);let r=f(t,["state"]);r!=null&&m(e,["state"],b$(r));let i=f(t,["error"]);i!=null&&m(e,["error"],i);let s=f(t,["createTime"]);s!=null&&m(e,["createTime"],s);let u=f(t,["startTime"]);u!=null&&m(e,["startTime"],u);let c=f(t,["endTime"]);c!=null&&m(e,["endTime"],c);let l=f(t,["updateTime"]);l!=null&&m(e,["updateTime"],l);let p=f(t,["model"]);p!=null&&m(e,["model"],p);let d=f(t,["inputConfig"]);d!=null&&m(e,["src"],z4(d));let g=f(t,["outputConfig"]);g!=null&&m(e,["dest"],U4(w$(g)));let h=f(t,["completionStats"]);h!=null&&m(e,["completionStats"],h);let v=f(t,["outputInfo"]);return v!=null&&m(e,["outputInfo"],v),e}a(Rm,"batchJobFromVertex");function z4(t){let e={},n=f(t,["instancesFormat"]);n!=null&&m(e,["format"],n);let o=f(t,["gcsSource","uris"]);o!=null&&m(e,["gcsUri"],o);let r=f(t,["bigquerySource","inputUri"]);r!=null&&m(e,["bigqueryUri"],r);let i=f(t,["vertexMultimodalDatasetSource","datasetName"]);return i!=null&&m(e,["vertexDatasetName"],i),e}a(z4,"batchJobSourceFromVertex");function G4(t,e){let n={};if(f(e,["format"])!==void 0)throw new Error("format parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(e,["bigqueryUri"])!==void 0)throw new Error("bigqueryUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=f(e,["fileName"]);o!=null&&m(n,["fileName"],o);let r=f(e,["inlinedRequests"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>h1(t,s))),m(n,["requests","requests"],i)}if(f(e,["vertexDatasetName"])!==void 0)throw new Error("vertexDatasetName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return n}a(G4,"batchJobSourceToMldev");function B4(t){let e={},n=f(t,["format"]);n!=null&&m(e,["instancesFormat"],n);let o=f(t,["gcsUri"]);o!=null&&m(e,["gcsSource","uris"],o);let r=f(t,["bigqueryUri"]);if(r!=null&&m(e,["bigquerySource","inputUri"],r),f(t,["fileName"])!==void 0)throw new Error("fileName parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(f(t,["inlinedRequests"])!==void 0)throw new Error("inlinedRequests parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");let i=f(t,["vertexDatasetName"]);return i!=null&&m(e,["vertexMultimodalDatasetSource","datasetName"],i),e}a(B4,"batchJobSourceToVertex");function q4(t){let e={},n=f(t,["data"]);if(n!=null&&m(e,["data"],n),f(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=f(t,["mimeType"]);return o!=null&&m(e,["mimeType"],o),e}a(q4,"blobToMldev$4");function V4(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],di(t,o)),n}a(V4,"cancelBatchJobParametersToMldev");function Z4(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],di(t,o)),n}a(Z4,"cancelBatchJobParametersToVertex");function H4(t){let e={},n=f(t,["content"]);n!=null&&m(e,["content"],n);let o=f(t,["citationMetadata"]);o!=null&&m(e,["citationMetadata"],J4(o));let r=f(t,["tokenCount"]);r!=null&&m(e,["tokenCount"],r);let i=f(t,["finishReason"]);i!=null&&m(e,["finishReason"],i);let s=f(t,["groundingMetadata"]);s!=null&&m(e,["groundingMetadata"],s);let u=f(t,["avgLogprobs"]);u!=null&&m(e,["avgLogprobs"],u);let c=f(t,["index"]);c!=null&&m(e,["index"],c);let l=f(t,["logprobsResult"]);l!=null&&m(e,["logprobsResult"],l);let p=f(t,["safetyRatings"]);if(p!=null){let g=p;Array.isArray(g)&&(g=g.map(h=>h)),m(e,["safetyRatings"],g)}let d=f(t,["urlContextMetadata"]);return d!=null&&m(e,["urlContextMetadata"],d),e}a(H4,"candidateFromMldev$1");function J4(t){let e={},n=f(t,["citationSources"]);if(n!=null){let o=n;Array.isArray(o)&&(o=o.map(r=>r)),m(e,["citations"],o)}return e}a(J4,"citationMetadataFromMldev$1");function R$(t){let e={},n=f(t,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>C1(i))),m(e,["parts"],r)}let o=f(t,["role"]);return o!=null&&m(e,["role"],o),e}a(R$,"contentToMldev$4");function K4(t,e){let n={},o=f(t,["displayName"]);if(e!==void 0&&o!=null&&m(e,["batch","displayName"],o),f(t,["dest"])!==void 0)throw new Error("dest parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=f(t,["webhookConfig"]);return e!==void 0&&r!=null&&m(e,["batch","webhookConfig"],r),n}a(K4,"createBatchJobConfigToMldev");function W4(t,e){let n={},o=f(t,["displayName"]);e!==void 0&&o!=null&&m(e,["displayName"],o);let r=f(t,["dest"]);if(e!==void 0&&r!=null&&m(e,["outputConfig"],F4(D4(r))),f(t,["webhookConfig"])!==void 0)throw new Error("webhookConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return n}a(W4,"createBatchJobConfigToVertex");function UN(t,e){let n={},o=f(e,["model"]);o!=null&&m(n,["_url","model"],ue(t,o));let r=f(e,["src"]);r!=null&&m(n,["batch","inputConfig"],G4(t,A$(t,r)));let i=f(e,["config"]);return i!=null&&K4(i,n),n}a(UN,"createBatchJobParametersToMldev");function j4(t,e){let n={},o=f(e,["model"]);o!=null&&m(n,["model"],ue(t,o));let r=f(e,["src"]);r!=null&&m(n,["inputConfig"],B4(A$(t,r)));let i=f(e,["config"]);return i!=null&&W4(i,n),n}a(j4,"createBatchJobParametersToVertex");function Y4(t,e){let n={},o=f(t,["displayName"]);return e!==void 0&&o!=null&&m(e,["batch","displayName"],o),n}a(Y4,"createEmbeddingsBatchJobConfigToMldev");function X4(t,e){let n={},o=f(e,["model"]);o!=null&&m(n,["_url","model"],ue(t,o));let r=f(e,["src"]);r!=null&&m(n,["batch","inputConfig"],i1(t,r));let i=f(e,["config"]);return i!=null&&Y4(i,n),n}a(X4,"createEmbeddingsBatchJobParametersToMldev");function Q4(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],di(t,o)),n}a(Q4,"deleteBatchJobParametersToMldev");function e1(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],di(t,o)),n}a(e1,"deleteBatchJobParametersToVertex");function t1(t){let e={},n=f(t,["sdkHttpResponse"]);n!=null&&m(e,["sdkHttpResponse"],n);let o=f(t,["name"]);o!=null&&m(e,["name"],o);let r=f(t,["done"]);r!=null&&m(e,["done"],r);let i=f(t,["error"]);return i!=null&&m(e,["error"],i),e}a(t1,"deleteResourceJobFromMldev");function n1(t){let e={},n=f(t,["sdkHttpResponse"]);n!=null&&m(e,["sdkHttpResponse"],n);let o=f(t,["name"]);o!=null&&m(e,["name"],o);let r=f(t,["done"]);r!=null&&m(e,["done"],r);let i=f(t,["error"]);return i!=null&&m(e,["error"],i),e}a(n1,"deleteResourceJobFromVertex");function r1(t,e){let n={},o=f(e,["contents"]);if(o!=null){let i=Og(t,o);Array.isArray(i)&&(i=i.map(s=>s)),m(n,["requests[]","request","content"],i)}let r=f(e,["config"]);return r!=null&&(m(n,["_self"],o1(r,n)),d4(n,{"requests[].*":"requests[].request.*"})),n}a(r1,"embedContentBatchToMldev");function o1(t,e){let n={},o=f(t,["taskType"]);e!==void 0&&o!=null&&m(e,["requests[]","taskType"],o);let r=f(t,["title"]);e!==void 0&&r!=null&&m(e,["requests[]","title"],r);let i=f(t,["outputDimensionality"]);if(e!==void 0&&i!=null&&m(e,["requests[]","outputDimensionality"],i),f(t,["mimeType"])!==void 0)throw new Error("mimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["documentOcr"])!==void 0)throw new Error("documentOcr parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["audioTrackExtraction"])!==void 0)throw new Error("audioTrackExtraction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return n}a(o1,"embedContentConfigToMldev$1");function i1(t,e){let n={},o=f(e,["fileName"]);o!=null&&m(n,["file_name"],o);let r=f(e,["inlinedRequests"]);return r!=null&&m(n,["requests"],r1(t,r)),n}a(i1,"embeddingsBatchJobSourceToMldev");function s1(t){let e={};if(f(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=f(t,["fileUri"]);n!=null&&m(e,["fileUri"],n);let o=f(t,["mimeType"]);return o!=null&&m(e,["mimeType"],o),e}a(s1,"fileDataToMldev$4");function a1(t){let e={},n=f(t,["id"]);n!=null&&m(e,["id"],n);let o=f(t,["args"]);o!=null&&m(e,["args"],o);let r=f(t,["name"]);if(r!=null&&m(e,["name"],r),f(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}a(a1,"functionCallToMldev$4");function u1(t){let e={},n=f(t,["allowedFunctionNames"]);n!=null&&m(e,["allowedFunctionNames"],n);let o=f(t,["mode"]);if(o!=null&&m(e,["mode"],o),f(t,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}a(u1,"functionCallingConfigToMldev$2");function l1(t,e,n){let o={},r=f(e,["systemInstruction"]);n!==void 0&&r!=null&&m(n,["systemInstruction"],R$(Ge(r)));let i=f(e,["temperature"]);i!=null&&m(o,["temperature"],i);let s=f(e,["topP"]);s!=null&&m(o,["topP"],s);let u=f(e,["topK"]);u!=null&&m(o,["topK"],u);let c=f(e,["candidateCount"]);c!=null&&m(o,["candidateCount"],c);let l=f(e,["maxOutputTokens"]);l!=null&&m(o,["maxOutputTokens"],l);let p=f(e,["stopSequences"]);p!=null&&m(o,["stopSequences"],p);let d=f(e,["responseLogprobs"]);d!=null&&m(o,["responseLogprobs"],d);let g=f(e,["logprobs"]);g!=null&&m(o,["logprobs"],g);let h=f(e,["presencePenalty"]);h!=null&&m(o,["presencePenalty"],h);let v=f(e,["frequencyPenalty"]);v!=null&&m(o,["frequencyPenalty"],v);let y=f(e,["seed"]);y!=null&&m(o,["seed"],y);let _=f(e,["responseMimeType"]);_!=null&&m(o,["responseMimeType"],_);let x=f(e,["responseSchema"]);x!=null&&m(o,["responseSchema"],Lg(x));let E=f(e,["responseJsonSchema"]);if(E!=null&&m(o,["responseJsonSchema"],E),f(e,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(e,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let T=f(e,["safetySettings"]);if(n!==void 0&&T!=null){let P=T;Array.isArray(P)&&(P=P.map(O=>I1(O))),m(n,["safetySettings"],P)}let S=f(e,["tools"]);if(n!==void 0&&S!=null){let P=ci(S);Array.isArray(P)&&(P=P.map(O=>w1(li(O)))),m(n,["tools"],P)}let I=f(e,["toolConfig"]);if(n!==void 0&&I!=null&&m(n,["toolConfig"],A1(I)),f(e,["labels"])!==void 0)throw new Error("labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let w=f(e,["cachedContent"]);n!==void 0&&w!=null&&m(n,["cachedContent"],Gn(t,w));let b=f(e,["responseModalities"]);b!=null&&m(o,["responseModalities"],b);let B=f(e,["mediaResolution"]);B!=null&&m(o,["mediaResolution"],B);let k=f(e,["speechConfig"]);if(k!=null&&m(o,["speechConfig"],Mg(k)),f(e,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let V=f(e,["thinkingConfig"]);V!=null&&m(o,["thinkingConfig"],V);let ce=f(e,["imageConfig"]);ce!=null&&m(o,["imageConfig"],g1(ce));let Ee=f(e,["enableEnhancedCivicAnswers"]);if(Ee!=null&&m(o,["enableEnhancedCivicAnswers"],Ee),f(e,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let Ne=f(e,["serviceTier"]);return n!==void 0&&Ne!=null&&m(n,["serviceTier"],Ne),o}a(l1,"generateContentConfigToMldev$1");function c1(t){let e={},n=f(t,["sdkHttpResponse"]);n!=null&&m(e,["sdkHttpResponse"],n);let o=f(t,["candidates"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(p=>H4(p))),m(e,["candidates"],l)}let r=f(t,["modelVersion"]);r!=null&&m(e,["modelVersion"],r);let i=f(t,["promptFeedback"]);i!=null&&m(e,["promptFeedback"],i);let s=f(t,["responseId"]);s!=null&&m(e,["responseId"],s);let u=f(t,["usageMetadata"]);u!=null&&m(e,["usageMetadata"],u);let c=f(t,["modelStatus"]);return c!=null&&m(e,["modelStatus"],c),e}a(c1,"generateContentResponseFromMldev$1");function d1(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],di(t,o)),n}a(d1,"getBatchJobParametersToMldev");function f1(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],di(t,o)),n}a(f1,"getBatchJobParametersToVertex");function p1(t){let e={},n=f(t,["authConfig"]);n!=null&&m(e,["authConfig"],L4(n));let o=f(t,["enableWidget"]);return o!=null&&m(e,["enableWidget"],o),e}a(p1,"googleMapsToMldev$4");function m1(t){let e={},n=f(t,["searchTypes"]);if(n!=null&&m(e,["searchTypes"],n),f(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=f(t,["timeRangeFilter"]);return o!=null&&m(e,["timeRangeFilter"],o),e}a(m1,"googleSearchToMldev$4");function g1(t){let e={},n=f(t,["aspectRatio"]);n!=null&&m(e,["aspectRatio"],n);let o=f(t,["imageSize"]);if(o!=null&&m(e,["imageSize"],o),f(t,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["prominentPeople"])!==void 0)throw new Error("prominentPeople parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["imageOutputOptions"])!==void 0)throw new Error("imageOutputOptions parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}a(g1,"imageConfigToMldev$1");function h1(t,e){let n={},o=f(e,["model"]);o!=null&&m(n,["request","model"],ue(t,o));let r=f(e,["contents"]);if(r!=null){let u=yt(r);Array.isArray(u)&&(u=u.map(c=>R$(c))),m(n,["request","contents"],u)}let i=f(e,["metadata"]);i!=null&&m(n,["metadata"],i);let s=f(e,["config"]);return s!=null&&m(n,["request","generationConfig"],l1(t,s,f(n,["request"],{}))),n}a(h1,"inlinedRequestToMldev");function v1(t){let e={},n=f(t,["response"]);n!=null&&m(e,["response"],c1(n));let o=f(t,["metadata"]);o!=null&&m(e,["metadata"],o);let r=f(t,["error"]);return r!=null&&m(e,["error"],r),e}a(v1,"inlinedResponseFromMldev");function y1(t,e){let n={},o=f(t,["pageSize"]);e!==void 0&&o!=null&&m(e,["_query","pageSize"],o);let r=f(t,["pageToken"]);if(e!==void 0&&r!=null&&m(e,["_query","pageToken"],r),f(t,["filter"])!==void 0)throw new Error("filter parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return n}a(y1,"listBatchJobsConfigToMldev");function _1(t,e){let n={},o=f(t,["pageSize"]);e!==void 0&&o!=null&&m(e,["_query","pageSize"],o);let r=f(t,["pageToken"]);e!==void 0&&r!=null&&m(e,["_query","pageToken"],r);let i=f(t,["filter"]);return e!==void 0&&i!=null&&m(e,["_query","filter"],i),n}a(_1,"listBatchJobsConfigToVertex");function x1(t){let e={},n=f(t,["config"]);return n!=null&&y1(n,e),e}a(x1,"listBatchJobsParametersToMldev");function E1(t){let e={},n=f(t,["config"]);return n!=null&&_1(n,e),e}a(E1,"listBatchJobsParametersToVertex");function S1(t){let e={},n=f(t,["sdkHttpResponse"]);n!=null&&m(e,["sdkHttpResponse"],n);let o=f(t,["nextPageToken"]);o!=null&&m(e,["nextPageToken"],o);let r=f(t,["operations"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>wl(s))),m(e,["batchJobs"],i)}return e}a(S1,"listBatchJobsResponseFromMldev");function T1(t){let e={},n=f(t,["sdkHttpResponse"]);n!=null&&m(e,["sdkHttpResponse"],n);let o=f(t,["nextPageToken"]);o!=null&&m(e,["nextPageToken"],o);let r=f(t,["batchPredictionJobs"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>Rm(s))),m(e,["batchJobs"],i)}return e}a(T1,"listBatchJobsResponseFromVertex");function C1(t){let e={},n=f(t,["mediaResolution"]);n!=null&&m(e,["mediaResolution"],n);let o=f(t,["codeExecutionResult"]);o!=null&&m(e,["codeExecutionResult"],o);let r=f(t,["executableCode"]);r!=null&&m(e,["executableCode"],r);let i=f(t,["fileData"]);i!=null&&m(e,["fileData"],s1(i));let s=f(t,["functionCall"]);s!=null&&m(e,["functionCall"],a1(s));let u=f(t,["functionResponse"]);u!=null&&m(e,["functionResponse"],u);let c=f(t,["inlineData"]);c!=null&&m(e,["inlineData"],q4(c));let l=f(t,["text"]);l!=null&&m(e,["text"],l);let p=f(t,["thought"]);p!=null&&m(e,["thought"],p);let d=f(t,["thoughtSignature"]);d!=null&&m(e,["thoughtSignature"],d);let g=f(t,["videoMetadata"]);g!=null&&m(e,["videoMetadata"],g);let h=f(t,["toolCall"]);h!=null&&m(e,["toolCall"],h);let v=f(t,["toolResponse"]);v!=null&&m(e,["toolResponse"],v);let y=f(t,["partMetadata"]);return y!=null&&m(e,["partMetadata"],y),e}a(C1,"partToMldev$4");function I1(t){let e={},n=f(t,["category"]);if(n!=null&&m(e,["category"],n),f(t,["method"])!==void 0)throw new Error("method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=f(t,["threshold"]);return o!=null&&m(e,["threshold"],o),e}a(I1,"safetySettingToMldev$3");function A1(t){let e={},n=f(t,["retrievalConfig"]);n!=null&&m(e,["retrievalConfig"],n);let o=f(t,["functionCallingConfig"]);o!=null&&m(e,["functionCallingConfig"],u1(o));let r=f(t,["includeServerSideToolInvocations"]);return r!=null&&m(e,["includeServerSideToolInvocations"],r),e}a(A1,"toolConfigToMldev$2");function w1(t){let e={};if(f(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=f(t,["computerUse"]);n!=null&&m(e,["computerUse"],n);let o=f(t,["fileSearch"]);o!=null&&m(e,["fileSearch"],o);let r=f(t,["googleSearch"]);r!=null&&m(e,["googleSearch"],m1(r));let i=f(t,["googleMaps"]);i!=null&&m(e,["googleMaps"],p1(i));let s=f(t,["codeExecution"]);if(s!=null&&m(e,["codeExecution"],s),f(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let u=f(t,["functionDeclarations"]);if(u!=null){let d=u;Array.isArray(d)&&(d=d.map(g=>g)),m(e,["functionDeclarations"],d)}let c=f(t,["googleSearchRetrieval"]);if(c!=null&&m(e,["googleSearchRetrieval"],c),f(t,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let l=f(t,["urlContext"]);l!=null&&m(e,["urlContext"],l);let p=f(t,["mcpServers"]);if(p!=null){let d=p;Array.isArray(d)&&(d=d.map(g=>g)),m(e,["mcpServers"],d)}return e}a(w1,"toolToMldev$4");function b1(t){let e={},n=f(t,["bigqueryDestination","outputUri"]);n!=null&&m(e,["bigqueryDestination"],n);let o=f(t,["displayName"]);return o!=null&&m(e,["displayName"],o),e}a(b1,"vertexMultimodalDatasetDestinationFromVertex");function R1(t){let e={},n=f(t,["bigqueryDestination"]);n!=null&&m(e,["bigqueryDestination","outputUri"],n);let o=f(t,["displayName"]);return o!=null&&m(e,["displayName"],o),e}a(R1,"vertexMultimodalDatasetDestinationToVertex");var Fn;(function(t){t.PAGED_ITEM_BATCH_JOBS="batchJobs",t.PAGED_ITEM_MODELS="models",t.PAGED_ITEM_TUNING_JOBS="tuningJobs",t.PAGED_ITEM_FILES="files",t.PAGED_ITEM_CACHED_CONTENTS="cachedContents",t.PAGED_ITEM_FILE_SEARCH_STORES="fileSearchStores",t.PAGED_ITEM_DOCUMENTS="documents",t.PAGED_ITEM_SKILLS="skills"})(Fn||(Fn={}));var mh=class mh{constructor(e,n,o,r){this.pageInternal=[],this.paramsInternal={},this.requestInternal=n,this.init(e,o,r)}init(e,n,o){var r,i;this.nameInternal=e,this.pageInternal=n[this.nameInternal]||[],this.sdkHttpResponseInternal=n==null?void 0:n.sdkHttpResponse,this.idxInternal=0;let s={config:{}};!o||Object.keys(o).length===0?s={config:{}}:typeof o=="object"?s=Object.assign({},o):s=o,s.config&&(s.config.pageToken=n.nextPageToken),this.paramsInternal=s,this.pageInternalSize=(i=(r=s.config)===null||r===void 0?void 0:r.pageSize)!==null&&i!==void 0?i:this.pageInternal.length}initNextPage(e){this.init(this.nameInternal,e,this.paramsInternal)}get page(){return this.pageInternal}get name(){return this.nameInternal}get pageSize(){return this.pageInternalSize}get sdkHttpResponse(){return this.sdkHttpResponseInternal}get params(){return this.paramsInternal}get pageLength(){return this.pageInternal.length}getItem(e){return this.pageInternal[e]}[Symbol.asyncIterator](){return{next:a(async()=>{if(this.idxInternal>=this.pageLength)if(this.hasNextPage())await this.nextPage();else return{value:void 0,done:!0};let e=this.getItem(this.idxInternal);return this.idxInternal+=1,{value:e,done:!1}},"next"),return:a(async()=>({value:void 0,done:!0}),"return")}}async nextPage(){if(!this.hasNextPage())throw new Error("No more pages to fetch.");let e=await this.requestInternal(this.params);return this.initNextPage(e),this.page}hasNextPage(){var e;return((e=this.params.config)===null||e===void 0?void 0:e.pageToken)!==void 0}};a(mh,"Pager");var zn=mh;var gh=class gh extends en{constructor(e){super(),this.apiClient=e,this.list=async(n={})=>new zn(Fn.PAGED_ITEM_BATCH_JOBS,o=>this.listInternal(o),await this.listInternal(n),n),this.create=async n=>(this.apiClient.isVertexAI()&&(n.config=this.formatDestination(n.src,n.config)),this.createInternal(n)),this.createEmbeddings=async n=>{if(console.warn("batches.createEmbeddings() is experimental and may change without notice."),this.apiClient.isVertexAI())throw new Error("Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support batches.createEmbeddings.");return this.createEmbeddingsInternal(n)}}createInlinedGenerateContentRequest(e){let n=UN(this.apiClient,e),o=n._url,r=q("{model}:batchGenerateContent",o),u=n.batch.inputConfig.requests,c=u.requests,l=[];for(let p of c){let d=Object.assign({},p);if(d.systemInstruction){let g=d.systemInstruction;delete d.systemInstruction;let h=d.request;h.systemInstruction=g,d.request=h}l.push(d)}return u.requests=l,delete n.config,delete n._url,delete n._query,{path:r,body:n}}getGcsUri(e){if(typeof e=="string")return e.startsWith("gs://")?e:void 0;if(!Array.isArray(e)&&e.gcsUri&&e.gcsUri.length>0)return e.gcsUri[0]}getBigqueryUri(e){if(typeof e=="string")return e.startsWith("bq://")?e:void 0;if(!Array.isArray(e))return e.bigqueryUri}formatDestination(e,n){let o=n?Object.assign({},n):{},r=Date.now().toString();if(o.displayName||(o.displayName=`genaiBatchJob_${r}`),o.dest===void 0){let i=this.getGcsUri(e),s=this.getBigqueryUri(e);if(i)i.endsWith(".jsonl")?o.dest=`${i.slice(0,-6)}/dest`:o.dest=`${i}_dest_${r}`;else if(s)o.dest=`${s}_dest_${r}`;else throw new Error("Unsupported source for Gemini Enterprise Agent Platform (previously known as Vertex AI): No GCS or BigQuery URI found.")}return o}async createInternal(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=j4(this.apiClient,e);return u=q("batchPredictionJobs",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json()),s.then(p=>Rm(p))}else{let l=UN(this.apiClient,e);return u=q("{model}:batchGenerateContent",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json()),s.then(p=>wl(p))}}async createEmbeddingsInternal(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let u=X4(this.apiClient,e);return i=q("{model}:asyncBatchEmbedContent",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>wl(c))}}async get(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=f1(this.apiClient,e);return u=q("batchPredictionJobs/{name}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json()),s.then(p=>Rm(p))}else{let l=d1(this.apiClient,e);return u=q("batches/{name}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json()),s.then(p=>wl(p))}}async cancel(e){var n,o,r,i;let s="",u={};if(this.apiClient.isVertexAI()){let c=Z4(this.apiClient,e);s=q("batchPredictionJobs/{name}:cancel",c._url),u=c._query,delete c._url,delete c._query,await this.apiClient.request({path:s,queryParams:u,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal})}else{let c=V4(this.apiClient,e);s=q("batches/{name}:cancel",c._url),u=c._query,delete c._url,delete c._query,await this.apiClient.request({path:s,queryParams:u,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal})}}async listInternal(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=E1(e);return u=q("batchPredictionJobs",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=T1(p),g=new zl;return Object.assign(g,d),g})}else{let l=x1(e);return u=q("batches",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=S1(p),g=new zl;return Object.assign(g,d),g})}}async delete(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=e1(this.apiClient,e);return u=q("batchPredictionJobs/{name}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>n1(p))}else{let l=Q4(this.apiClient,e);return u=q("batches/{name}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"DELETE",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>t1(p))}}};a(gh,"Batches");var km=gh;function k1(t){let e={},n=f(t,["apiKey"]);if(n!=null&&m(e,["apiKey"],n),f(t,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["authType"])!==void 0)throw new Error("authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}a(k1,"authConfigToMldev$3");function P1(t){let e={},n=f(t,["data"]);if(n!=null&&m(e,["data"],n),f(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=f(t,["mimeType"]);return o!=null&&m(e,["mimeType"],o),e}a(P1,"blobToMldev$3");function N1(t){let e={},n=f(t,["outcome"]);n!=null&&m(e,["outcome"],n);let o=f(t,["output"]);if(o!=null&&m(e,["output"],o),f(t,["id"])!==void 0)throw new Error("id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}a(N1,"codeExecutionResultToVertex$3");function FN(t){let e={},n=f(t,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>n6(i))),m(e,["parts"],r)}let o=f(t,["role"]);return o!=null&&m(e,["role"],o),e}a(FN,"contentToMldev$3");function zN(t){let e={},n=f(t,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>r6(i))),m(e,["parts"],r)}let o=f(t,["role"]);return o!=null&&m(e,["role"],o),e}a(zN,"contentToVertex$3");function $1(t,e){let n={},o=f(t,["ttl"]);e!==void 0&&o!=null&&m(e,["ttl"],o);let r=f(t,["expireTime"]);e!==void 0&&r!=null&&m(e,["expireTime"],r);let i=f(t,["displayName"]);e!==void 0&&i!=null&&m(e,["displayName"],i);let s=f(t,["contents"]);if(e!==void 0&&s!=null){let p=yt(s);Array.isArray(p)&&(p=p.map(d=>FN(d))),m(e,["contents"],p)}let u=f(t,["systemInstruction"]);e!==void 0&&u!=null&&m(e,["systemInstruction"],FN(Ge(u)));let c=f(t,["tools"]);if(e!==void 0&&c!=null){let p=c;Array.isArray(p)&&(p=p.map(d=>s6(d))),m(e,["tools"],p)}let l=f(t,["toolConfig"]);if(e!==void 0&&l!=null&&m(e,["toolConfig"],o6(l)),f(t,["kmsKeyName"])!==void 0)throw new Error("kmsKeyName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return n}a($1,"createCachedContentConfigToMldev");function D1(t,e){let n={},o=f(t,["ttl"]);e!==void 0&&o!=null&&m(e,["ttl"],o);let r=f(t,["expireTime"]);e!==void 0&&r!=null&&m(e,["expireTime"],r);let i=f(t,["displayName"]);e!==void 0&&i!=null&&m(e,["displayName"],i);let s=f(t,["contents"]);if(e!==void 0&&s!=null){let d=yt(s);Array.isArray(d)&&(d=d.map(g=>zN(g))),m(e,["contents"],d)}let u=f(t,["systemInstruction"]);e!==void 0&&u!=null&&m(e,["systemInstruction"],zN(Ge(u)));let c=f(t,["tools"]);if(e!==void 0&&c!=null){let d=c;Array.isArray(d)&&(d=d.map(g=>a6(g))),m(e,["tools"],d)}let l=f(t,["toolConfig"]);e!==void 0&&l!=null&&m(e,["toolConfig"],i6(l));let p=f(t,["kmsKeyName"]);return e!==void 0&&p!=null&&m(e,["encryption_spec","kmsKeyName"],p),n}a(D1,"createCachedContentConfigToVertex");function O1(t,e){let n={},o=f(e,["model"]);o!=null&&m(n,["model"],v$(t,o));let r=f(e,["config"]);return r!=null&&$1(r,n),n}a(O1,"createCachedContentParametersToMldev");function L1(t,e){let n={},o=f(e,["model"]);o!=null&&m(n,["model"],v$(t,o));let r=f(e,["config"]);return r!=null&&D1(r,n),n}a(L1,"createCachedContentParametersToVertex");function M1(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],Gn(t,o)),n}a(M1,"deleteCachedContentParametersToMldev");function U1(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],Gn(t,o)),n}a(U1,"deleteCachedContentParametersToVertex");function F1(t){let e={},n=f(t,["sdkHttpResponse"]);return n!=null&&m(e,["sdkHttpResponse"],n),e}a(F1,"deleteCachedContentResponseFromMldev");function z1(t){let e={},n=f(t,["sdkHttpResponse"]);return n!=null&&m(e,["sdkHttpResponse"],n),e}a(z1,"deleteCachedContentResponseFromVertex");function G1(t){let e={},n=f(t,["code"]);n!=null&&m(e,["code"],n);let o=f(t,["language"]);if(o!=null&&m(e,["language"],o),f(t,["id"])!==void 0)throw new Error("id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}a(G1,"executableCodeToVertex$3");function B1(t){let e={};if(f(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=f(t,["fileUri"]);n!=null&&m(e,["fileUri"],n);let o=f(t,["mimeType"]);return o!=null&&m(e,["mimeType"],o),e}a(B1,"fileDataToMldev$3");function q1(t){let e={},n=f(t,["id"]);n!=null&&m(e,["id"],n);let o=f(t,["args"]);o!=null&&m(e,["args"],o);let r=f(t,["name"]);if(r!=null&&m(e,["name"],r),f(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}a(q1,"functionCallToMldev$3");function V1(t){let e={},n=f(t,["allowedFunctionNames"]);n!=null&&m(e,["allowedFunctionNames"],n);let o=f(t,["mode"]);if(o!=null&&m(e,["mode"],o),f(t,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}a(V1,"functionCallingConfigToMldev$1");function Z1(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],Gn(t,o)),n}a(Z1,"getCachedContentParametersToMldev");function H1(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],Gn(t,o)),n}a(H1,"getCachedContentParametersToVertex");function J1(t){let e={},n=f(t,["authConfig"]);n!=null&&m(e,["authConfig"],k1(n));let o=f(t,["enableWidget"]);return o!=null&&m(e,["enableWidget"],o),e}a(J1,"googleMapsToMldev$3");function K1(t){let e={},n=f(t,["searchTypes"]);if(n!=null&&m(e,["searchTypes"],n),f(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=f(t,["timeRangeFilter"]);return o!=null&&m(e,["timeRangeFilter"],o),e}a(K1,"googleSearchToMldev$3");function W1(t,e){let n={},o=f(t,["pageSize"]);e!==void 0&&o!=null&&m(e,["_query","pageSize"],o);let r=f(t,["pageToken"]);return e!==void 0&&r!=null&&m(e,["_query","pageToken"],r),n}a(W1,"listCachedContentsConfigToMldev");function j1(t,e){let n={},o=f(t,["pageSize"]);e!==void 0&&o!=null&&m(e,["_query","pageSize"],o);let r=f(t,["pageToken"]);return e!==void 0&&r!=null&&m(e,["_query","pageToken"],r),n}a(j1,"listCachedContentsConfigToVertex");function Y1(t){let e={},n=f(t,["config"]);return n!=null&&W1(n,e),e}a(Y1,"listCachedContentsParametersToMldev");function X1(t){let e={},n=f(t,["config"]);return n!=null&&j1(n,e),e}a(X1,"listCachedContentsParametersToVertex");function Q1(t){let e={},n=f(t,["sdkHttpResponse"]);n!=null&&m(e,["sdkHttpResponse"],n);let o=f(t,["nextPageToken"]);o!=null&&m(e,["nextPageToken"],o);let r=f(t,["cachedContents"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),m(e,["cachedContents"],i)}return e}a(Q1,"listCachedContentsResponseFromMldev");function e6(t){let e={},n=f(t,["sdkHttpResponse"]);n!=null&&m(e,["sdkHttpResponse"],n);let o=f(t,["nextPageToken"]);o!=null&&m(e,["nextPageToken"],o);let r=f(t,["cachedContents"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),m(e,["cachedContents"],i)}return e}a(e6,"listCachedContentsResponseFromVertex");function t6(t){let e={};if(f(t,["name"])!==void 0)throw new Error("name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(f(t,["streamableHttpTransport"])!==void 0)throw new Error("streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}a(t6,"mcpServerToVertex$2");function n6(t){let e={},n=f(t,["mediaResolution"]);n!=null&&m(e,["mediaResolution"],n);let o=f(t,["codeExecutionResult"]);o!=null&&m(e,["codeExecutionResult"],o);let r=f(t,["executableCode"]);r!=null&&m(e,["executableCode"],r);let i=f(t,["fileData"]);i!=null&&m(e,["fileData"],B1(i));let s=f(t,["functionCall"]);s!=null&&m(e,["functionCall"],q1(s));let u=f(t,["functionResponse"]);u!=null&&m(e,["functionResponse"],u);let c=f(t,["inlineData"]);c!=null&&m(e,["inlineData"],P1(c));let l=f(t,["text"]);l!=null&&m(e,["text"],l);let p=f(t,["thought"]);p!=null&&m(e,["thought"],p);let d=f(t,["thoughtSignature"]);d!=null&&m(e,["thoughtSignature"],d);let g=f(t,["videoMetadata"]);g!=null&&m(e,["videoMetadata"],g);let h=f(t,["toolCall"]);h!=null&&m(e,["toolCall"],h);let v=f(t,["toolResponse"]);v!=null&&m(e,["toolResponse"],v);let y=f(t,["partMetadata"]);return y!=null&&m(e,["partMetadata"],y),e}a(n6,"partToMldev$3");function r6(t){let e={},n=f(t,["mediaResolution"]);n!=null&&m(e,["mediaResolution"],n);let o=f(t,["codeExecutionResult"]);o!=null&&m(e,["codeExecutionResult"],N1(o));let r=f(t,["executableCode"]);r!=null&&m(e,["executableCode"],G1(r));let i=f(t,["fileData"]);i!=null&&m(e,["fileData"],i);let s=f(t,["functionCall"]);s!=null&&m(e,["functionCall"],s);let u=f(t,["functionResponse"]);u!=null&&m(e,["functionResponse"],u);let c=f(t,["inlineData"]);c!=null&&m(e,["inlineData"],c);let l=f(t,["text"]);l!=null&&m(e,["text"],l);let p=f(t,["thought"]);p!=null&&m(e,["thought"],p);let d=f(t,["thoughtSignature"]);d!=null&&m(e,["thoughtSignature"],d);let g=f(t,["videoMetadata"]);if(g!=null&&m(e,["videoMetadata"],g),f(t,["toolCall"])!==void 0)throw new Error("toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(f(t,["toolResponse"])!==void 0)throw new Error("toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(f(t,["partMetadata"])!==void 0)throw new Error("partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}a(r6,"partToVertex$3");function o6(t){let e={},n=f(t,["retrievalConfig"]);n!=null&&m(e,["retrievalConfig"],n);let o=f(t,["functionCallingConfig"]);o!=null&&m(e,["functionCallingConfig"],V1(o));let r=f(t,["includeServerSideToolInvocations"]);return r!=null&&m(e,["includeServerSideToolInvocations"],r),e}a(o6,"toolConfigToMldev$1");function i6(t){let e={},n=f(t,["retrievalConfig"]);n!=null&&m(e,["retrievalConfig"],n);let o=f(t,["functionCallingConfig"]);if(o!=null&&m(e,["functionCallingConfig"],o),f(t,["includeServerSideToolInvocations"])!==void 0)throw new Error("includeServerSideToolInvocations parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}a(i6,"toolConfigToVertex$1");function s6(t){let e={};if(f(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=f(t,["computerUse"]);n!=null&&m(e,["computerUse"],n);let o=f(t,["fileSearch"]);o!=null&&m(e,["fileSearch"],o);let r=f(t,["googleSearch"]);r!=null&&m(e,["googleSearch"],K1(r));let i=f(t,["googleMaps"]);i!=null&&m(e,["googleMaps"],J1(i));let s=f(t,["codeExecution"]);if(s!=null&&m(e,["codeExecution"],s),f(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let u=f(t,["functionDeclarations"]);if(u!=null){let d=u;Array.isArray(d)&&(d=d.map(g=>g)),m(e,["functionDeclarations"],d)}let c=f(t,["googleSearchRetrieval"]);if(c!=null&&m(e,["googleSearchRetrieval"],c),f(t,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let l=f(t,["urlContext"]);l!=null&&m(e,["urlContext"],l);let p=f(t,["mcpServers"]);if(p!=null){let d=p;Array.isArray(d)&&(d=d.map(g=>g)),m(e,["mcpServers"],d)}return e}a(s6,"toolToMldev$3");function a6(t){let e={},n=f(t,["retrieval"]);n!=null&&m(e,["retrieval"],n);let o=f(t,["computerUse"]);if(o!=null&&m(e,["computerUse"],o),f(t,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");let r=f(t,["googleSearch"]);r!=null&&m(e,["googleSearch"],r);let i=f(t,["googleMaps"]);i!=null&&m(e,["googleMaps"],i);let s=f(t,["codeExecution"]);s!=null&&m(e,["codeExecution"],s);let u=f(t,["enterpriseWebSearch"]);u!=null&&m(e,["enterpriseWebSearch"],u);let c=f(t,["functionDeclarations"]);if(c!=null){let h=c;Array.isArray(h)&&(h=h.map(v=>v)),m(e,["functionDeclarations"],h)}let l=f(t,["googleSearchRetrieval"]);l!=null&&m(e,["googleSearchRetrieval"],l);let p=f(t,["parallelAiSearch"]);p!=null&&m(e,["parallelAiSearch"],p);let d=f(t,["urlContext"]);d!=null&&m(e,["urlContext"],d);let g=f(t,["mcpServers"]);if(g!=null){let h=g;Array.isArray(h)&&(h=h.map(v=>t6(v))),m(e,["mcpServers"],h)}return e}a(a6,"toolToVertex$2");function u6(t,e){let n={},o=f(t,["ttl"]);e!==void 0&&o!=null&&m(e,["ttl"],o);let r=f(t,["expireTime"]);return e!==void 0&&r!=null&&m(e,["expireTime"],r),n}a(u6,"updateCachedContentConfigToMldev");function l6(t,e){let n={},o=f(t,["ttl"]);e!==void 0&&o!=null&&m(e,["ttl"],o);let r=f(t,["expireTime"]);return e!==void 0&&r!=null&&m(e,["expireTime"],r),n}a(l6,"updateCachedContentConfigToVertex");function c6(t,e){let n={},o=f(e,["name"]);o!=null&&m(n,["_url","name"],Gn(t,o));let r=f(e,["config"]);return r!=null&&u6(r,n),n}a(c6,"updateCachedContentParametersToMldev");function d6(t,e){let n={},o=f(e,["name"]);o!=null&&m(n,["_url","name"],Gn(t,o));let r=f(e,["config"]);return r!=null&&l6(r,n),n}a(d6,"updateCachedContentParametersToVertex");var hh=class hh extends en{constructor(e){super(),this.apiClient=e,this.list=async(n={})=>new zn(Fn.PAGED_ITEM_CACHED_CONTENTS,o=>this.listInternal(o),await this.listInternal(n),n)}async create(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=L1(this.apiClient,e);return u=q("cachedContents",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json()),s.then(p=>p)}else{let l=O1(this.apiClient,e);return u=q("cachedContents",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json()),s.then(p=>p)}}async get(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=H1(this.apiClient,e);return u=q("{name}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json()),s.then(p=>p)}else{let l=Z1(this.apiClient,e);return u=q("{name}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json()),s.then(p=>p)}}async delete(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=U1(this.apiClient,e);return u=q("{name}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=z1(p),g=new Ul;return Object.assign(g,d),g})}else{let l=M1(this.apiClient,e);return u=q("{name}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"DELETE",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=F1(p),g=new Ul;return Object.assign(g,d),g})}}async update(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=d6(this.apiClient,e);return u=q("{name}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"PATCH",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json()),s.then(p=>p)}else{let l=c6(this.apiClient,e);return u=q("{name}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"PATCH",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json()),s.then(p=>p)}}async listInternal(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=X1(e);return u=q("cachedContents",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=e6(p),g=new Fl;return Object.assign(g,d),g})}else{let l=Y1(e);return u=q("cachedContents",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=Q1(p),g=new Fl;return Object.assign(g,d),g})}}};a(hh,"Caches");var Pm=hh;function Qt(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n}a(Qt,"__rest");function GN(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}a(GN,"__values");function Te(t){return this instanceof Te?(this.v=t,this):new Te(t)}a(Te,"__await");function ti(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=n.apply(t,e||[]),r,i=[];return r=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",s),r[Symbol.asyncIterator]=function(){return this},r;function s(h){return function(v){return Promise.resolve(v).then(h,d)}}function u(h,v){o[h]&&(r[h]=function(y){return new Promise(function(_,x){i.push([h,y,_,x])>1||c(h,y)})},v&&(r[h]=v(r[h])))}function c(h,v){try{l(o[h](v))}catch(y){g(i[0][3],y)}}function l(h){h.value instanceof Te?Promise.resolve(h.value.v).then(p,d):g(i[0][2],h)}function p(h){c("next",h)}function d(h){c("throw",h)}function g(h,v){h(v),i.shift(),i.length&&c(i[0][0],i[0][1])}}a(ti,"__asyncGenerator");function Qs(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof GN=="function"?GN(t):t[Symbol.iterator](),n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n);function o(i){n[i]=t[i]&&function(s){return new Promise(function(u,c){s=t[i](s),r(u,c,s.done,s.value)})}}function r(i,s,u,c){Promise.resolve(c).then(function(l){i({value:l,done:u})},s)}}a(Qs,"__asyncValues");function f6(t){var e;if(t.candidates==null||t.candidates.length===0)return!1;let n=(e=t.candidates[0])===null||e===void 0?void 0:e.content;return n===void 0?!1:k$(n)}a(f6,"isValidResponse");function k$(t){if(t.parts===void 0||t.parts.length===0)return!1;for(let e of t.parts)if(e===void 0||Object.keys(e).length===0)return!1;return!0}a(k$,"isValidContent");function p6(t){if(t.length!==0){for(let e of t)if(e.role!=="user"&&e.role!=="model")throw new Error(`Role must be user or model, but got ${e.role}.`)}}a(p6,"validateHistory");function BN(t){if(t===void 0||t.length===0)return[];let e=[],n=t.length,o=0;for(;o<n;)if(t[o].role==="user")e.push(t[o]),o++;else{let r=[],i=!0;for(;o<n&&t[o].role==="model";)r.push(t[o]),i&&!k$(t[o])&&(i=!1),o++;i?e.push(...r):e.pop()}return e}a(BN,"extractCuratedHistory");var vh=class vh{constructor(e,n){this.modelsModule=e,this.apiClient=n}create(e){return new $m(this.apiClient,this.modelsModule,e.model,e.config,structuredClone(e.history))}};a(vh,"Chats");var Nm=vh,yh=class yh{constructor(e,n,o,r={},i=[]){this.apiClient=e,this.modelsModule=n,this.model=o,this.config=r,this.history=i,this.sendPromise=Promise.resolve(),p6(i)}async sendMessage(e){var n;await this.sendPromise;let o=Ge(e.message),r=this.modelsModule.generateContent({model:this.model,contents:this.getHistory(!0).concat(o),config:(n=e.config)!==null&&n!==void 0?n:this.config});return this.sendPromise=(async()=>{var i,s,u;let c=await r,l=(s=(i=c.candidates)===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.content,p=c.automaticFunctionCallingHistory,d=this.getHistory(!0).length,g=[];p!=null&&(g=(u=p.slice(d))!==null&&u!==void 0?u:[]);let h=l?[l]:[];this.recordHistory(o,h,g)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),r}async sendMessageStream(e){var n;await this.sendPromise;let o=Ge(e.message),r=this.modelsModule.generateContentStream({model:this.model,contents:this.getHistory(!0).concat(o),config:(n=e.config)!==null&&n!==void 0?n:this.config});this.sendPromise=r.then(()=>{}).catch(()=>{});let i=await r;return this.processStreamResponse(i,o)}getHistory(e=!1){let n=e?BN(this.history):this.history;return structuredClone(n)}processStreamResponse(e,n){return ti(this,arguments,a(function*(){var r,i,s,u,c,l;let p=[];try{for(var d=!0,g=Qs(e),h;h=yield Te(g.next()),r=h.done,!r;d=!0){u=h.value,d=!1;let v=u;if(f6(v)){let y=(l=(c=v.candidates)===null||c===void 0?void 0:c[0])===null||l===void 0?void 0:l.content;y!==void 0&&p.push(y)}yield yield Te(v)}}catch(v){i={error:v}}finally{try{!d&&!r&&(s=g.return)&&(yield Te(s.call(g)))}finally{if(i)throw i.error}}this.recordHistory(n,p)},"processStreamResponse_1"))}recordHistory(e,n,o){let r=[];n.length>0&&n.every(i=>i.role!==void 0)?r=n:r.push({role:"model",parts:[]}),o&&o.length>0?this.history.push(...BN(o)):this.history.push(e),this.history.push(...r)}};a(yh,"Chat");var $m=yh;var tc=class tc extends Error{constructor(e){super(e.message),this.name="ApiError",this.status=e.status,Object.setPrototypeOf(this,tc.prototype)}};a(tc,"ApiError");var Bl=tc;function m6(t){let e={},n=f(t,["file"]);return n!=null&&m(e,["file"],n),e}a(m6,"createFileParametersToMldev");function g6(t){let e={},n=f(t,["sdkHttpResponse"]);return n!=null&&m(e,["sdkHttpResponse"],n),e}a(g6,"createFileResponseFromMldev");function h6(t){let e={},n=f(t,["name"]);return n!=null&&m(e,["_url","file"],T$(n)),e}a(h6,"deleteFileParametersToMldev");function v6(t){let e={},n=f(t,["sdkHttpResponse"]);return n!=null&&m(e,["sdkHttpResponse"],n),e}a(v6,"deleteFileResponseFromMldev");function y6(t){let e={},n=f(t,["name"]);return n!=null&&m(e,["_url","file"],T$(n)),e}a(y6,"getFileParametersToMldev");function _6(t){let e={},n=f(t,["uris"]);return n!=null&&m(e,["uris"],n),e}a(_6,"internalRegisterFilesParametersToMldev");function x6(t,e){let n={},o=f(t,["pageSize"]);e!==void 0&&o!=null&&m(e,["_query","pageSize"],o);let r=f(t,["pageToken"]);return e!==void 0&&r!=null&&m(e,["_query","pageToken"],r),n}a(x6,"listFilesConfigToMldev");function E6(t){let e={},n=f(t,["config"]);return n!=null&&x6(n,e),e}a(E6,"listFilesParametersToMldev");function S6(t){let e={},n=f(t,["sdkHttpResponse"]);n!=null&&m(e,["sdkHttpResponse"],n);let o=f(t,["nextPageToken"]);o!=null&&m(e,["nextPageToken"],o);let r=f(t,["files"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),m(e,["files"],i)}return e}a(S6,"listFilesResponseFromMldev");function T6(t){let e={},n=f(t,["sdkHttpResponse"]);n!=null&&m(e,["sdkHttpResponse"],n);let o=f(t,["files"]);if(o!=null){let r=o;Array.isArray(r)&&(r=r.map(i=>i)),m(e,["files"],r)}return e}a(T6,"registerFilesResponseFromMldev");var _h=class _h extends en{constructor(e){super(),this.apiClient=e,this.list=async(n={})=>new zn(Fn.PAGED_ITEM_FILES,o=>this.listInternal(o),await this.listInternal(n),n)}async upload(e){if(this.apiClient.isVertexAI())throw new Error("Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support uploading files. You can share files through a GCS bucket.");return this.apiClient.uploadFile(e.file,e.config).then(n=>n)}async download(e){await this.apiClient.downloadFile(e)}async registerFiles(e){throw new Error("registerFiles is only supported in Node.js environments.")}async _registerFiles(e){return this.registerFilesInternal(e)}async listInternal(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let u=E6(e);return i=q("files",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json().then(l=>{let p=l;return p.sdkHttpResponse={headers:c.headers},p})),r.then(c=>{let l=S6(c),p=new Em;return Object.assign(p,l),p})}}async createInternal(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let u=m6(e);return i=q("upload/v1beta/files",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>{let l=g6(c),p=new Sm;return Object.assign(p,l),p})}}async get(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let u=y6(e);return i=q("files/{file}",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>c)}}async delete(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let u=h6(e);return i=q("files/{file}",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json().then(l=>{let p=l;return p.sdkHttpResponse={headers:c.headers},p})),r.then(c=>{let l=v6(c),p=new Tm;return Object.assign(p,l),p})}}async registerFilesInternal(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let u=_6(e);return i=q("files:register",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>{let l=T6(c),p=new Cm;return Object.assign(p,l),p})}}};a(_h,"Files");var Dm=_h;function qN(t){let e={};if(f(t,["languageCodes"])!==void 0)throw new Error("languageCodes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=f(t,["languageAuto"]);n!=null&&m(e,["languageAuto"],n);let o=f(t,["languageHints"]);o!=null&&m(e,["languageHints"],o);let r=f(t,["adaptationPhrases"]);return r!=null&&m(e,["adaptationPhrases"],r),e}a(qN,"audioTranscriptionConfigToMldev$1");function C6(t){let e={},n=f(t,["apiKey"]);if(n!=null&&m(e,["apiKey"],n),f(t,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["authType"])!==void 0)throw new Error("authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}a(C6,"authConfigToMldev$2");function bl(t){let e={},n=f(t,["data"]);if(n!=null&&m(e,["data"],n),f(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=f(t,["mimeType"]);return o!=null&&m(e,["mimeType"],o),e}a(bl,"blobToMldev$2");function I6(t){let e={},n=f(t,["outcome"]);n!=null&&m(e,["outcome"],n);let o=f(t,["output"]);if(o!=null&&m(e,["output"],o),f(t,["id"])!==void 0)throw new Error("id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}a(I6,"codeExecutionResultToVertex$2");function A6(t){let e={},n=f(t,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>V6(i))),m(e,["parts"],r)}let o=f(t,["role"]);return o!=null&&m(e,["role"],o),e}a(A6,"contentToMldev$2");function w6(t){let e={},n=f(t,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>Z6(i))),m(e,["parts"],r)}let o=f(t,["role"]);return o!=null&&m(e,["role"],o),e}a(w6,"contentToVertex$2");function b6(t){let e={},n=f(t,["code"]);n!=null&&m(e,["code"],n);let o=f(t,["language"]);if(o!=null&&m(e,["language"],o),f(t,["id"])!==void 0)throw new Error("id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}a(b6,"executableCodeToVertex$2");function R6(t){let e={};if(f(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=f(t,["fileUri"]);n!=null&&m(e,["fileUri"],n);let o=f(t,["mimeType"]);return o!=null&&m(e,["mimeType"],o),e}a(R6,"fileDataToMldev$2");function k6(t){let e={},n=f(t,["id"]);n!=null&&m(e,["id"],n);let o=f(t,["args"]);o!=null&&m(e,["args"],o);let r=f(t,["name"]);if(r!=null&&m(e,["name"],r),f(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}a(k6,"functionCallToMldev$2");function P6(t){let e={},n=f(t,["modelSelectionConfig"]);n!=null&&m(e,["modelConfig"],n);let o=f(t,["responseJsonSchema"]);o!=null&&m(e,["responseJsonSchema"],o);let r=f(t,["audioTimestamp"]);r!=null&&m(e,["audioTimestamp"],r);let i=f(t,["candidateCount"]);i!=null&&m(e,["candidateCount"],i);let s=f(t,["enableAffectiveDialog"]);s!=null&&m(e,["enableAffectiveDialog"],s);let u=f(t,["frequencyPenalty"]);u!=null&&m(e,["frequencyPenalty"],u);let c=f(t,["logprobs"]);c!=null&&m(e,["logprobs"],c);let l=f(t,["maxOutputTokens"]);l!=null&&m(e,["maxOutputTokens"],l);let p=f(t,["mediaResolution"]);p!=null&&m(e,["mediaResolution"],p);let d=f(t,["presencePenalty"]);d!=null&&m(e,["presencePenalty"],d);let g=f(t,["responseLogprobs"]);g!=null&&m(e,["responseLogprobs"],g);let h=f(t,["responseMimeType"]);h!=null&&m(e,["responseMimeType"],h);let v=f(t,["responseModalities"]);v!=null&&m(e,["responseModalities"],v);let y=f(t,["responseSchema"]);y!=null&&m(e,["responseSchema"],y);let _=f(t,["routingConfig"]);_!=null&&m(e,["routingConfig"],_);let x=f(t,["seed"]);x!=null&&m(e,["seed"],x);let E=f(t,["speechConfig"]);E!=null&&m(e,["speechConfig"],E);let T=f(t,["stopSequences"]);T!=null&&m(e,["stopSequences"],T);let S=f(t,["temperature"]);S!=null&&m(e,["temperature"],S);let I=f(t,["thinkingConfig"]);I!=null&&m(e,["thinkingConfig"],I);let w=f(t,["topK"]);w!=null&&m(e,["topK"],w);let b=f(t,["topP"]);if(b!=null&&m(e,["topP"],b),f(t,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}a(P6,"generationConfigToVertex$1");function N6(t){let e={},n=f(t,["authConfig"]);n!=null&&m(e,["authConfig"],C6(n));let o=f(t,["enableWidget"]);return o!=null&&m(e,["enableWidget"],o),e}a(N6,"googleMapsToMldev$2");function $6(t){let e={},n=f(t,["searchTypes"]);if(n!=null&&m(e,["searchTypes"],n),f(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=f(t,["timeRangeFilter"]);return o!=null&&m(e,["timeRangeFilter"],o),e}a($6,"googleSearchToMldev$2");function D6(t,e){let n={},o=f(t,["generationConfig"]);e!==void 0&&o!=null&&m(e,["setup","generationConfig"],o);let r=f(t,["responseModalities"]);e!==void 0&&r!=null&&m(e,["setup","generationConfig","responseModalities"],r);let i=f(t,["temperature"]);e!==void 0&&i!=null&&m(e,["setup","generationConfig","temperature"],i);let s=f(t,["topP"]);e!==void 0&&s!=null&&m(e,["setup","generationConfig","topP"],s);let u=f(t,["topK"]);e!==void 0&&u!=null&&m(e,["setup","generationConfig","topK"],u);let c=f(t,["maxOutputTokens"]);e!==void 0&&c!=null&&m(e,["setup","generationConfig","maxOutputTokens"],c);let l=f(t,["mediaResolution"]);e!==void 0&&l!=null&&m(e,["setup","generationConfig","mediaResolution"],l);let p=f(t,["seed"]);e!==void 0&&p!=null&&m(e,["setup","generationConfig","seed"],p);let d=f(t,["speechConfig"]);e!==void 0&&d!=null&&m(e,["setup","generationConfig","speechConfig"],Ug(d));let g=f(t,["thinkingConfig"]);e!==void 0&&g!=null&&m(e,["setup","generationConfig","thinkingConfig"],g);let h=f(t,["enableAffectiveDialog"]);e!==void 0&&h!=null&&m(e,["setup","generationConfig","enableAffectiveDialog"],h);let v=f(t,["systemInstruction"]);e!==void 0&&v!=null&&m(e,["setup","systemInstruction"],A6(Ge(v)));let y=f(t,["tools"]);if(e!==void 0&&y!=null){let k=ci(y);Array.isArray(k)&&(k=k.map(V=>K6(li(V)))),m(e,["setup","tools"],k)}let _=f(t,["sessionResumption"]);e!==void 0&&_!=null&&m(e,["setup","sessionResumption"],J6(_));let x=f(t,["inputAudioTranscription"]);e!==void 0&&x!=null&&m(e,["setup","inputAudioTranscription"],qN(x));let E=f(t,["outputAudioTranscription"]);e!==void 0&&E!=null&&m(e,["setup","outputAudioTranscription"],qN(E));let T=f(t,["realtimeInputConfig"]);e!==void 0&&T!=null&&m(e,["setup","realtimeInputConfig"],T);let S=f(t,["contextWindowCompression"]);e!==void 0&&S!=null&&m(e,["setup","contextWindowCompression"],S);let I=f(t,["proactivity"]);if(e!==void 0&&I!=null&&m(e,["setup","proactivity"],I),f(t,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let w=f(t,["avatarConfig"]);e!==void 0&&w!=null&&m(e,["setup","avatarConfig"],w);let b=f(t,["safetySettings"]);if(e!==void 0&&b!=null){let k=b;Array.isArray(k)&&(k=k.map(V=>H6(V))),m(e,["setup","safetySettings"],k)}let B=f(t,["translationConfig"]);return e!==void 0&&B!=null&&m(e,["setup","generationConfig","translationConfig"],B),n}a(D6,"liveConnectConfigToMldev$1");function O6(t,e){let n={},o=f(t,["generationConfig"]);e!==void 0&&o!=null&&m(e,["setup","generationConfig"],P6(o));let r=f(t,["responseModalities"]);e!==void 0&&r!=null&&m(e,["setup","generationConfig","responseModalities"],r);let i=f(t,["temperature"]);e!==void 0&&i!=null&&m(e,["setup","generationConfig","temperature"],i);let s=f(t,["topP"]);e!==void 0&&s!=null&&m(e,["setup","generationConfig","topP"],s);let u=f(t,["topK"]);e!==void 0&&u!=null&&m(e,["setup","generationConfig","topK"],u);let c=f(t,["maxOutputTokens"]);e!==void 0&&c!=null&&m(e,["setup","generationConfig","maxOutputTokens"],c);let l=f(t,["mediaResolution"]);e!==void 0&&l!=null&&m(e,["setup","generationConfig","mediaResolution"],l);let p=f(t,["seed"]);e!==void 0&&p!=null&&m(e,["setup","generationConfig","seed"],p);let d=f(t,["speechConfig"]);e!==void 0&&d!=null&&m(e,["setup","generationConfig","speechConfig"],Ug(d));let g=f(t,["thinkingConfig"]);e!==void 0&&g!=null&&m(e,["setup","generationConfig","thinkingConfig"],g);let h=f(t,["enableAffectiveDialog"]);e!==void 0&&h!=null&&m(e,["setup","generationConfig","enableAffectiveDialog"],h);let v=f(t,["systemInstruction"]);e!==void 0&&v!=null&&m(e,["setup","systemInstruction"],w6(Ge(v)));let y=f(t,["tools"]);if(e!==void 0&&y!=null){let k=ci(y);Array.isArray(k)&&(k=k.map(V=>W6(li(V)))),m(e,["setup","tools"],k)}let _=f(t,["sessionResumption"]);e!==void 0&&_!=null&&m(e,["setup","sessionResumption"],_);let x=f(t,["inputAudioTranscription"]);e!==void 0&&x!=null&&m(e,["setup","inputAudioTranscription"],x);let E=f(t,["outputAudioTranscription"]);e!==void 0&&E!=null&&m(e,["setup","outputAudioTranscription"],E);let T=f(t,["realtimeInputConfig"]);e!==void 0&&T!=null&&m(e,["setup","realtimeInputConfig"],T);let S=f(t,["contextWindowCompression"]);e!==void 0&&S!=null&&m(e,["setup","contextWindowCompression"],S);let I=f(t,["proactivity"]);e!==void 0&&I!=null&&m(e,["setup","proactivity"],I);let w=f(t,["explicitVadSignal"]);e!==void 0&&w!=null&&m(e,["setup","explicitVadSignal"],w);let b=f(t,["avatarConfig"]);e!==void 0&&b!=null&&m(e,["setup","avatarConfig"],b);let B=f(t,["safetySettings"]);if(e!==void 0&&B!=null){let k=B;Array.isArray(k)&&(k=k.map(V=>V)),m(e,["setup","safetySettings"],k)}if(f(t,["translationConfig"])!==void 0)throw new Error("translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return n}a(O6,"liveConnectConfigToVertex");function L6(t,e){let n={},o=f(e,["model"]);o!=null&&m(n,["setup","model"],ue(t,o));let r=f(e,["config"]);return r!=null&&m(n,["config"],D6(r,n)),n}a(L6,"liveConnectParametersToMldev");function M6(t,e){let n={},o=f(e,["model"]);o!=null&&m(n,["setup","model"],ue(t,o));let r=f(e,["config"]);return r!=null&&m(n,["config"],O6(r,n)),n}a(M6,"liveConnectParametersToVertex");function U6(t){let e={},n=f(t,["musicGenerationConfig"]);return n!=null&&m(e,["musicGenerationConfig"],n),e}a(U6,"liveMusicSetConfigParametersToMldev");function F6(t){let e={},n=f(t,["weightedPrompts"]);if(n!=null){let o=n;Array.isArray(o)&&(o=o.map(r=>r)),m(e,["weightedPrompts"],o)}return e}a(F6,"liveMusicSetWeightedPromptsParametersToMldev");function z6(t){let e={},n=f(t,["media"]);if(n!=null){let l=y$(n);Array.isArray(l)&&(l=l.map(p=>bl(p))),m(e,["mediaChunks"],l)}let o=f(t,["audio"]);o!=null&&m(e,["audio"],bl(x$(o)));let r=f(t,["audioStreamEnd"]);r!=null&&m(e,["audioStreamEnd"],r);let i=f(t,["video"]);i!=null&&m(e,["video"],bl(_$(i)));let s=f(t,["text"]);s!=null&&m(e,["text"],s);let u=f(t,["activityStart"]);u!=null&&m(e,["activityStart"],u);let c=f(t,["activityEnd"]);return c!=null&&m(e,["activityEnd"],c),e}a(z6,"liveSendRealtimeInputParametersToMldev");function G6(t){let e={},n=f(t,["media"]);if(n!=null){let l=y$(n);Array.isArray(l)&&(l=l.map(p=>p)),m(e,["mediaChunks"],l)}let o=f(t,["audio"]);o!=null&&m(e,["audio"],x$(o));let r=f(t,["audioStreamEnd"]);r!=null&&m(e,["audioStreamEnd"],r);let i=f(t,["video"]);i!=null&&m(e,["video"],_$(i));let s=f(t,["text"]);s!=null&&m(e,["text"],s);let u=f(t,["activityStart"]);u!=null&&m(e,["activityStart"],u);let c=f(t,["activityEnd"]);return c!=null&&m(e,["activityEnd"],c),e}a(G6,"liveSendRealtimeInputParametersToVertex");function B6(t){let e={},n=f(t,["setupComplete"]);n!=null&&m(e,["setupComplete"],n);let o=f(t,["serverContent"]);o!=null&&m(e,["serverContent"],o);let r=f(t,["toolCall"]);r!=null&&m(e,["toolCall"],r);let i=f(t,["toolCallCancellation"]);i!=null&&m(e,["toolCallCancellation"],i);let s=f(t,["usageMetadata"]);s!=null&&m(e,["usageMetadata"],j6(s));let u=f(t,["goAway"]);u!=null&&m(e,["goAway"],u);let c=f(t,["sessionResumptionUpdate"]);c!=null&&m(e,["sessionResumptionUpdate"],c);let l=f(t,["voiceActivityDetectionSignal"]);l!=null&&m(e,["voiceActivityDetectionSignal"],l);let p=f(t,["voiceActivity"]);return p!=null&&m(e,["voiceActivity"],Y6(p)),e}a(B6,"liveServerMessageFromVertex");function q6(t){let e={};if(f(t,["name"])!==void 0)throw new Error("name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(f(t,["streamableHttpTransport"])!==void 0)throw new Error("streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}a(q6,"mcpServerToVertex$1");function V6(t){let e={},n=f(t,["mediaResolution"]);n!=null&&m(e,["mediaResolution"],n);let o=f(t,["codeExecutionResult"]);o!=null&&m(e,["codeExecutionResult"],o);let r=f(t,["executableCode"]);r!=null&&m(e,["executableCode"],r);let i=f(t,["fileData"]);i!=null&&m(e,["fileData"],R6(i));let s=f(t,["functionCall"]);s!=null&&m(e,["functionCall"],k6(s));let u=f(t,["functionResponse"]);u!=null&&m(e,["functionResponse"],u);let c=f(t,["inlineData"]);c!=null&&m(e,["inlineData"],bl(c));let l=f(t,["text"]);l!=null&&m(e,["text"],l);let p=f(t,["thought"]);p!=null&&m(e,["thought"],p);let d=f(t,["thoughtSignature"]);d!=null&&m(e,["thoughtSignature"],d);let g=f(t,["videoMetadata"]);g!=null&&m(e,["videoMetadata"],g);let h=f(t,["toolCall"]);h!=null&&m(e,["toolCall"],h);let v=f(t,["toolResponse"]);v!=null&&m(e,["toolResponse"],v);let y=f(t,["partMetadata"]);return y!=null&&m(e,["partMetadata"],y),e}a(V6,"partToMldev$2");function Z6(t){let e={},n=f(t,["mediaResolution"]);n!=null&&m(e,["mediaResolution"],n);let o=f(t,["codeExecutionResult"]);o!=null&&m(e,["codeExecutionResult"],I6(o));let r=f(t,["executableCode"]);r!=null&&m(e,["executableCode"],b6(r));let i=f(t,["fileData"]);i!=null&&m(e,["fileData"],i);let s=f(t,["functionCall"]);s!=null&&m(e,["functionCall"],s);let u=f(t,["functionResponse"]);u!=null&&m(e,["functionResponse"],u);let c=f(t,["inlineData"]);c!=null&&m(e,["inlineData"],c);let l=f(t,["text"]);l!=null&&m(e,["text"],l);let p=f(t,["thought"]);p!=null&&m(e,["thought"],p);let d=f(t,["thoughtSignature"]);d!=null&&m(e,["thoughtSignature"],d);let g=f(t,["videoMetadata"]);if(g!=null&&m(e,["videoMetadata"],g),f(t,["toolCall"])!==void 0)throw new Error("toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(f(t,["toolResponse"])!==void 0)throw new Error("toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(f(t,["partMetadata"])!==void 0)throw new Error("partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return e}a(Z6,"partToVertex$2");function H6(t){let e={},n=f(t,["category"]);if(n!=null&&m(e,["category"],n),f(t,["method"])!==void 0)throw new Error("method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=f(t,["threshold"]);return o!=null&&m(e,["threshold"],o),e}a(H6,"safetySettingToMldev$2");function J6(t){let e={},n=f(t,["handle"]);if(n!=null&&m(e,["handle"],n),f(t,["transparent"])!==void 0)throw new Error("transparent parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}a(J6,"sessionResumptionConfigToMldev$1");function K6(t){let e={};if(f(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=f(t,["computerUse"]);n!=null&&m(e,["computerUse"],n);let o=f(t,["fileSearch"]);o!=null&&m(e,["fileSearch"],o);let r=f(t,["googleSearch"]);r!=null&&m(e,["googleSearch"],$6(r));let i=f(t,["googleMaps"]);i!=null&&m(e,["googleMaps"],N6(i));let s=f(t,["codeExecution"]);if(s!=null&&m(e,["codeExecution"],s),f(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let u=f(t,["functionDeclarations"]);if(u!=null){let d=u;Array.isArray(d)&&(d=d.map(g=>g)),m(e,["functionDeclarations"],d)}let c=f(t,["googleSearchRetrieval"]);if(c!=null&&m(e,["googleSearchRetrieval"],c),f(t,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let l=f(t,["urlContext"]);l!=null&&m(e,["urlContext"],l);let p=f(t,["mcpServers"]);if(p!=null){let d=p;Array.isArray(d)&&(d=d.map(g=>g)),m(e,["mcpServers"],d)}return e}a(K6,"toolToMldev$2");function W6(t){let e={},n=f(t,["retrieval"]);n!=null&&m(e,["retrieval"],n);let o=f(t,["computerUse"]);if(o!=null&&m(e,["computerUse"],o),f(t,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");let r=f(t,["googleSearch"]);r!=null&&m(e,["googleSearch"],r);let i=f(t,["googleMaps"]);i!=null&&m(e,["googleMaps"],i);let s=f(t,["codeExecution"]);s!=null&&m(e,["codeExecution"],s);let u=f(t,["enterpriseWebSearch"]);u!=null&&m(e,["enterpriseWebSearch"],u);let c=f(t,["functionDeclarations"]);if(c!=null){let h=c;Array.isArray(h)&&(h=h.map(v=>v)),m(e,["functionDeclarations"],h)}let l=f(t,["googleSearchRetrieval"]);l!=null&&m(e,["googleSearchRetrieval"],l);let p=f(t,["parallelAiSearch"]);p!=null&&m(e,["parallelAiSearch"],p);let d=f(t,["urlContext"]);d!=null&&m(e,["urlContext"],d);let g=f(t,["mcpServers"]);if(g!=null){let h=g;Array.isArray(h)&&(h=h.map(v=>q6(v))),m(e,["mcpServers"],h)}return e}a(W6,"toolToVertex$1");function j6(t){let e={},n=f(t,["promptTokenCount"]);n!=null&&m(e,["promptTokenCount"],n);let o=f(t,["cachedContentTokenCount"]);o!=null&&m(e,["cachedContentTokenCount"],o);let r=f(t,["candidatesTokenCount"]);r!=null&&m(e,["responseTokenCount"],r);let i=f(t,["toolUsePromptTokenCount"]);i!=null&&m(e,["toolUsePromptTokenCount"],i);let s=f(t,["thoughtsTokenCount"]);s!=null&&m(e,["thoughtsTokenCount"],s);let u=f(t,["totalTokenCount"]);u!=null&&m(e,["totalTokenCount"],u);let c=f(t,["promptTokensDetails"]);if(c!=null){let h=c;Array.isArray(h)&&(h=h.map(v=>v)),m(e,["promptTokensDetails"],h)}let l=f(t,["cacheTokensDetails"]);if(l!=null){let h=l;Array.isArray(h)&&(h=h.map(v=>v)),m(e,["cacheTokensDetails"],h)}let p=f(t,["candidatesTokensDetails"]);if(p!=null){let h=p;Array.isArray(h)&&(h=h.map(v=>v)),m(e,["responseTokensDetails"],h)}let d=f(t,["toolUsePromptTokensDetails"]);if(d!=null){let h=d;Array.isArray(h)&&(h=h.map(v=>v)),m(e,["toolUsePromptTokensDetails"],h)}let g=f(t,["trafficType"]);return g!=null&&m(e,["trafficType"],g),e}a(j6,"usageMetadataFromVertex");function Y6(t){let e={},n=f(t,["type"]);n!=null&&m(e,["voiceActivityType"],n);let o=f(t,["audioOffset"]);return o!=null&&m(e,["audioOffset"],o),e}a(Y6,"voiceActivityFromVertex");function X6(t,e){let n={},o=f(t,["apiKey"]);if(o!=null&&m(n,["apiKey"],o),f(t,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["authType"])!==void 0)throw new Error("authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return n}a(X6,"authConfigToMldev$1");function Q6(t,e){let n={},o=f(t,["data"]);if(o!=null&&m(n,["data"],o),f(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=f(t,["mimeType"]);return r!=null&&m(n,["mimeType"],r),n}a(Q6,"blobToMldev$1");function eZ(t,e){let n={},o=f(t,["content"]);o!=null&&m(n,["content"],o);let r=f(t,["citationMetadata"]);r!=null&&m(n,["citationMetadata"],tZ(r));let i=f(t,["tokenCount"]);i!=null&&m(n,["tokenCount"],i);let s=f(t,["finishReason"]);s!=null&&m(n,["finishReason"],s);let u=f(t,["groundingMetadata"]);u!=null&&m(n,["groundingMetadata"],u);let c=f(t,["avgLogprobs"]);c!=null&&m(n,["avgLogprobs"],c);let l=f(t,["index"]);l!=null&&m(n,["index"],l);let p=f(t,["logprobsResult"]);p!=null&&m(n,["logprobsResult"],p);let d=f(t,["safetyRatings"]);if(d!=null){let h=d;Array.isArray(h)&&(h=h.map(v=>v)),m(n,["safetyRatings"],h)}let g=f(t,["urlContextMetadata"]);return g!=null&&m(n,["urlContextMetadata"],g),n}a(eZ,"candidateFromMldev");function tZ(t,e){let n={},o=f(t,["citationSources"]);if(o!=null){let r=o;Array.isArray(r)&&(r=r.map(i=>i)),m(n,["citations"],r)}return n}a(tZ,"citationMetadataFromMldev");function nZ(t,e){let n={},o=f(t,["outcome"]);o!=null&&m(n,["outcome"],o);let r=f(t,["output"]);if(r!=null&&m(n,["output"],r),f(t,["id"])!==void 0)throw new Error("id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return n}a(nZ,"codeExecutionResultToVertex$1");function rZ(t,e,n){let o={},r=f(e,["model"]);r!=null&&m(o,["_url","model"],ue(t,r));let i=f(e,["contents"]);if(i!=null){let s=yt(i);Array.isArray(s)&&(s=s.map(u=>fi(u))),m(o,["contents"],s)}return o}a(rZ,"computeTokensParametersToVertex");function oZ(t,e){let n={},o=f(t,["sdkHttpResponse"]);o!=null&&m(n,["sdkHttpResponse"],o);let r=f(t,["tokensInfo"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),m(n,["tokensInfo"],i)}return n}a(oZ,"computeTokensResponseFromVertex");function iZ(t,e){let n={},o=f(t,["values"]);o!=null&&m(n,["values"],o);let r=f(t,["statistics"]);return r!=null&&m(n,["statistics"],sZ(r)),n}a(iZ,"contentEmbeddingFromVertex");function sZ(t,e){let n={},o=f(t,["truncated"]);o!=null&&m(n,["truncated"],o);let r=f(t,["token_count"]);return r!=null&&m(n,["tokenCount"],r),n}a(sZ,"contentEmbeddingStatisticsFromVertex");function oa(t,e){let n={},o=f(t,["parts"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>hH(s))),m(n,["parts"],i)}let r=f(t,["role"]);return r!=null&&m(n,["role"],r),n}a(oa,"contentToMldev$1");function fi(t,e){let n={},o=f(t,["parts"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>vH(s))),m(n,["parts"],i)}let r=f(t,["role"]);return r!=null&&m(n,["role"],r),n}a(fi,"contentToVertex$1");function aZ(t,e){let n={},o=f(t,["controlType"]);o!=null&&m(n,["controlType"],o);let r=f(t,["enableControlImageComputation"]);return r!=null&&m(n,["computeControl"],r),n}a(aZ,"controlReferenceConfigToVertex");function uZ(t,e){let n={};if(f(t,["systemInstruction"])!==void 0)throw new Error("systemInstruction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["tools"])!==void 0)throw new Error("tools parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["generationConfig"])!==void 0)throw new Error("generationConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return n}a(uZ,"countTokensConfigToMldev");function lZ(t,e,n){let o={},r=f(t,["systemInstruction"]);e!==void 0&&r!=null&&m(e,["systemInstruction"],fi(Ge(r)));let i=f(t,["tools"]);if(e!==void 0&&i!=null){let u=i;Array.isArray(u)&&(u=u.map(c=>D$(c))),m(e,["tools"],u)}let s=f(t,["generationConfig"]);return e!==void 0&&s!=null&&m(e,["generationConfig"],eH(s)),o}a(lZ,"countTokensConfigToVertex");function cZ(t,e,n){let o={},r=f(e,["model"]);r!=null&&m(o,["_url","model"],ue(t,r));let i=f(e,["contents"]);if(i!=null){let u=yt(i);Array.isArray(u)&&(u=u.map(c=>oa(c))),m(o,["contents"],u)}let s=f(e,["config"]);return s!=null&&uZ(s),o}a(cZ,"countTokensParametersToMldev");function dZ(t,e,n){let o={},r=f(e,["model"]);r!=null&&m(o,["_url","model"],ue(t,r));let i=f(e,["contents"]);if(i!=null){let u=yt(i);Array.isArray(u)&&(u=u.map(c=>fi(c))),m(o,["contents"],u)}let s=f(e,["config"]);return s!=null&&lZ(s,o),o}a(dZ,"countTokensParametersToVertex");function fZ(t,e){let n={},o=f(t,["sdkHttpResponse"]);o!=null&&m(n,["sdkHttpResponse"],o);let r=f(t,["totalTokens"]);r!=null&&m(n,["totalTokens"],r);let i=f(t,["cachedContentTokenCount"]);return i!=null&&m(n,["cachedContentTokenCount"],i),n}a(fZ,"countTokensResponseFromMldev");function pZ(t,e){let n={},o=f(t,["sdkHttpResponse"]);o!=null&&m(n,["sdkHttpResponse"],o);let r=f(t,["totalTokens"]);return r!=null&&m(n,["totalTokens"],r),n}a(pZ,"countTokensResponseFromVertex");function mZ(t,e,n){let o={},r=f(e,["model"]);return r!=null&&m(o,["_url","name"],ue(t,r)),o}a(mZ,"deleteModelParametersToMldev");function gZ(t,e,n){let o={},r=f(e,["model"]);return r!=null&&m(o,["_url","name"],ue(t,r)),o}a(gZ,"deleteModelParametersToVertex");function hZ(t,e){let n={},o=f(t,["sdkHttpResponse"]);return o!=null&&m(n,["sdkHttpResponse"],o),n}a(hZ,"deleteModelResponseFromMldev");function vZ(t,e){let n={},o=f(t,["sdkHttpResponse"]);return o!=null&&m(n,["sdkHttpResponse"],o),n}a(vZ,"deleteModelResponseFromVertex");function yZ(t,e,n){let o={},r=f(t,["outputGcsUri"]);e!==void 0&&r!=null&&m(e,["parameters","storageUri"],r);let i=f(t,["negativePrompt"]);e!==void 0&&i!=null&&m(e,["parameters","negativePrompt"],i);let s=f(t,["numberOfImages"]);e!==void 0&&s!=null&&m(e,["parameters","sampleCount"],s);let u=f(t,["aspectRatio"]);e!==void 0&&u!=null&&m(e,["parameters","aspectRatio"],u);let c=f(t,["guidanceScale"]);e!==void 0&&c!=null&&m(e,["parameters","guidanceScale"],c);let l=f(t,["seed"]);e!==void 0&&l!=null&&m(e,["parameters","seed"],l);let p=f(t,["safetyFilterLevel"]);e!==void 0&&p!=null&&m(e,["parameters","safetySetting"],p);let d=f(t,["personGeneration"]);e!==void 0&&d!=null&&m(e,["parameters","personGeneration"],d);let g=f(t,["includeSafetyAttributes"]);e!==void 0&&g!=null&&m(e,["parameters","includeSafetyAttributes"],g);let h=f(t,["includeRaiReason"]);e!==void 0&&h!=null&&m(e,["parameters","includeRaiReason"],h);let v=f(t,["language"]);e!==void 0&&v!=null&&m(e,["parameters","language"],v);let y=f(t,["outputMimeType"]);e!==void 0&&y!=null&&m(e,["parameters","outputOptions","mimeType"],y);let _=f(t,["outputCompressionQuality"]);e!==void 0&&_!=null&&m(e,["parameters","outputOptions","compressionQuality"],_);let x=f(t,["addWatermark"]);e!==void 0&&x!=null&&m(e,["parameters","addWatermark"],x);let E=f(t,["labels"]);e!==void 0&&E!=null&&m(e,["labels"],E);let T=f(t,["editMode"]);e!==void 0&&T!=null&&m(e,["parameters","editMode"],T);let S=f(t,["baseSteps"]);return e!==void 0&&S!=null&&m(e,["parameters","editConfig","baseSteps"],S),o}a(yZ,"editImageConfigToVertex");function _Z(t,e,n){let o={},r=f(e,["model"]);r!=null&&m(o,["_url","model"],ue(t,r));let i=f(e,["prompt"]);i!=null&&m(o,["instances[0]","prompt"],i);let s=f(e,["referenceImages"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(l=>TH(l))),m(o,["instances[0]","referenceImages"],c)}let u=f(e,["config"]);return u!=null&&yZ(u,o),o}a(_Z,"editImageParametersInternalToVertex");function xZ(t,e){let n={},o=f(t,["sdkHttpResponse"]);o!=null&&m(n,["sdkHttpResponse"],o);let r=f(t,["predictions"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>lc(s))),m(n,["generatedImages"],i)}return n}a(xZ,"editImageResponseFromVertex");function EZ(t,e,n){let o={},r=f(t,["taskType"]);e!==void 0&&r!=null&&m(e,["requests[]","taskType"],r);let i=f(t,["title"]);e!==void 0&&i!=null&&m(e,["requests[]","title"],i);let s=f(t,["outputDimensionality"]);if(e!==void 0&&s!=null&&m(e,["requests[]","outputDimensionality"],s),f(t,["mimeType"])!==void 0)throw new Error("mimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["documentOcr"])!==void 0)throw new Error("documentOcr parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["audioTrackExtraction"])!==void 0)throw new Error("audioTrackExtraction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return o}a(EZ,"embedContentConfigToMldev");function SZ(t,e,n){let o={},r=f(n,["embeddingApiType"]);if(r===void 0&&(r="PREDICT"),r==="PREDICT"){let d=f(t,["taskType"]);e!==void 0&&d!=null&&m(e,["instances[]","task_type"],d)}else if(r==="EMBED_CONTENT"){let d=f(t,["taskType"]);e!==void 0&&d!=null&&m(e,["embedContentConfig","taskType"],d)}let i=f(n,["embeddingApiType"]);if(i===void 0&&(i="PREDICT"),i==="PREDICT"){let d=f(t,["title"]);e!==void 0&&d!=null&&m(e,["instances[]","title"],d)}else if(i==="EMBED_CONTENT"){let d=f(t,["title"]);e!==void 0&&d!=null&&m(e,["embedContentConfig","title"],d)}let s=f(n,["embeddingApiType"]);if(s===void 0&&(s="PREDICT"),s==="PREDICT"){let d=f(t,["outputDimensionality"]);e!==void 0&&d!=null&&m(e,["parameters","outputDimensionality"],d)}else if(s==="EMBED_CONTENT"){let d=f(t,["outputDimensionality"]);e!==void 0&&d!=null&&m(e,["embedContentConfig","outputDimensionality"],d)}let u=f(n,["embeddingApiType"]);if(u===void 0&&(u="PREDICT"),u==="PREDICT"){let d=f(t,["mimeType"]);e!==void 0&&d!=null&&m(e,["instances[]","mimeType"],d)}let c=f(n,["embeddingApiType"]);if(c===void 0&&(c="PREDICT"),c==="PREDICT"){let d=f(t,["autoTruncate"]);e!==void 0&&d!=null&&m(e,["parameters","autoTruncate"],d)}else if(c==="EMBED_CONTENT"){let d=f(t,["autoTruncate"]);e!==void 0&&d!=null&&m(e,["embedContentConfig","autoTruncate"],d)}let l=f(n,["embeddingApiType"]);if(l===void 0&&(l="PREDICT"),l==="EMBED_CONTENT"){let d=f(t,["documentOcr"]);e!==void 0&&d!=null&&m(e,["embedContentConfig","documentOcr"],d)}let p=f(n,["embeddingApiType"]);if(p===void 0&&(p="PREDICT"),p==="EMBED_CONTENT"){let d=f(t,["audioTrackExtraction"]);e!==void 0&&d!=null&&m(e,["embedContentConfig","audioTrackExtraction"],d)}return o}a(SZ,"embedContentConfigToVertex");function TZ(t,e,n){let o={},r=f(e,["model"]);r!=null&&m(o,["_url","model"],ue(t,r));let i=f(e,["contents"]);if(i!=null){let l=Og(t,i);Array.isArray(l)&&(l=l.map(p=>p)),m(o,["requests[]","content"],l)}let s=f(e,["content"]);s!=null&&oa(Ge(s));let u=f(e,["config"]);u!=null&&EZ(u,o);let c=f(e,["model"]);return c!==void 0&&m(o,["requests[]","model"],ue(t,c)),o}a(TZ,"embedContentParametersPrivateToMldev");function CZ(t,e,n){let o={},r=f(e,["model"]);r!=null&&m(o,["_url","model"],ue(t,r));let i=f(n,["embeddingApiType"]);if(i===void 0&&(i="PREDICT"),i==="PREDICT"){let c=f(e,["contents"]);if(c!=null){let l=Og(t,c);Array.isArray(l)&&(l=l.map(p=>p)),m(o,["instances[]","content"],l)}}let s=f(n,["embeddingApiType"]);if(s===void 0&&(s="PREDICT"),s==="EMBED_CONTENT"){let c=f(e,["content"]);c!=null&&m(o,["content"],fi(Ge(c)))}let u=f(e,["config"]);return u!=null&&SZ(u,o,n),o}a(CZ,"embedContentParametersPrivateToVertex");function IZ(t,e){let n={},o=f(t,["sdkHttpResponse"]);o!=null&&m(n,["sdkHttpResponse"],o);let r=f(t,["embeddings"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(u=>u)),m(n,["embeddings"],s)}let i=f(t,["metadata"]);return i!=null&&m(n,["metadata"],i),n}a(IZ,"embedContentResponseFromMldev");function AZ(t,e){let n={},o=f(t,["sdkHttpResponse"]);o!=null&&m(n,["sdkHttpResponse"],o);let r=f(t,["predictions[]","embeddings"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(u=>iZ(u))),m(n,["embeddings"],s)}let i=f(t,["metadata"]);if(i!=null&&m(n,["metadata"],i),e&&f(e,["embeddingApiType"])==="EMBED_CONTENT"){let s=f(t,["embedding"]),u=f(t,["usageMetadata"]),c=f(t,["truncated"]);if(s){let l={};u&&u.promptTokenCount&&(l.tokenCount=u.promptTokenCount),c&&(l.truncated=c),s.statistics=l,m(n,["embeddings"],[s])}}return n}a(AZ,"embedContentResponseFromVertex");function wZ(t,e){let n={},o=f(t,["endpoint"]);o!=null&&m(n,["name"],o);let r=f(t,["deployedModelId"]);return r!=null&&m(n,["deployedModelId"],r),n}a(wZ,"endpointFromVertex");function bZ(t,e){let n={},o=f(t,["code"]);o!=null&&m(n,["code"],o);let r=f(t,["language"]);if(r!=null&&m(n,["language"],r),f(t,["id"])!==void 0)throw new Error("id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return n}a(bZ,"executableCodeToVertex$1");function RZ(t,e){let n={};if(f(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=f(t,["fileUri"]);o!=null&&m(n,["fileUri"],o);let r=f(t,["mimeType"]);return r!=null&&m(n,["mimeType"],r),n}a(RZ,"fileDataToMldev$1");function kZ(t,e){let n={},o=f(t,["id"]);o!=null&&m(n,["id"],o);let r=f(t,["args"]);r!=null&&m(n,["args"],r);let i=f(t,["name"]);if(i!=null&&m(n,["name"],i),f(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return n}a(kZ,"functionCallToMldev$1");function PZ(t,e){let n={},o=f(t,["allowedFunctionNames"]);o!=null&&m(n,["allowedFunctionNames"],o);let r=f(t,["mode"]);if(r!=null&&m(n,["mode"],r),f(t,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return n}a(PZ,"functionCallingConfigToMldev");function NZ(t,e,n,o){let r={},i=f(e,["systemInstruction"]);n!==void 0&&i!=null&&m(n,["systemInstruction"],oa(Ge(i)));let s=f(e,["temperature"]);s!=null&&m(r,["temperature"],s);let u=f(e,["topP"]);u!=null&&m(r,["topP"],u);let c=f(e,["topK"]);c!=null&&m(r,["topK"],c);let l=f(e,["candidateCount"]);l!=null&&m(r,["candidateCount"],l);let p=f(e,["maxOutputTokens"]);p!=null&&m(r,["maxOutputTokens"],p);let d=f(e,["stopSequences"]);d!=null&&m(r,["stopSequences"],d);let g=f(e,["responseLogprobs"]);g!=null&&m(r,["responseLogprobs"],g);let h=f(e,["logprobs"]);h!=null&&m(r,["logprobs"],h);let v=f(e,["presencePenalty"]);v!=null&&m(r,["presencePenalty"],v);let y=f(e,["frequencyPenalty"]);y!=null&&m(r,["frequencyPenalty"],y);let _=f(e,["seed"]);_!=null&&m(r,["seed"],_);let x=f(e,["responseMimeType"]);x!=null&&m(r,["responseMimeType"],x);let E=f(e,["responseSchema"]);E!=null&&m(r,["responseSchema"],Lg(E));let T=f(e,["responseJsonSchema"]);if(T!=null&&m(r,["responseJsonSchema"],T),f(e,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(e,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let S=f(e,["safetySettings"]);if(n!==void 0&&S!=null){let O=S;Array.isArray(O)&&(O=O.map(X=>CH(X))),m(n,["safetySettings"],O)}let I=f(e,["tools"]);if(n!==void 0&&I!=null){let O=ci(I);Array.isArray(O)&&(O=O.map(X=>NH(li(X)))),m(n,["tools"],O)}let w=f(e,["toolConfig"]);if(n!==void 0&&w!=null&&m(n,["toolConfig"],kH(w)),f(e,["labels"])!==void 0)throw new Error("labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let b=f(e,["cachedContent"]);n!==void 0&&b!=null&&m(n,["cachedContent"],Gn(t,b));let B=f(e,["responseModalities"]);B!=null&&m(r,["responseModalities"],B);let k=f(e,["mediaResolution"]);k!=null&&m(r,["mediaResolution"],k);let V=f(e,["speechConfig"]);if(V!=null&&m(r,["speechConfig"],Mg(V)),f(e,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let ce=f(e,["thinkingConfig"]);ce!=null&&m(r,["thinkingConfig"],ce);let Ee=f(e,["imageConfig"]);Ee!=null&&m(r,["imageConfig"],iH(Ee));let Ne=f(e,["enableEnhancedCivicAnswers"]);if(Ne!=null&&m(r,["enableEnhancedCivicAnswers"],Ne),f(e,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let P=f(e,["serviceTier"]);return n!==void 0&&P!=null&&m(n,["serviceTier"],P),r}a(NZ,"generateContentConfigToMldev");function $Z(t,e,n,o){let r={},i=f(e,["systemInstruction"]);n!==void 0&&i!=null&&m(n,["systemInstruction"],fi(Ge(i)));let s=f(e,["temperature"]);s!=null&&m(r,["temperature"],s);let u=f(e,["topP"]);u!=null&&m(r,["topP"],u);let c=f(e,["topK"]);c!=null&&m(r,["topK"],c);let l=f(e,["candidateCount"]);l!=null&&m(r,["candidateCount"],l);let p=f(e,["maxOutputTokens"]);p!=null&&m(r,["maxOutputTokens"],p);let d=f(e,["stopSequences"]);d!=null&&m(r,["stopSequences"],d);let g=f(e,["responseLogprobs"]);g!=null&&m(r,["responseLogprobs"],g);let h=f(e,["logprobs"]);h!=null&&m(r,["logprobs"],h);let v=f(e,["presencePenalty"]);v!=null&&m(r,["presencePenalty"],v);let y=f(e,["frequencyPenalty"]);y!=null&&m(r,["frequencyPenalty"],y);let _=f(e,["seed"]);_!=null&&m(r,["seed"],_);let x=f(e,["responseMimeType"]);x!=null&&m(r,["responseMimeType"],x);let E=f(e,["responseSchema"]);E!=null&&m(r,["responseSchema"],Lg(E));let T=f(e,["responseJsonSchema"]);T!=null&&m(r,["responseJsonSchema"],T);let S=f(e,["routingConfig"]);S!=null&&m(r,["routingConfig"],S);let I=f(e,["modelSelectionConfig"]);I!=null&&m(r,["modelConfig"],I);let w=f(e,["safetySettings"]);if(n!==void 0&&w!=null){let de=w;Array.isArray(de)&&(de=de.map(Mt=>Mt)),m(n,["safetySettings"],de)}let b=f(e,["tools"]);if(n!==void 0&&b!=null){let de=ci(b);Array.isArray(de)&&(de=de.map(Mt=>D$(li(Mt)))),m(n,["tools"],de)}let B=f(e,["toolConfig"]);n!==void 0&&B!=null&&m(n,["toolConfig"],PH(B));let k=f(e,["labels"]);n!==void 0&&k!=null&&m(n,["labels"],k);let V=f(e,["cachedContent"]);n!==void 0&&V!=null&&m(n,["cachedContent"],Gn(t,V));let ce=f(e,["responseModalities"]);ce!=null&&m(r,["responseModalities"],ce);let Ee=f(e,["mediaResolution"]);Ee!=null&&m(r,["mediaResolution"],Ee);let Ne=f(e,["speechConfig"]);Ne!=null&&m(r,["speechConfig"],Mg(Ne));let P=f(e,["audioTimestamp"]);P!=null&&m(r,["audioTimestamp"],P);let O=f(e,["thinkingConfig"]);O!=null&&m(r,["thinkingConfig"],O);let X=f(e,["imageConfig"]);if(X!=null&&m(r,["imageConfig"],sH(X)),f(e,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");let Ae=f(e,["modelArmorConfig"]);n!==void 0&&Ae!=null&&m(n,["modelArmorConfig"],Ae);let we=f(e,["serviceTier"]);return n!==void 0&&we!=null&&m(n,["serviceTier"],we),r}a($Z,"generateContentConfigToVertex");function VN(t,e,n){let o={},r=f(e,["model"]);r!=null&&m(o,["_url","model"],ue(t,r));let i=f(e,["contents"]);if(i!=null){let u=yt(i);Array.isArray(u)&&(u=u.map(c=>oa(c))),m(o,["contents"],u)}let s=f(e,["config"]);return s!=null&&m(o,["generationConfig"],NZ(t,s,o)),o}a(VN,"generateContentParametersToMldev");function ZN(t,e,n){let o={},r=f(e,["model"]);r!=null&&m(o,["_url","model"],ue(t,r));let i=f(e,["contents"]);if(i!=null){let u=yt(i);Array.isArray(u)&&(u=u.map(c=>fi(c))),m(o,["contents"],u)}let s=f(e,["config"]);return s!=null&&m(o,["generationConfig"],$Z(t,s,o)),o}a(ZN,"generateContentParametersToVertex");function HN(t,e){let n={},o=f(t,["sdkHttpResponse"]);o!=null&&m(n,["sdkHttpResponse"],o);let r=f(t,["candidates"]);if(r!=null){let p=r;Array.isArray(p)&&(p=p.map(d=>eZ(d))),m(n,["candidates"],p)}let i=f(t,["modelVersion"]);i!=null&&m(n,["modelVersion"],i);let s=f(t,["promptFeedback"]);s!=null&&m(n,["promptFeedback"],s);let u=f(t,["responseId"]);u!=null&&m(n,["responseId"],u);let c=f(t,["usageMetadata"]);c!=null&&m(n,["usageMetadata"],c);let l=f(t,["modelStatus"]);return l!=null&&m(n,["modelStatus"],l),n}a(HN,"generateContentResponseFromMldev");function JN(t,e){let n={},o=f(t,["sdkHttpResponse"]);o!=null&&m(n,["sdkHttpResponse"],o);let r=f(t,["candidates"]);if(r!=null){let p=r;Array.isArray(p)&&(p=p.map(d=>d)),m(n,["candidates"],p)}let i=f(t,["createTime"]);i!=null&&m(n,["createTime"],i);let s=f(t,["modelVersion"]);s!=null&&m(n,["modelVersion"],s);let u=f(t,["promptFeedback"]);u!=null&&m(n,["promptFeedback"],u);let c=f(t,["responseId"]);c!=null&&m(n,["responseId"],c);let l=f(t,["usageMetadata"]);return l!=null&&m(n,["usageMetadata"],l),n}a(JN,"generateContentResponseFromVertex");function DZ(t,e,n){let o={};if(f(t,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["negativePrompt"])!==void 0)throw new Error("negativePrompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=f(t,["numberOfImages"]);e!==void 0&&r!=null&&m(e,["parameters","sampleCount"],r);let i=f(t,["aspectRatio"]);e!==void 0&&i!=null&&m(e,["parameters","aspectRatio"],i);let s=f(t,["guidanceScale"]);if(e!==void 0&&s!=null&&m(e,["parameters","guidanceScale"],s),f(t,["seed"])!==void 0)throw new Error("seed parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let u=f(t,["safetyFilterLevel"]);e!==void 0&&u!=null&&m(e,["parameters","safetySetting"],u);let c=f(t,["personGeneration"]);e!==void 0&&c!=null&&m(e,["parameters","personGeneration"],c);let l=f(t,["includeSafetyAttributes"]);e!==void 0&&l!=null&&m(e,["parameters","includeSafetyAttributes"],l);let p=f(t,["includeRaiReason"]);e!==void 0&&p!=null&&m(e,["parameters","includeRaiReason"],p);let d=f(t,["language"]);e!==void 0&&d!=null&&m(e,["parameters","language"],d);let g=f(t,["outputMimeType"]);e!==void 0&&g!=null&&m(e,["parameters","outputOptions","mimeType"],g);let h=f(t,["outputCompressionQuality"]);if(e!==void 0&&h!=null&&m(e,["parameters","outputOptions","compressionQuality"],h),f(t,["addWatermark"])!==void 0)throw new Error("addWatermark parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["labels"])!==void 0)throw new Error("labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let v=f(t,["imageSize"]);if(e!==void 0&&v!=null&&m(e,["parameters","sampleImageSize"],v),f(t,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return o}a(DZ,"generateImagesConfigToMldev");function OZ(t,e,n){let o={},r=f(t,["outputGcsUri"]);e!==void 0&&r!=null&&m(e,["parameters","storageUri"],r);let i=f(t,["negativePrompt"]);e!==void 0&&i!=null&&m(e,["parameters","negativePrompt"],i);let s=f(t,["numberOfImages"]);e!==void 0&&s!=null&&m(e,["parameters","sampleCount"],s);let u=f(t,["aspectRatio"]);e!==void 0&&u!=null&&m(e,["parameters","aspectRatio"],u);let c=f(t,["guidanceScale"]);e!==void 0&&c!=null&&m(e,["parameters","guidanceScale"],c);let l=f(t,["seed"]);e!==void 0&&l!=null&&m(e,["parameters","seed"],l);let p=f(t,["safetyFilterLevel"]);e!==void 0&&p!=null&&m(e,["parameters","safetySetting"],p);let d=f(t,["personGeneration"]);e!==void 0&&d!=null&&m(e,["parameters","personGeneration"],d);let g=f(t,["includeSafetyAttributes"]);e!==void 0&&g!=null&&m(e,["parameters","includeSafetyAttributes"],g);let h=f(t,["includeRaiReason"]);e!==void 0&&h!=null&&m(e,["parameters","includeRaiReason"],h);let v=f(t,["language"]);e!==void 0&&v!=null&&m(e,["parameters","language"],v);let y=f(t,["outputMimeType"]);e!==void 0&&y!=null&&m(e,["parameters","outputOptions","mimeType"],y);let _=f(t,["outputCompressionQuality"]);e!==void 0&&_!=null&&m(e,["parameters","outputOptions","compressionQuality"],_);let x=f(t,["addWatermark"]);e!==void 0&&x!=null&&m(e,["parameters","addWatermark"],x);let E=f(t,["labels"]);e!==void 0&&E!=null&&m(e,["labels"],E);let T=f(t,["imageSize"]);e!==void 0&&T!=null&&m(e,["parameters","sampleImageSize"],T);let S=f(t,["enhancePrompt"]);return e!==void 0&&S!=null&&m(e,["parameters","enhancePrompt"],S),o}a(OZ,"generateImagesConfigToVertex");function LZ(t,e,n){let o={},r=f(e,["model"]);r!=null&&m(o,["_url","model"],ue(t,r));let i=f(e,["prompt"]);i!=null&&m(o,["instances[0]","prompt"],i);let s=f(e,["config"]);return s!=null&&DZ(s,o),o}a(LZ,"generateImagesParametersToMldev");function MZ(t,e,n){let o={},r=f(e,["model"]);r!=null&&m(o,["_url","model"],ue(t,r));let i=f(e,["prompt"]);i!=null&&m(o,["instances[0]","prompt"],i);let s=f(e,["config"]);return s!=null&&OZ(s,o),o}a(MZ,"generateImagesParametersToVertex");function UZ(t,e){let n={},o=f(t,["sdkHttpResponse"]);o!=null&&m(n,["sdkHttpResponse"],o);let r=f(t,["predictions"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(u=>jZ(u))),m(n,["generatedImages"],s)}let i=f(t,["positivePromptSafetyAttributes"]);return i!=null&&m(n,["positivePromptSafetyAttributes"],N$(i)),n}a(UZ,"generateImagesResponseFromMldev");function FZ(t,e){let n={},o=f(t,["sdkHttpResponse"]);o!=null&&m(n,["sdkHttpResponse"],o);let r=f(t,["predictions"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(u=>lc(u))),m(n,["generatedImages"],s)}let i=f(t,["positivePromptSafetyAttributes"]);return i!=null&&m(n,["positivePromptSafetyAttributes"],$$(i)),n}a(FZ,"generateImagesResponseFromVertex");function zZ(t,e,n){let o={},r=f(t,["numberOfVideos"]);if(e!==void 0&&r!=null&&m(e,["parameters","sampleCount"],r),f(t,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["fps"])!==void 0)throw new Error("fps parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let i=f(t,["durationSeconds"]);if(e!==void 0&&i!=null&&m(e,["parameters","durationSeconds"],i),f(t,["seed"])!==void 0)throw new Error("seed parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let s=f(t,["aspectRatio"]);e!==void 0&&s!=null&&m(e,["parameters","aspectRatio"],s);let u=f(t,["resolution"]);e!==void 0&&u!=null&&m(e,["parameters","resolution"],u);let c=f(t,["personGeneration"]);if(e!==void 0&&c!=null&&m(e,["parameters","personGeneration"],c),f(t,["pubsubTopic"])!==void 0)throw new Error("pubsubTopic parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let l=f(t,["negativePrompt"]);e!==void 0&&l!=null&&m(e,["parameters","negativePrompt"],l);let p=f(t,["enhancePrompt"]);if(e!==void 0&&p!=null&&m(e,["parameters","enhancePrompt"],p),f(t,["generateAudio"])!==void 0)throw new Error("generateAudio parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let d=f(t,["lastFrame"]);e!==void 0&&d!=null&&m(e,["instances[0]","lastFrame"],cc(d));let g=f(t,["referenceImages"]);if(e!==void 0&&g!=null){let v=g;Array.isArray(v)&&(v=v.map(y=>ZH(y))),m(e,["instances[0]","referenceImages"],v)}if(f(t,["mask"])!==void 0)throw new Error("mask parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["compressionQuality"])!==void 0)throw new Error("compressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["labels"])!==void 0)throw new Error("labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let h=f(t,["webhookConfig"]);if(e!==void 0&&h!=null&&m(e,["webhookConfig"],h),f(t,["resizeMode"])!==void 0)throw new Error("resizeMode parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return o}a(zZ,"generateVideosConfigToMldev");function GZ(t,e,n){let o={},r=f(t,["numberOfVideos"]);e!==void 0&&r!=null&&m(e,["parameters","sampleCount"],r);let i=f(t,["outputGcsUri"]);e!==void 0&&i!=null&&m(e,["parameters","storageUri"],i);let s=f(t,["fps"]);e!==void 0&&s!=null&&m(e,["parameters","fps"],s);let u=f(t,["durationSeconds"]);e!==void 0&&u!=null&&m(e,["parameters","durationSeconds"],u);let c=f(t,["seed"]);e!==void 0&&c!=null&&m(e,["parameters","seed"],c);let l=f(t,["aspectRatio"]);e!==void 0&&l!=null&&m(e,["parameters","aspectRatio"],l);let p=f(t,["resolution"]);e!==void 0&&p!=null&&m(e,["parameters","resolution"],p);let d=f(t,["personGeneration"]);e!==void 0&&d!=null&&m(e,["parameters","personGeneration"],d);let g=f(t,["pubsubTopic"]);e!==void 0&&g!=null&&m(e,["parameters","pubsubTopic"],g);let h=f(t,["negativePrompt"]);e!==void 0&&h!=null&&m(e,["parameters","negativePrompt"],h);let v=f(t,["enhancePrompt"]);e!==void 0&&v!=null&&m(e,["parameters","enhancePrompt"],v);let y=f(t,["generateAudio"]);e!==void 0&&y!=null&&m(e,["parameters","generateAudio"],y);let _=f(t,["lastFrame"]);e!==void 0&&_!=null&&m(e,["instances[0]","lastFrame"],tn(_));let x=f(t,["referenceImages"]);if(e!==void 0&&x!=null){let w=x;Array.isArray(w)&&(w=w.map(b=>HH(b))),m(e,["instances[0]","referenceImages"],w)}let E=f(t,["mask"]);e!==void 0&&E!=null&&m(e,["instances[0]","mask"],VH(E));let T=f(t,["compressionQuality"]);e!==void 0&&T!=null&&m(e,["parameters","compressionQuality"],T);let S=f(t,["labels"]);if(e!==void 0&&S!=null&&m(e,["labels"],S),f(t,["webhookConfig"])!==void 0)throw new Error("webhookConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");let I=f(t,["resizeMode"]);return e!==void 0&&I!=null&&m(e,["parameters","resizeMode"],I),o}a(GZ,"generateVideosConfigToVertex");function BZ(t,e){let n={},o=f(t,["name"]);o!=null&&m(n,["name"],o);let r=f(t,["metadata"]);r!=null&&m(n,["metadata"],r);let i=f(t,["done"]);i!=null&&m(n,["done"],i);let s=f(t,["error"]);s!=null&&m(n,["error"],s);let u=f(t,["response","generateVideoResponse"]);return u!=null&&m(n,["response"],HZ(u)),n}a(BZ,"generateVideosOperationFromMldev");function qZ(t,e){let n={},o=f(t,["name"]);o!=null&&m(n,["name"],o);let r=f(t,["metadata"]);r!=null&&m(n,["metadata"],r);let i=f(t,["done"]);i!=null&&m(n,["done"],i);let s=f(t,["error"]);s!=null&&m(n,["error"],s);let u=f(t,["response"]);return u!=null&&m(n,["response"],JZ(u)),n}a(qZ,"generateVideosOperationFromVertex");function VZ(t,e,n){let o={},r=f(e,["model"]);r!=null&&m(o,["_url","model"],ue(t,r));let i=f(e,["prompt"]);i!=null&&m(o,["instances[0]","prompt"],i);let s=f(e,["image"]);s!=null&&m(o,["instances[0]","image"],cc(s));let u=f(e,["video"]);u!=null&&m(o,["instances[0]","video"],O$(u));let c=f(e,["source"]);c!=null&&KZ(c,o);let l=f(e,["config"]);return l!=null&&zZ(l,o),o}a(VZ,"generateVideosParametersToMldev");function ZZ(t,e,n){let o={},r=f(e,["model"]);r!=null&&m(o,["_url","model"],ue(t,r));let i=f(e,["prompt"]);i!=null&&m(o,["instances[0]","prompt"],i);let s=f(e,["image"]);s!=null&&m(o,["instances[0]","image"],tn(s));let u=f(e,["video"]);u!=null&&m(o,["instances[0]","video"],L$(u));let c=f(e,["source"]);c!=null&&WZ(c,o);let l=f(e,["config"]);return l!=null&&GZ(l,o),o}a(ZZ,"generateVideosParametersToVertex");function HZ(t,e){let n={},o=f(t,["generatedSamples"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(u=>XZ(u))),m(n,["generatedVideos"],s)}let r=f(t,["raiMediaFilteredCount"]);r!=null&&m(n,["raiMediaFilteredCount"],r);let i=f(t,["raiMediaFilteredReasons"]);return i!=null&&m(n,["raiMediaFilteredReasons"],i),n}a(HZ,"generateVideosResponseFromMldev");function JZ(t,e){let n={},o=f(t,["videos"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(u=>QZ(u))),m(n,["generatedVideos"],s)}let r=f(t,["raiMediaFilteredCount"]);r!=null&&m(n,["raiMediaFilteredCount"],r);let i=f(t,["raiMediaFilteredReasons"]);return i!=null&&m(n,["raiMediaFilteredReasons"],i),n}a(JZ,"generateVideosResponseFromVertex");function KZ(t,e,n){let o={},r=f(t,["prompt"]);e!==void 0&&r!=null&&m(e,["instances[0]","prompt"],r);let i=f(t,["image"]);e!==void 0&&i!=null&&m(e,["instances[0]","image"],cc(i));let s=f(t,["video"]);return e!==void 0&&s!=null&&m(e,["instances[0]","video"],O$(s)),o}a(KZ,"generateVideosSourceToMldev");function WZ(t,e,n){let o={},r=f(t,["prompt"]);e!==void 0&&r!=null&&m(e,["instances[0]","prompt"],r);let i=f(t,["image"]);e!==void 0&&i!=null&&m(e,["instances[0]","image"],tn(i));let s=f(t,["video"]);return e!==void 0&&s!=null&&m(e,["instances[0]","video"],L$(s)),o}a(WZ,"generateVideosSourceToVertex");function jZ(t,e){let n={},o=f(t,["_self"]);o!=null&&m(n,["image"],aH(o));let r=f(t,["raiFilteredReason"]);r!=null&&m(n,["raiFilteredReason"],r);let i=f(t,["_self"]);return i!=null&&m(n,["safetyAttributes"],N$(i)),n}a(jZ,"generatedImageFromMldev");function lc(t,e){let n={},o=f(t,["_self"]);o!=null&&m(n,["image"],P$(o));let r=f(t,["raiFilteredReason"]);r!=null&&m(n,["raiFilteredReason"],r);let i=f(t,["_self"]);i!=null&&m(n,["safetyAttributes"],$$(i));let s=f(t,["prompt"]);return s!=null&&m(n,["enhancedPrompt"],s),n}a(lc,"generatedImageFromVertex");function YZ(t,e){let n={},o=f(t,["_self"]);o!=null&&m(n,["mask"],P$(o));let r=f(t,["labels"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),m(n,["labels"],i)}return n}a(YZ,"generatedImageMaskFromVertex");function XZ(t,e){let n={},o=f(t,["video"]);return o!=null&&m(n,["video"],BH(o)),n}a(XZ,"generatedVideoFromMldev");function QZ(t,e){let n={},o=f(t,["_self"]);return o!=null&&m(n,["video"],qH(o)),n}a(QZ,"generatedVideoFromVertex");function eH(t,e){let n={},o=f(t,["modelSelectionConfig"]);o!=null&&m(n,["modelConfig"],o);let r=f(t,["responseJsonSchema"]);r!=null&&m(n,["responseJsonSchema"],r);let i=f(t,["audioTimestamp"]);i!=null&&m(n,["audioTimestamp"],i);let s=f(t,["candidateCount"]);s!=null&&m(n,["candidateCount"],s);let u=f(t,["enableAffectiveDialog"]);u!=null&&m(n,["enableAffectiveDialog"],u);let c=f(t,["frequencyPenalty"]);c!=null&&m(n,["frequencyPenalty"],c);let l=f(t,["logprobs"]);l!=null&&m(n,["logprobs"],l);let p=f(t,["maxOutputTokens"]);p!=null&&m(n,["maxOutputTokens"],p);let d=f(t,["mediaResolution"]);d!=null&&m(n,["mediaResolution"],d);let g=f(t,["presencePenalty"]);g!=null&&m(n,["presencePenalty"],g);let h=f(t,["responseLogprobs"]);h!=null&&m(n,["responseLogprobs"],h);let v=f(t,["responseMimeType"]);v!=null&&m(n,["responseMimeType"],v);let y=f(t,["responseModalities"]);y!=null&&m(n,["responseModalities"],y);let _=f(t,["responseSchema"]);_!=null&&m(n,["responseSchema"],_);let x=f(t,["routingConfig"]);x!=null&&m(n,["routingConfig"],x);let E=f(t,["seed"]);E!=null&&m(n,["seed"],E);let T=f(t,["speechConfig"]);T!=null&&m(n,["speechConfig"],T);let S=f(t,["stopSequences"]);S!=null&&m(n,["stopSequences"],S);let I=f(t,["temperature"]);I!=null&&m(n,["temperature"],I);let w=f(t,["thinkingConfig"]);w!=null&&m(n,["thinkingConfig"],w);let b=f(t,["topK"]);b!=null&&m(n,["topK"],b);let B=f(t,["topP"]);if(B!=null&&m(n,["topP"],B),f(t,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return n}a(eH,"generationConfigToVertex");function tH(t,e,n){let o={},r=f(e,["model"]);return r!=null&&m(o,["_url","name"],ue(t,r)),o}a(tH,"getModelParametersToMldev");function nH(t,e,n){let o={},r=f(e,["model"]);return r!=null&&m(o,["_url","name"],ue(t,r)),o}a(nH,"getModelParametersToVertex");function rH(t,e){let n={},o=f(t,["authConfig"]);o!=null&&m(n,["authConfig"],X6(o));let r=f(t,["enableWidget"]);return r!=null&&m(n,["enableWidget"],r),n}a(rH,"googleMapsToMldev$1");function oH(t,e){let n={},o=f(t,["searchTypes"]);if(o!=null&&m(n,["searchTypes"],o),f(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=f(t,["timeRangeFilter"]);return r!=null&&m(n,["timeRangeFilter"],r),n}a(oH,"googleSearchToMldev$1");function iH(t,e){let n={},o=f(t,["aspectRatio"]);o!=null&&m(n,["aspectRatio"],o);let r=f(t,["imageSize"]);if(r!=null&&m(n,["imageSize"],r),f(t,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["prominentPeople"])!==void 0)throw new Error("prominentPeople parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["imageOutputOptions"])!==void 0)throw new Error("imageOutputOptions parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return n}a(iH,"imageConfigToMldev");function sH(t,e){let n={},o=f(t,["aspectRatio"]);o!=null&&m(n,["aspectRatio"],o);let r=f(t,["imageSize"]);r!=null&&m(n,["imageSize"],r);let i=f(t,["personGeneration"]);i!=null&&m(n,["personGeneration"],i);let s=f(t,["prominentPeople"]);s!=null&&m(n,["prominentPeople"],s);let u=f(t,["outputMimeType"]);u!=null&&m(n,["imageOutputOptions","mimeType"],u);let c=f(t,["outputCompressionQuality"]);c!=null&&m(n,["imageOutputOptions","compressionQuality"],c);let l=f(t,["imageOutputOptions"]);return l!=null&&m(n,["imageOutputOptions"],l),n}a(sH,"imageConfigToVertex");function aH(t,e){let n={},o=f(t,["bytesBase64Encoded"]);o!=null&&m(n,["imageBytes"],pr(o));let r=f(t,["mimeType"]);return r!=null&&m(n,["mimeType"],r),n}a(aH,"imageFromMldev");function P$(t,e){let n={},o=f(t,["gcsUri"]);o!=null&&m(n,["gcsUri"],o);let r=f(t,["bytesBase64Encoded"]);r!=null&&m(n,["imageBytes"],pr(r));let i=f(t,["mimeType"]);return i!=null&&m(n,["mimeType"],i),n}a(P$,"imageFromVertex");function cc(t,e){let n={};if(f(t,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=f(t,["imageBytes"]);o!=null&&m(n,["bytesBase64Encoded"],pr(o));let r=f(t,["mimeType"]);return r!=null&&m(n,["mimeType"],r),n}a(cc,"imageToMldev");function tn(t,e){let n={},o=f(t,["gcsUri"]);o!=null&&m(n,["gcsUri"],o);let r=f(t,["imageBytes"]);r!=null&&m(n,["bytesBase64Encoded"],pr(r));let i=f(t,["mimeType"]);return i!=null&&m(n,["mimeType"],i),n}a(tn,"imageToVertex");function uH(t,e,n,o){let r={},i=f(e,["pageSize"]);n!==void 0&&i!=null&&m(n,["_query","pageSize"],i);let s=f(e,["pageToken"]);n!==void 0&&s!=null&&m(n,["_query","pageToken"],s);let u=f(e,["filter"]);n!==void 0&&u!=null&&m(n,["_query","filter"],u);let c=f(e,["queryBase"]);return n!==void 0&&c!=null&&m(n,["_url","models_url"],C$(t,c)),r}a(uH,"listModelsConfigToMldev");function lH(t,e,n,o){let r={},i=f(e,["pageSize"]);n!==void 0&&i!=null&&m(n,["_query","pageSize"],i);let s=f(e,["pageToken"]);n!==void 0&&s!=null&&m(n,["_query","pageToken"],s);let u=f(e,["filter"]);n!==void 0&&u!=null&&m(n,["_query","filter"],u);let c=f(e,["queryBase"]);return n!==void 0&&c!=null&&m(n,["_url","models_url"],C$(t,c)),r}a(lH,"listModelsConfigToVertex");function cH(t,e,n){let o={},r=f(e,["config"]);return r!=null&&uH(t,r,o),o}a(cH,"listModelsParametersToMldev");function dH(t,e,n){let o={},r=f(e,["config"]);return r!=null&&lH(t,r,o),o}a(dH,"listModelsParametersToVertex");function fH(t,e){let n={},o=f(t,["sdkHttpResponse"]);o!=null&&m(n,["sdkHttpResponse"],o);let r=f(t,["nextPageToken"]);r!=null&&m(n,["nextPageToken"],r);let i=f(t,["_self"]);if(i!=null){let s=I$(i);Array.isArray(s)&&(s=s.map(u=>Om(u))),m(n,["models"],s)}return n}a(fH,"listModelsResponseFromMldev");function pH(t,e){let n={},o=f(t,["sdkHttpResponse"]);o!=null&&m(n,["sdkHttpResponse"],o);let r=f(t,["nextPageToken"]);r!=null&&m(n,["nextPageToken"],r);let i=f(t,["_self"]);if(i!=null){let s=I$(i);Array.isArray(s)&&(s=s.map(u=>Lm(u))),m(n,["models"],s)}return n}a(pH,"listModelsResponseFromVertex");function mH(t,e){let n={},o=f(t,["maskMode"]);o!=null&&m(n,["maskMode"],o);let r=f(t,["segmentationClasses"]);r!=null&&m(n,["maskClasses"],r);let i=f(t,["maskDilation"]);return i!=null&&m(n,["dilation"],i),n}a(mH,"maskReferenceConfigToVertex");function gH(t,e){let n={};if(f(t,["name"])!==void 0)throw new Error("name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(f(t,["streamableHttpTransport"])!==void 0)throw new Error("streamableHttpTransport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return n}a(gH,"mcpServerToVertex");function Om(t,e){let n={},o=f(t,["name"]);o!=null&&m(n,["name"],o);let r=f(t,["displayName"]);r!=null&&m(n,["displayName"],r);let i=f(t,["description"]);i!=null&&m(n,["description"],i);let s=f(t,["version"]);s!=null&&m(n,["version"],s);let u=f(t,["_self"]);u!=null&&m(n,["tunedModelInfo"],$H(u));let c=f(t,["inputTokenLimit"]);c!=null&&m(n,["inputTokenLimit"],c);let l=f(t,["outputTokenLimit"]);l!=null&&m(n,["outputTokenLimit"],l);let p=f(t,["supportedGenerationMethods"]);p!=null&&m(n,["supportedActions"],p);let d=f(t,["temperature"]);d!=null&&m(n,["temperature"],d);let g=f(t,["maxTemperature"]);g!=null&&m(n,["maxTemperature"],g);let h=f(t,["topP"]);h!=null&&m(n,["topP"],h);let v=f(t,["topK"]);v!=null&&m(n,["topK"],v);let y=f(t,["thinking"]);return y!=null&&m(n,["thinking"],y),n}a(Om,"modelFromMldev");function Lm(t,e){let n={},o=f(t,["name"]);o!=null&&m(n,["name"],o);let r=f(t,["displayName"]);r!=null&&m(n,["displayName"],r);let i=f(t,["description"]);i!=null&&m(n,["description"],i);let s=f(t,["versionId"]);s!=null&&m(n,["version"],s);let u=f(t,["deployedModels"]);if(u!=null){let g=u;Array.isArray(g)&&(g=g.map(h=>wZ(h))),m(n,["endpoints"],g)}let c=f(t,["labels"]);c!=null&&m(n,["labels"],c);let l=f(t,["_self"]);l!=null&&m(n,["tunedModelInfo"],DH(l));let p=f(t,["defaultCheckpointId"]);p!=null&&m(n,["defaultCheckpointId"],p);let d=f(t,["checkpoints"]);if(d!=null){let g=d;Array.isArray(g)&&(g=g.map(h=>h)),m(n,["checkpoints"],g)}return n}a(Lm,"modelFromVertex");function hH(t,e){let n={},o=f(t,["mediaResolution"]);o!=null&&m(n,["mediaResolution"],o);let r=f(t,["codeExecutionResult"]);r!=null&&m(n,["codeExecutionResult"],r);let i=f(t,["executableCode"]);i!=null&&m(n,["executableCode"],i);let s=f(t,["fileData"]);s!=null&&m(n,["fileData"],RZ(s));let u=f(t,["functionCall"]);u!=null&&m(n,["functionCall"],kZ(u));let c=f(t,["functionResponse"]);c!=null&&m(n,["functionResponse"],c);let l=f(t,["inlineData"]);l!=null&&m(n,["inlineData"],Q6(l));let p=f(t,["text"]);p!=null&&m(n,["text"],p);let d=f(t,["thought"]);d!=null&&m(n,["thought"],d);let g=f(t,["thoughtSignature"]);g!=null&&m(n,["thoughtSignature"],g);let h=f(t,["videoMetadata"]);h!=null&&m(n,["videoMetadata"],h);let v=f(t,["toolCall"]);v!=null&&m(n,["toolCall"],v);let y=f(t,["toolResponse"]);y!=null&&m(n,["toolResponse"],y);let _=f(t,["partMetadata"]);return _!=null&&m(n,["partMetadata"],_),n}a(hH,"partToMldev$1");function vH(t,e){let n={},o=f(t,["mediaResolution"]);o!=null&&m(n,["mediaResolution"],o);let r=f(t,["codeExecutionResult"]);r!=null&&m(n,["codeExecutionResult"],nZ(r));let i=f(t,["executableCode"]);i!=null&&m(n,["executableCode"],bZ(i));let s=f(t,["fileData"]);s!=null&&m(n,["fileData"],s);let u=f(t,["functionCall"]);u!=null&&m(n,["functionCall"],u);let c=f(t,["functionResponse"]);c!=null&&m(n,["functionResponse"],c);let l=f(t,["inlineData"]);l!=null&&m(n,["inlineData"],l);let p=f(t,["text"]);p!=null&&m(n,["text"],p);let d=f(t,["thought"]);d!=null&&m(n,["thought"],d);let g=f(t,["thoughtSignature"]);g!=null&&m(n,["thoughtSignature"],g);let h=f(t,["videoMetadata"]);if(h!=null&&m(n,["videoMetadata"],h),f(t,["toolCall"])!==void 0)throw new Error("toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(f(t,["toolResponse"])!==void 0)throw new Error("toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(f(t,["partMetadata"])!==void 0)throw new Error("partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return n}a(vH,"partToVertex$1");function yH(t,e){let n={},o=f(t,["productImage"]);return o!=null&&m(n,["image"],tn(o)),n}a(yH,"productImageToVertex");function _H(t,e,n){let o={},r=f(t,["numberOfImages"]);e!==void 0&&r!=null&&m(e,["parameters","sampleCount"],r);let i=f(t,["baseSteps"]);e!==void 0&&i!=null&&m(e,["parameters","baseSteps"],i);let s=f(t,["outputGcsUri"]);e!==void 0&&s!=null&&m(e,["parameters","storageUri"],s);let u=f(t,["seed"]);e!==void 0&&u!=null&&m(e,["parameters","seed"],u);let c=f(t,["safetyFilterLevel"]);e!==void 0&&c!=null&&m(e,["parameters","safetySetting"],c);let l=f(t,["personGeneration"]);e!==void 0&&l!=null&&m(e,["parameters","personGeneration"],l);let p=f(t,["addWatermark"]);e!==void 0&&p!=null&&m(e,["parameters","addWatermark"],p);let d=f(t,["outputMimeType"]);e!==void 0&&d!=null&&m(e,["parameters","outputOptions","mimeType"],d);let g=f(t,["outputCompressionQuality"]);e!==void 0&&g!=null&&m(e,["parameters","outputOptions","compressionQuality"],g);let h=f(t,["enhancePrompt"]);e!==void 0&&h!=null&&m(e,["parameters","enhancePrompt"],h);let v=f(t,["labels"]);return e!==void 0&&v!=null&&m(e,["labels"],v),o}a(_H,"recontextImageConfigToVertex");function xH(t,e,n){let o={},r=f(e,["model"]);r!=null&&m(o,["_url","model"],ue(t,r));let i=f(e,["source"]);i!=null&&SH(i,o);let s=f(e,["config"]);return s!=null&&_H(s,o),o}a(xH,"recontextImageParametersToVertex");function EH(t,e){let n={},o=f(t,["predictions"]);if(o!=null){let r=o;Array.isArray(r)&&(r=r.map(i=>lc(i))),m(n,["generatedImages"],r)}return n}a(EH,"recontextImageResponseFromVertex");function SH(t,e,n){let o={},r=f(t,["prompt"]);e!==void 0&&r!=null&&m(e,["instances[0]","prompt"],r);let i=f(t,["personImage"]);e!==void 0&&i!=null&&m(e,["instances[0]","personImage","image"],tn(i));let s=f(t,["productImages"]);if(e!==void 0&&s!=null){let u=s;Array.isArray(u)&&(u=u.map(c=>yH(c))),m(e,["instances[0]","productImages"],u)}return o}a(SH,"recontextImageSourceToVertex");function TH(t,e){let n={},o=f(t,["referenceImage"]);o!=null&&m(n,["referenceImage"],tn(o));let r=f(t,["referenceId"]);r!=null&&m(n,["referenceId"],r);let i=f(t,["referenceType"]);i!=null&&m(n,["referenceType"],i);let s=f(t,["maskImageConfig"]);s!=null&&m(n,["maskImageConfig"],mH(s));let u=f(t,["controlImageConfig"]);u!=null&&m(n,["controlImageConfig"],aZ(u));let c=f(t,["styleImageConfig"]);c!=null&&m(n,["styleImageConfig"],c);let l=f(t,["subjectImageConfig"]);return l!=null&&m(n,["subjectImageConfig"],l),n}a(TH,"referenceImageAPIInternalToVertex");function N$(t,e){let n={},o=f(t,["safetyAttributes","categories"]);o!=null&&m(n,["categories"],o);let r=f(t,["safetyAttributes","scores"]);r!=null&&m(n,["scores"],r);let i=f(t,["contentType"]);return i!=null&&m(n,["contentType"],i),n}a(N$,"safetyAttributesFromMldev");function $$(t,e){let n={},o=f(t,["safetyAttributes","categories"]);o!=null&&m(n,["categories"],o);let r=f(t,["safetyAttributes","scores"]);r!=null&&m(n,["scores"],r);let i=f(t,["contentType"]);return i!=null&&m(n,["contentType"],i),n}a($$,"safetyAttributesFromVertex");function CH(t,e){let n={},o=f(t,["category"]);if(o!=null&&m(n,["category"],o),f(t,["method"])!==void 0)throw new Error("method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=f(t,["threshold"]);return r!=null&&m(n,["threshold"],r),n}a(CH,"safetySettingToMldev$1");function IH(t,e){let n={},o=f(t,["image"]);return o!=null&&m(n,["image"],tn(o)),n}a(IH,"scribbleImageToVertex");function AH(t,e,n){let o={},r=f(t,["mode"]);e!==void 0&&r!=null&&m(e,["parameters","mode"],r);let i=f(t,["maxPredictions"]);e!==void 0&&i!=null&&m(e,["parameters","maxPredictions"],i);let s=f(t,["confidenceThreshold"]);e!==void 0&&s!=null&&m(e,["parameters","confidenceThreshold"],s);let u=f(t,["maskDilation"]);e!==void 0&&u!=null&&m(e,["parameters","maskDilation"],u);let c=f(t,["binaryColorThreshold"]);e!==void 0&&c!=null&&m(e,["parameters","binaryColorThreshold"],c);let l=f(t,["labels"]);return e!==void 0&&l!=null&&m(e,["labels"],l),o}a(AH,"segmentImageConfigToVertex");function wH(t,e,n){let o={},r=f(e,["model"]);r!=null&&m(o,["_url","model"],ue(t,r));let i=f(e,["source"]);i!=null&&RH(i,o);let s=f(e,["config"]);return s!=null&&AH(s,o),o}a(wH,"segmentImageParametersToVertex");function bH(t,e){let n={},o=f(t,["predictions"]);if(o!=null){let r=o;Array.isArray(r)&&(r=r.map(i=>YZ(i))),m(n,["generatedMasks"],r)}return n}a(bH,"segmentImageResponseFromVertex");function RH(t,e,n){let o={},r=f(t,["prompt"]);e!==void 0&&r!=null&&m(e,["instances[0]","prompt"],r);let i=f(t,["image"]);e!==void 0&&i!=null&&m(e,["instances[0]","image"],tn(i));let s=f(t,["scribbleImage"]);return e!==void 0&&s!=null&&m(e,["instances[0]","scribble"],IH(s)),o}a(RH,"segmentImageSourceToVertex");function kH(t,e){let n={},o=f(t,["retrievalConfig"]);o!=null&&m(n,["retrievalConfig"],o);let r=f(t,["functionCallingConfig"]);r!=null&&m(n,["functionCallingConfig"],PZ(r));let i=f(t,["includeServerSideToolInvocations"]);return i!=null&&m(n,["includeServerSideToolInvocations"],i),n}a(kH,"toolConfigToMldev");function PH(t,e){let n={},o=f(t,["retrievalConfig"]);o!=null&&m(n,["retrievalConfig"],o);let r=f(t,["functionCallingConfig"]);if(r!=null&&m(n,["functionCallingConfig"],r),f(t,["includeServerSideToolInvocations"])!==void 0)throw new Error("includeServerSideToolInvocations parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return n}a(PH,"toolConfigToVertex");function NH(t,e){let n={};if(f(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=f(t,["computerUse"]);o!=null&&m(n,["computerUse"],o);let r=f(t,["fileSearch"]);r!=null&&m(n,["fileSearch"],r);let i=f(t,["googleSearch"]);i!=null&&m(n,["googleSearch"],oH(i));let s=f(t,["googleMaps"]);s!=null&&m(n,["googleMaps"],rH(s));let u=f(t,["codeExecution"]);if(u!=null&&m(n,["codeExecution"],u),f(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let c=f(t,["functionDeclarations"]);if(c!=null){let g=c;Array.isArray(g)&&(g=g.map(h=>h)),m(n,["functionDeclarations"],g)}let l=f(t,["googleSearchRetrieval"]);if(l!=null&&m(n,["googleSearchRetrieval"],l),f(t,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let p=f(t,["urlContext"]);p!=null&&m(n,["urlContext"],p);let d=f(t,["mcpServers"]);if(d!=null){let g=d;Array.isArray(g)&&(g=g.map(h=>h)),m(n,["mcpServers"],g)}return n}a(NH,"toolToMldev$1");function D$(t,e){let n={},o=f(t,["retrieval"]);o!=null&&m(n,["retrieval"],o);let r=f(t,["computerUse"]);if(r!=null&&m(n,["computerUse"],r),f(t,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");let i=f(t,["googleSearch"]);i!=null&&m(n,["googleSearch"],i);let s=f(t,["googleMaps"]);s!=null&&m(n,["googleMaps"],s);let u=f(t,["codeExecution"]);u!=null&&m(n,["codeExecution"],u);let c=f(t,["enterpriseWebSearch"]);c!=null&&m(n,["enterpriseWebSearch"],c);let l=f(t,["functionDeclarations"]);if(l!=null){let v=l;Array.isArray(v)&&(v=v.map(y=>y)),m(n,["functionDeclarations"],v)}let p=f(t,["googleSearchRetrieval"]);p!=null&&m(n,["googleSearchRetrieval"],p);let d=f(t,["parallelAiSearch"]);d!=null&&m(n,["parallelAiSearch"],d);let g=f(t,["urlContext"]);g!=null&&m(n,["urlContext"],g);let h=f(t,["mcpServers"]);if(h!=null){let v=h;Array.isArray(v)&&(v=v.map(y=>gH(y))),m(n,["mcpServers"],v)}return n}a(D$,"toolToVertex");function $H(t,e){let n={},o=f(t,["baseModel"]);o!=null&&m(n,["baseModel"],o);let r=f(t,["createTime"]);r!=null&&m(n,["createTime"],r);let i=f(t,["updateTime"]);return i!=null&&m(n,["updateTime"],i),n}a($H,"tunedModelInfoFromMldev");function DH(t,e){let n={},o=f(t,["labels","google-vertex-llm-tuning-base-model-id"]);o!=null&&m(n,["baseModel"],o);let r=f(t,["createTime"]);r!=null&&m(n,["createTime"],r);let i=f(t,["updateTime"]);return i!=null&&m(n,["updateTime"],i),n}a(DH,"tunedModelInfoFromVertex");function OH(t,e,n){let o={},r=f(t,["displayName"]);e!==void 0&&r!=null&&m(e,["displayName"],r);let i=f(t,["description"]);e!==void 0&&i!=null&&m(e,["description"],i);let s=f(t,["defaultCheckpointId"]);return e!==void 0&&s!=null&&m(e,["defaultCheckpointId"],s),o}a(OH,"updateModelConfigToMldev");function LH(t,e,n){let o={},r=f(t,["displayName"]);e!==void 0&&r!=null&&m(e,["displayName"],r);let i=f(t,["description"]);e!==void 0&&i!=null&&m(e,["description"],i);let s=f(t,["defaultCheckpointId"]);return e!==void 0&&s!=null&&m(e,["defaultCheckpointId"],s),o}a(LH,"updateModelConfigToVertex");function MH(t,e,n){let o={},r=f(e,["model"]);r!=null&&m(o,["_url","name"],ue(t,r));let i=f(e,["config"]);return i!=null&&OH(i,o),o}a(MH,"updateModelParametersToMldev");function UH(t,e,n){let o={},r=f(e,["model"]);r!=null&&m(o,["_url","model"],ue(t,r));let i=f(e,["config"]);return i!=null&&LH(i,o),o}a(UH,"updateModelParametersToVertex");function FH(t,e,n){let o={},r=f(t,["outputGcsUri"]);e!==void 0&&r!=null&&m(e,["parameters","storageUri"],r);let i=f(t,["safetyFilterLevel"]);e!==void 0&&i!=null&&m(e,["parameters","safetySetting"],i);let s=f(t,["personGeneration"]);e!==void 0&&s!=null&&m(e,["parameters","personGeneration"],s);let u=f(t,["includeRaiReason"]);e!==void 0&&u!=null&&m(e,["parameters","includeRaiReason"],u);let c=f(t,["outputMimeType"]);e!==void 0&&c!=null&&m(e,["parameters","outputOptions","mimeType"],c);let l=f(t,["outputCompressionQuality"]);e!==void 0&&l!=null&&m(e,["parameters","outputOptions","compressionQuality"],l);let p=f(t,["enhanceInputImage"]);e!==void 0&&p!=null&&m(e,["parameters","upscaleConfig","enhanceInputImage"],p);let d=f(t,["imagePreservationFactor"]);e!==void 0&&d!=null&&m(e,["parameters","upscaleConfig","imagePreservationFactor"],d);let g=f(t,["labels"]);e!==void 0&&g!=null&&m(e,["labels"],g);let h=f(t,["numberOfImages"]);e!==void 0&&h!=null&&m(e,["parameters","sampleCount"],h);let v=f(t,["mode"]);return e!==void 0&&v!=null&&m(e,["parameters","mode"],v),o}a(FH,"upscaleImageAPIConfigInternalToVertex");function zH(t,e,n){let o={},r=f(e,["model"]);r!=null&&m(o,["_url","model"],ue(t,r));let i=f(e,["image"]);i!=null&&m(o,["instances[0]","image"],tn(i));let s=f(e,["upscaleFactor"]);s!=null&&m(o,["parameters","upscaleConfig","upscaleFactor"],s);let u=f(e,["config"]);return u!=null&&FH(u,o),o}a(zH,"upscaleImageAPIParametersInternalToVertex");function GH(t,e){let n={},o=f(t,["sdkHttpResponse"]);o!=null&&m(n,["sdkHttpResponse"],o);let r=f(t,["predictions"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>lc(s))),m(n,["generatedImages"],i)}return n}a(GH,"upscaleImageResponseFromVertex");function BH(t,e){let n={},o=f(t,["uri"]);o!=null&&m(n,["uri"],o);let r=f(t,["encodedVideo"]);r!=null&&m(n,["videoBytes"],pr(r));let i=f(t,["encoding"]);return i!=null&&m(n,["mimeType"],i),n}a(BH,"videoFromMldev");function qH(t,e){let n={},o=f(t,["gcsUri"]);o!=null&&m(n,["uri"],o);let r=f(t,["bytesBase64Encoded"]);r!=null&&m(n,["videoBytes"],pr(r));let i=f(t,["mimeType"]);return i!=null&&m(n,["mimeType"],i),n}a(qH,"videoFromVertex");function VH(t,e){let n={},o=f(t,["image"]);o!=null&&m(n,["_self"],tn(o));let r=f(t,["maskMode"]);return r!=null&&m(n,["maskMode"],r),n}a(VH,"videoGenerationMaskToVertex");function ZH(t,e){let n={},o=f(t,["image"]);o!=null&&m(n,["image"],cc(o));let r=f(t,["referenceType"]);return r!=null&&m(n,["referenceType"],r),n}a(ZH,"videoGenerationReferenceImageToMldev");function HH(t,e){let n={},o=f(t,["image"]);o!=null&&m(n,["image"],tn(o));let r=f(t,["referenceType"]);return r!=null&&m(n,["referenceType"],r),n}a(HH,"videoGenerationReferenceImageToVertex");function O$(t,e){let n={},o=f(t,["uri"]);o!=null&&m(n,["uri"],o);let r=f(t,["videoBytes"]);r!=null&&m(n,["encodedVideo"],pr(r));let i=f(t,["mimeType"]);return i!=null&&m(n,["encoding"],i),n}a(O$,"videoToMldev");function L$(t,e){let n={},o=f(t,["uri"]);o!=null&&m(n,["gcsUri"],o);let r=f(t,["videoBytes"]);r!=null&&m(n,["bytesBase64Encoded"],pr(r));let i=f(t,["mimeType"]);return i!=null&&m(n,["mimeType"],i),n}a(L$,"videoToVertex");function JH(t,e,n){let o={},r=f(e,["displayName"]);n!==void 0&&r!=null&&m(n,["displayName"],r);let i=f(e,["embeddingModel"]);return n!==void 0&&i!=null&&m(n,["embeddingModel"],ue(t,i)),o}a(JH,"createFileSearchStoreConfigToMldev");function KH(t,e){let n={},o=f(e,["config"]);return o!=null&&JH(t,o,n),n}a(KH,"createFileSearchStoreParametersToMldev");function WH(t,e){let n={},o=f(t,["force"]);return e!==void 0&&o!=null&&m(e,["_query","force"],o),n}a(WH,"deleteFileSearchStoreConfigToMldev");function jH(t){let e={},n=f(t,["name"]);n!=null&&m(e,["_url","name"],n);let o=f(t,["config"]);return o!=null&&WH(o,e),e}a(jH,"deleteFileSearchStoreParametersToMldev");function YH(t){let e={},n=f(t,["name"]);return n!=null&&m(e,["_url","name"],n),e}a(YH,"getFileSearchStoreParametersToMldev");function XH(t,e){let n={},o=f(t,["customMetadata"]);if(e!==void 0&&o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>s)),m(e,["customMetadata"],i)}let r=f(t,["chunkingConfig"]);return e!==void 0&&r!=null&&m(e,["chunkingConfig"],r),n}a(XH,"importFileConfigToMldev");function QH(t){let e={},n=f(t,["name"]);n!=null&&m(e,["name"],n);let o=f(t,["metadata"]);o!=null&&m(e,["metadata"],o);let r=f(t,["done"]);r!=null&&m(e,["done"],r);let i=f(t,["error"]);i!=null&&m(e,["error"],i);let s=f(t,["response"]);return s!=null&&m(e,["response"],t2(s)),e}a(QH,"importFileOperationFromMldev");function e2(t){let e={},n=f(t,["fileSearchStoreName"]);n!=null&&m(e,["_url","file_search_store_name"],n);let o=f(t,["fileName"]);o!=null&&m(e,["fileName"],o);let r=f(t,["config"]);return r!=null&&XH(r,e),e}a(e2,"importFileParametersToMldev");function t2(t){let e={},n=f(t,["sdkHttpResponse"]);n!=null&&m(e,["sdkHttpResponse"],n);let o=f(t,["parent"]);o!=null&&m(e,["parent"],o);let r=f(t,["documentName"]);return r!=null&&m(e,["documentName"],r),e}a(t2,"importFileResponseFromMldev");function n2(t,e){let n={},o=f(t,["pageSize"]);e!==void 0&&o!=null&&m(e,["_query","pageSize"],o);let r=f(t,["pageToken"]);return e!==void 0&&r!=null&&m(e,["_query","pageToken"],r),n}a(n2,"listFileSearchStoresConfigToMldev");function r2(t){let e={},n=f(t,["config"]);return n!=null&&n2(n,e),e}a(r2,"listFileSearchStoresParametersToMldev");function o2(t){let e={},n=f(t,["sdkHttpResponse"]);n!=null&&m(e,["sdkHttpResponse"],n);let o=f(t,["nextPageToken"]);o!=null&&m(e,["nextPageToken"],o);let r=f(t,["fileSearchStores"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),m(e,["fileSearchStores"],i)}return e}a(o2,"listFileSearchStoresResponseFromMldev");function M$(t,e){let n={},o=f(t,["mimeType"]);e!==void 0&&o!=null&&m(e,["mimeType"],o);let r=f(t,["displayName"]);e!==void 0&&r!=null&&m(e,["displayName"],r);let i=f(t,["customMetadata"]);if(e!==void 0&&i!=null){let u=i;Array.isArray(u)&&(u=u.map(c=>c)),m(e,["customMetadata"],u)}let s=f(t,["chunkingConfig"]);return e!==void 0&&s!=null&&m(e,["chunkingConfig"],s),n}a(M$,"uploadToFileSearchStoreConfigToMldev");function i2(t){let e={},n=f(t,["fileSearchStoreName"]);n!=null&&m(e,["_url","file_search_store_name"],n);let o=f(t,["config"]);return o!=null&&M$(o,e),e}a(i2,"uploadToFileSearchStoreParametersToMldev");function s2(t){let e={},n=f(t,["sdkHttpResponse"]);return n!=null&&m(e,["sdkHttpResponse"],n),e}a(s2,"uploadToFileSearchStoreResumableResponseFromMldev");var a2="Content-Type",u2="X-Server-Timeout",l2="User-Agent",Mm="x-goog-api-client",c2="2.9.0",d2=`google-genai-sdk/${c2}`,f2="v1beta1",p2="v1beta",m2=new Set(["us","eu"]),g2=5,h2=[408,429,500,502,503,504],xh=class xh{constructor(e){var n,o,r;this.clientOptions=Object.assign({},e),this.customBaseUrl=(n=e.httpOptions)===null||n===void 0?void 0:n.baseUrl,this.clientOptions.vertexai&&(this.clientOptions.project&&this.clientOptions.location?this.clientOptions.apiKey=void 0:this.clientOptions.apiKey&&(this.clientOptions.project=void 0,this.clientOptions.location=void 0));let i={};if(this.clientOptions.vertexai){if(!this.clientOptions.location&&!this.clientOptions.apiKey&&!this.customBaseUrl&&(this.clientOptions.location="global"),!(this.clientOptions.project&&this.clientOptions.location||this.clientOptions.apiKey)&&!this.customBaseUrl)throw new Error("Authentication is not set up. Please provide either a project and location, or an API key, or a custom base URL.");let u=e.project&&e.location||!!e.apiKey;this.customBaseUrl&&!u?(i.baseUrl=this.customBaseUrl,this.clientOptions.project=void 0,this.clientOptions.location=void 0):this.clientOptions.apiKey||this.clientOptions.location==="global"?i.baseUrl="https://aiplatform.googleapis.com/":this.clientOptions.project&&this.clientOptions.location&&m2.has(this.clientOptions.location)?i.baseUrl=`https://aiplatform.${this.clientOptions.location}.rep.googleapis.com/`:this.clientOptions.project&&this.clientOptions.location&&(i.baseUrl=`https://${this.clientOptions.location}-aiplatform.googleapis.com/`),i.apiVersion=(o=this.clientOptions.apiVersion)!==null&&o!==void 0?o:f2}else this.clientOptions.apiKey||console.warn("API key should be set when using the Gemini API."),i.apiVersion=(r=this.clientOptions.apiVersion)!==null&&r!==void 0?r:p2,i.baseUrl="https://generativelanguage.googleapis.com/";i.headers=this.getDefaultHeaders(),this.clientOptions.httpOptions=i,e.httpOptions&&(this.clientOptions.httpOptions=this.patchHttpOptions(i,e.httpOptions))}isVertexAI(){var e;return(e=this.clientOptions.vertexai)!==null&&e!==void 0?e:!1}getProject(){return this.clientOptions.project}getLocation(){return this.clientOptions.location}getCustomBaseUrl(){return this.customBaseUrl}async getAuthHeaders(){let e=new Headers;return await this.clientOptions.auth.addAuthHeaders(e),e}getApiVersion(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.apiVersion!==void 0)return this.clientOptions.httpOptions.apiVersion;throw new Error("API version is not set.")}getBaseUrl(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.baseUrl!==void 0)return this.clientOptions.httpOptions.baseUrl;throw new Error("Base URL is not set.")}getRequestUrl(){return this.getRequestUrlInternal(this.clientOptions.httpOptions)}getHeaders(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.headers!==void 0)return this.clientOptions.httpOptions.headers;throw new Error("Headers are not set.")}getRequestUrlInternal(e){if(!e||e.baseUrl===void 0||e.apiVersion===void 0)throw new Error("HTTP options are not correctly set.");let o=[e.baseUrl.endsWith("/")?e.baseUrl.slice(0,-1):e.baseUrl];return e.apiVersion&&e.apiVersion!==""&&o.push(e.apiVersion),o.join("/")}getBaseResourcePath(){return`projects/${this.clientOptions.project}/locations/${this.clientOptions.location}`}getApiKey(){return this.clientOptions.apiKey}getWebsocketBaseUrl(){let e=this.getBaseUrl(),n=new URL(e);return n.protocol=n.protocol=="http:"?"ws":"wss",n.toString()}setBaseUrl(e){if(this.clientOptions.httpOptions)this.clientOptions.httpOptions.baseUrl=e;else throw new Error("HTTP options are not correctly set.")}constructUrl(e,n,o){let r=[this.getRequestUrlInternal(n)];return o&&r.push(this.getBaseResourcePath()),e!==""&&r.push(e),new URL(`${r.join("/")}`)}shouldPrependVertexProjectPath(e,n){return!(n.baseUrl&&n.baseUrlResourceScope===lm.COLLECTION||this.clientOptions.apiKey||!this.clientOptions.vertexai||e.path.startsWith("projects/")||e.httpMethod==="GET"&&e.path.startsWith("publishers/google/models"))}async request(e){let n=this.clientOptions.httpOptions;e.httpOptions&&(n=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));let o=this.shouldPrependVertexProjectPath(e,n),r=this.constructUrl(e.path,n,o);if(e.queryParams)for(let[s,u]of Object.entries(e.queryParams))r.searchParams.append(s,String(u));let i={};if(e.httpMethod==="GET"){if(e.body&&e.body!=="{}")throw new Error("Request body should be empty for GET request, but got non empty request body")}else i.body=e.body;return i=await this.includeExtraHttpOptionsToRequestInit(i,n,r.toString(),e.abortSignal),this.unaryApiCall(r,i,e.httpMethod)}patchHttpOptions(e,n){let o=JSON.parse(JSON.stringify(e));for(let[r,i]of Object.entries(n))typeof i=="object"?o[r]=Object.assign(Object.assign({},o[r]),i):i!==void 0&&(o[r]=i);return o}async requestStream(e){let n=this.clientOptions.httpOptions;e.httpOptions&&(n=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));let o=this.shouldPrependVertexProjectPath(e,n),r=this.constructUrl(e.path,n,o);(!r.searchParams.has("alt")||r.searchParams.get("alt")!=="sse")&&r.searchParams.set("alt","sse");let i={};return i.body=e.body,i=await this.includeExtraHttpOptionsToRequestInit(i,n,r.toString(),e.abortSignal),this.streamApiCall(r,i,e.httpMethod)}async includeExtraHttpOptionsToRequestInit(e,n,o,r){if(n&&n.timeout||r){let i=new AbortController,s=i.signal;if(n.timeout&&(n==null?void 0:n.timeout)>0){let c=globalThis[Symbol.for("undici.globalDispatcher.1")];if(c){let p=Object.getOwnPropertySymbols(c);for(let d of p){let g=d.description;if(g!=null&&g.includes("headers timeout")||g!=null&&g.includes("body timeout")){let h=c[d];typeof h=="number"&&(c[d]=Math.max(h,n.timeout))}}}let l=setTimeout(()=>i.abort(),n.timeout);l&&typeof l.unref=="function"&&l.unref()}r&&r.addEventListener("abort",()=>{i.abort()}),e.signal=s}return n&&n.extraBody!==null&&v2(e,n.extraBody),e.headers=await this.getHeadersInternal(n,o),e}async unaryApiCall(e,n,o){return this.apiCall(e.toString(),Object.assign(Object.assign({},n),{method:o})).then(async r=>(await KN(r),new ii(r))).catch(r=>{throw r instanceof Error?r:new Error(`exception ${r} sending request`,{cause:r})})}async streamApiCall(e,n,o){return this.apiCall(e.toString(),Object.assign(Object.assign({},n),{method:o})).then(async r=>(await KN(r),this.processStreamResponse(r))).catch(r=>{throw r instanceof Error?r:new Error(`exception ${r} sending request`,{cause:r})})}processStreamResponse(e){return ti(this,arguments,a(function*(){var o;let r=(o=e==null?void 0:e.body)===null||o===void 0?void 0:o.getReader(),i=new TextDecoder("utf-8");if(!r)throw new Error("Response body is empty");try{let s="",u="data:",c=[`
8
+
9
+ `,"\r\r",`\r
10
+ \r
11
+ `];for(;;){let{done:l,value:p}=yield Te(r.read());if(l){if(s.trim().length>0)throw new Error("Incomplete JSON segment at the end");break}let d=i.decode(p,{stream:!0});try{let v=JSON.parse(d);if("error"in v){let y=JSON.parse(JSON.stringify(v.error)),_=y.status,x=y.code,E=`got status: ${_}. ${JSON.stringify(v)}`;if(x>=400&&x<600)throw new Bl({message:E,status:x})}}catch(v){if(v.name==="ApiError")throw v}s+=d;let g=-1,h=0;for(;;){g=-1,h=0;for(let _ of c){let x=s.indexOf(_);x!==-1&&(g===-1||x<g)&&(g=x,h=_.length)}if(g===-1)break;let v=s.substring(0,g);s=s.substring(g+h);let y=v.trim();if(y.startsWith(u)){let _=y.substring(u.length).trim();try{let x=new Response(_,{headers:e==null?void 0:e.headers,status:e==null?void 0:e.status,statusText:e==null?void 0:e.statusText});yield yield Te(new ii(x))}catch(x){throw new Error(`exception parsing stream chunk ${_}. ${x}`)}}}}}finally{r.releaseLock()}},"processStreamResponse_1"))}async apiCall(e,n){var o;if(!this.clientOptions.httpOptions||!this.clientOptions.httpOptions.retryOptions)return fetch(e,n);let r=this.clientOptions.httpOptions.retryOptions;return(0,ac.default)(a(async()=>{let s=await fetch(e,n);if(s.ok)return s;throw h2.includes(s.status)?new Error(`Retryable HTTP Error: ${s.statusText}`):new ac.AbortError(`Non-retryable exception ${s.statusText} sending request`)},"runFetch"),{retries:((o=r.attempts)!==null&&o!==void 0?o:g2)-1})}getDefaultHeaders(){let e={},n=d2+" "+this.clientOptions.userAgentExtra;return e[l2]=n,e[Mm]=n,e[a2]="application/json",e}async getHeadersInternal(e,n){let o=new Headers;if(e&&e.headers)for(let[r,i]of Object.entries(e.headers))o.append(r,i);return e!=null&&e.timeout&&e.timeout>0&&o.append(u2,String(Math.ceil(e.timeout/1e3))),await this.clientOptions.auth.addAuthHeaders(o,n),o}getFileName(e){var n;let o="";return typeof e=="string"&&(o=e.replace(/[/\\]+$/,""),o=(n=o.split(/[/\\]/).pop())!==null&&n!==void 0?n:""),o}async uploadFile(e,n){var o;let r={};n!=null&&(r.mimeType=n.mimeType,r.name=n.name,r.displayName=n.displayName),r.name&&!r.name.startsWith("files/")&&(r.name=`files/${r.name}`);let i=this.clientOptions.uploader,s=await i.stat(e);r.sizeBytes=String(s.size);let u=(o=n==null?void 0:n.mimeType)!==null&&o!==void 0?o:s.type;if(u===void 0||u==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");r.mimeType=u;let c={file:r},l=this.getFileName(e),p=q("upload/v1beta/files",c._url),d=await this.fetchUploadUrl(p,r.sizeBytes,r.mimeType,l,c,n==null?void 0:n.httpOptions);return i.upload(e,d,this)}async uploadFileToFileSearchStore(e,n,o){var r;let i=this.clientOptions.uploader,s=await i.stat(n),u=String(s.size),c=(r=o==null?void 0:o.mimeType)!==null&&r!==void 0?r:s.type;if(c===void 0||c==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");let l=`upload/v1beta/${e}:uploadToFileSearchStore`,p=this.getFileName(n),d={};o!=null&&M$(o,d);let g=await this.fetchUploadUrl(l,u,c,p,d,o==null?void 0:o.httpOptions);return i.uploadToFileSearchStore(n,g,this)}async downloadFile(e){await this.clientOptions.downloader.download(e,this)}async fetchUploadUrl(e,n,o,r,i,s){var u;let c={};s?c=s:c={apiVersion:"",headers:Object.assign({"Content-Type":"application/json","X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${n}`,"X-Goog-Upload-Header-Content-Type":`${o}`},r?{"X-Goog-Upload-File-Name":r}:{})};let l=await this.request({path:e,body:JSON.stringify(i),httpMethod:"POST",httpOptions:c});if(!l||!(l!=null&&l.headers))throw new Error("Server did not return an HttpResponse or the returned HttpResponse did not have headers.");let p=(u=l==null?void 0:l.headers)===null||u===void 0?void 0:u["x-goog-upload-url"];if(p===void 0)throw new Error("Failed to get upload url. Server did not return the x-google-upload-url in the headers");return p}};a(xh,"ApiClient");var Um=xh;async function KN(t){var e;if(t===void 0)throw new Error("response is undefined");if(!t.ok){let n=t.status,o;!((e=t.headers.get("content-type"))===null||e===void 0)&&e.includes("application/json")?o=await t.json():o={error:{message:await t.text(),code:t.status,status:t.statusText}};let r=JSON.stringify(o);throw n>=400&&n<600?new Bl({message:r,status:n}):new Error(r)}}a(KN,"throwErrorIfNotOK");function v2(t,e){if(!e||Object.keys(e).length===0)return;if(t.body instanceof Blob){console.warn("includeExtraBodyToRequestInit: extraBody provided but current request body is a Blob. extraBody will be ignored as merging is not supported for Blob bodies.");return}let n={};if(typeof t.body=="string"&&t.body.length>0)try{let i=JSON.parse(t.body);if(typeof i=="object"&&i!==null&&!Array.isArray(i))n=i;else{console.warn("includeExtraBodyToRequestInit: Original request body is valid JSON but not a non-array object. Skip applying extraBody to the request body.");return}}catch(i){console.warn("includeExtraBodyToRequestInit: Original request body is not valid JSON. Skip applying extraBody to the request body.");return}function o(i,s){let u=Object.assign({},i);for(let c in s)if(Object.prototype.hasOwnProperty.call(s,c)){let l=s[c],p=u[c];l&&typeof l=="object"&&!Array.isArray(l)&&p&&typeof p=="object"&&!Array.isArray(p)?u[c]=o(p,l):(p&&l&&typeof p!=typeof l&&console.warn(`includeExtraBodyToRequestInit:deepMerge: Type mismatch for key "${c}". Original type: ${typeof p}, New type: ${typeof l}. Overwriting.`),u[c]=l)}return u}a(o,"deepMerge");let r=o(n,e);t.body=JSON.stringify(r)}a(v2,"includeExtraBodyToRequestInit");var y2="mcp_used/unknown",_2=!1;function U$(t){for(let e of t)if(x2(e)||typeof e=="object"&&"inputSchema"in e)return!0;return _2}a(U$,"hasMcpToolUsage");function F$(t){var e;let n=(e=t[Mm])!==null&&e!==void 0?e:"";t[Mm]=(n+` ${y2}`).trimStart()}a(F$,"setMcpUsageHeader");function x2(t){return t!==null&&typeof t=="object"&&t instanceof Fm}a(x2,"isMcpCallableTool");function E2(t){return ti(this,arguments,a(function*(n,o=100){let r,i=0;for(;i<o;){let s=yield Te(n.listTools({cursor:r}));for(let u of s.tools)yield yield Te(u),i++;if(!s.nextCursor)break;r=s.nextCursor}},"listAllTools_1"))}a(E2,"listAllTools");var nc=class nc{constructor(e=[],n){this.mcpTools=[],this.functionNameToMcpClient={},this.mcpClients=e,this.config=n}static create(e,n){return new nc(e,n)}async initialize(){var e,n,o,r;if(this.mcpTools.length>0)return;let i={},s=[];for(let p of this.mcpClients)try{for(var u=!0,c=(n=void 0,Qs(E2(p))),l;l=await c.next(),e=l.done,!e;u=!0){r=l.value,u=!1;let d=r;s.push(d);let g=d.name;if(i[g])throw new Error(`Duplicate function name ${g} found in MCP tools. Please ensure function names are unique.`);i[g]=p}}catch(d){n={error:d}}finally{try{!u&&!e&&(o=c.return)&&await o.call(c)}finally{if(n)throw n.error}}this.mcpTools=s,this.functionNameToMcpClient=i}async tool(){return await this.initialize(),$4(this.mcpTools,this.config)}async callTool(e){await this.initialize();let n=[];for(let o of e)if(o.name in this.functionNameToMcpClient){let r=this.functionNameToMcpClient[o.name],i;this.config.timeout&&(i={timeout:this.config.timeout});let s=await r.callTool({name:o.name,arguments:o.args},void 0,i);n.push({functionResponse:{name:o.name,response:s.isError?{error:s}:s}})}return n}};a(nc,"McpCallableTool");var Fm=nc;async function S2(t,e,n){let o=new Am,r;n.data instanceof Blob?r=JSON.parse(await n.data.text()):r=JSON.parse(n.data),Object.assign(o,r),e(o)}a(S2,"handleWebSocketMessage$1");var Eh=class Eh{constructor(e,n,o){this.apiClient=e,this.auth=n,this.webSocketFactory=o}async connect(e){var n,o;if(this.apiClient.isVertexAI())throw new Error("Live music is not supported for Vertex AI.");console.warn("Live music generation is experimental and may change in future versions.");let r=this.apiClient.getWebsocketBaseUrl(),i=this.apiClient.getApiVersion(),s=C2(this.apiClient.getDefaultHeaders()),u=this.apiClient.getApiKey(),c=`${r}/ws/google.ai.generativelanguage.${i}.GenerativeService.BidiGenerateMusic?key=${u}`,l=a(()=>{},"onopenResolve"),p=new Promise(T=>{l=T}),d=e.callbacks,g=a(function(){l({})},"onopenAwaitedCallback"),h=this.apiClient,v={onopen:g,onmessage:a(T=>{S2(h,d.onmessage,T)},"onmessage"),onerror:(n=d==null?void 0:d.onerror)!==null&&n!==void 0?n:function(T){},onclose:(o=d==null?void 0:d.onclose)!==null&&o!==void 0?o:function(T){}},y=this.webSocketFactory.create(c,T2(s),v);y.connect(),await p;let E={setup:{model:ue(this.apiClient,e.model)}};return y.send(JSON.stringify(E)),new Gm(y,this.apiClient)}};a(Eh,"LiveMusic");var zm=Eh,Sh=class Sh{constructor(e,n){this.conn=e,this.apiClient=n}async setWeightedPrompts(e){if(!e.weightedPrompts||Object.keys(e.weightedPrompts).length===0)throw new Error("Weighted prompts must be set and contain at least one entry.");let n=F6(e);this.conn.send(JSON.stringify({clientContent:n}))}async setMusicGenerationConfig(e){e.musicGenerationConfig||(e.musicGenerationConfig={});let n=U6(e);this.conn.send(JSON.stringify(n))}sendPlaybackControl(e){let n={playbackControl:e};this.conn.send(JSON.stringify(n))}play(){this.sendPlaybackControl(Yo.PLAY)}pause(){this.sendPlaybackControl(Yo.PAUSE)}stop(){this.sendPlaybackControl(Yo.STOP)}resetContext(){this.sendPlaybackControl(Yo.RESET_CONTEXT)}close(){this.conn.close()}};a(Sh,"LiveMusicSession");var Gm=Sh;function T2(t){let e={};return t.forEach((n,o)=>{e[o]=n}),e}a(T2,"headersToMap$1");function C2(t){let e=new Headers;for(let[n,o]of Object.entries(t))e.append(n,o);return e}a(C2,"mapToHeaders$1");var I2="FunctionResponse request must have an `id` field from the response of a ToolCall.FunctionalCalls in Google AI.";async function A2(t,e,n){let o=new Im,r;n.data instanceof Blob?r=await n.data.text():n.data instanceof ArrayBuffer?r=new TextDecoder().decode(n.data):r=n.data;let i=JSON.parse(r);if(t.isVertexAI()){let s=B6(i);Object.assign(o,s)}else Object.assign(o,i);e(o)}a(A2,"handleWebSocketMessage");var Th=class Th{constructor(e,n,o){this.apiClient=e,this.auth=n,this.webSocketFactory=o,this.music=new zm(this.apiClient,this.auth,this.webSocketFactory)}async connect(e){var n,o,r,i,s,u;if(e.config&&e.config.httpOptions)throw new Error("The Live module does not support httpOptions at request-level in LiveConnectConfig yet. Please use the client-level httpOptions configuration instead.");let c=this.apiClient.getWebsocketBaseUrl(),l=this.apiClient.getApiVersion(),p,d=this.apiClient.getHeaders();e.config&&e.config.tools&&U$(e.config.tools)&&F$(d);let g=R2(d);if(this.apiClient.isVertexAI()){let k=this.apiClient.getProject(),V=this.apiClient.getLocation(),ce=this.apiClient.getApiKey(),Ee=!!k&&!!V||!!ce;this.apiClient.getCustomBaseUrl()&&!Ee?p=c:(p=`${c}/ws/google.cloud.aiplatform.${l}.LlmBidiService/BidiGenerateContent`,await this.auth.addAuthHeaders(g,p))}else{let k=this.apiClient.getApiKey(),V="BidiGenerateContent",ce="key";k!=null&&k.startsWith("auth_tokens/")&&(console.warn("Warning: Ephemeral token support is experimental and may change in future versions."),l!=="v1alpha"&&console.warn("Warning: The SDK's ephemeral token support is in v1alpha only. Please use const ai = new GoogleGenAI({apiKey: token.name, httpOptions: { apiVersion: 'v1alpha' }}); before session connection."),V="BidiGenerateContentConstrained",ce="access_token"),p=`${c}/ws/google.ai.generativelanguage.${l}.GenerativeService.${V}?${ce}=${k}`}let h=a(()=>{},"onopenResolve"),v=new Promise(k=>{h=k}),y=e.callbacks,_=a(function(){var k;(k=y==null?void 0:y.onopen)===null||k===void 0||k.call(y),h({})},"onopenAwaitedCallback"),x=this.apiClient,E={onopen:_,onmessage:a(k=>{A2(x,y.onmessage,k)},"onmessage"),onerror:(n=y==null?void 0:y.onerror)!==null&&n!==void 0?n:function(k){},onclose:(o=y==null?void 0:y.onclose)!==null&&o!==void 0?o:function(k){}},T=this.webSocketFactory.create(p,b2(g),E);T.connect(),await v;let S=ue(this.apiClient,e.model);if(this.apiClient.isVertexAI()&&S.startsWith("publishers/")){let k=this.apiClient.getProject(),V=this.apiClient.getLocation();k&&V&&(S=`projects/${k}/locations/${V}/`+S)}let I={};this.apiClient.isVertexAI()&&((r=e.config)===null||r===void 0?void 0:r.responseModalities)===void 0&&(e.config===void 0?e.config={responseModalities:[Br.AUDIO]}:e.config.responseModalities=[Br.AUDIO]),!((i=e.config)===null||i===void 0)&&i.generationConfig&&console.warn("Setting `LiveConnectConfig.generation_config` is deprecated, please set the fields on `LiveConnectConfig` directly. This will become an error in a future version (not before Q3 2025).");let w=(u=(s=e.config)===null||s===void 0?void 0:s.tools)!==null&&u!==void 0?u:[],b=[];for(let k of w)if(this.isCallableTool(k)){let V=k;b.push(await V.tool())}else b.push(k);b.length>0&&(e.config.tools=b);let B={model:S,config:e.config,callbacks:e.callbacks};return this.apiClient.isVertexAI()?I=M6(this.apiClient,B):I=L6(this.apiClient,B),delete I.config,T.send(JSON.stringify(I)),new qm(T,this.apiClient)}isCallableTool(e){return"callTool"in e&&typeof e.callTool=="function"}};a(Th,"Live");var Bm=Th,w2={turnComplete:!0},Ch=class Ch{constructor(e,n){this.conn=e,this.apiClient=n}tLiveClientContent(e,n){if(n.turns!==null&&n.turns!==void 0){let o=[];try{o=yt(n.turns),e.isVertexAI()||(o=o.map(r=>oa(r)))}catch(r){throw new Error(`Failed to parse client content "turns", type: '${typeof n.turns}'`)}return{clientContent:{turns:o,turnComplete:n.turnComplete}}}return{clientContent:{turnComplete:n.turnComplete}}}tLiveClienttToolResponse(e,n){let o=[];if(n.functionResponses==null)throw new Error("functionResponses is required.");if(Array.isArray(n.functionResponses)?o=n.functionResponses:o=[n.functionResponses],o.length===0)throw new Error("functionResponses is required.");for(let i of o){if(typeof i!="object"||i===null||!("name"in i)||!("response"in i))throw new Error(`Could not parse function response, type '${typeof i}'.`);if(!e.isVertexAI()&&!("id"in i))throw new Error(I2)}return{toolResponse:{functionResponses:o}}}sendClientContent(e){e=Object.assign(Object.assign({},w2),e);let n=this.tLiveClientContent(this.apiClient,e);this.conn.send(JSON.stringify(n))}sendRealtimeInput(e){let n={};this.apiClient.isVertexAI()?n={realtimeInput:G6(e)}:n={realtimeInput:z6(e)},this.conn.send(JSON.stringify(n))}sendToolResponse(e){if(e.functionResponses==null)throw new Error("Tool response parameters are required.");let n=this.tLiveClienttToolResponse(this.apiClient,e);this.conn.send(JSON.stringify(n))}close(){this.conn.close()}};a(Ch,"Session");var qm=Ch;function b2(t){let e={};return t.forEach((n,o)=>{e[o]=n}),e}a(b2,"headersToMap");function R2(t){let e=new Headers;for(let[n,o]of Object.entries(t))e.append(n,o);return e}a(R2,"mapToHeaders");var WN=10;function jN(t){var e,n,o;if(!((e=t==null?void 0:t.automaticFunctionCalling)===null||e===void 0)&&e.disable)return!0;let r=!1;for(let s of(n=t==null?void 0:t.tools)!==null&&n!==void 0?n:[])if(ni(s)){r=!0;break}if(!r)return!0;let i=(o=t==null?void 0:t.automaticFunctionCalling)===null||o===void 0?void 0:o.maximumRemoteCalls;return i&&(i<0||!Number.isInteger(i))||i==0?(console.warn("Invalid maximumRemoteCalls value provided for automatic function calling. Disabled automatic function calling. Please provide a valid integer value greater than 0. maximumRemoteCalls provided:",i),!0):!1}a(jN,"shouldDisableAfc");function ni(t){return"callTool"in t&&typeof t.callTool=="function"}a(ni,"isCallableTool");function k2(t){var e,n,o;return(o=(n=(e=t.config)===null||e===void 0?void 0:e.tools)===null||n===void 0?void 0:n.some(r=>ni(r)))!==null&&o!==void 0?o:!1}a(k2,"hasCallableTools");function YN(t){var e;let n=[];return!((e=t==null?void 0:t.config)===null||e===void 0)&&e.tools&&t.config.tools.forEach((o,r)=>{if(ni(o))return;let i=o;i.functionDeclarations&&i.functionDeclarations.length>0&&n.push(r)}),n}a(YN,"findAfcIncompatibleToolIndexes");function XN(t){var e;return!(!((e=t==null?void 0:t.automaticFunctionCalling)===null||e===void 0)&&e.ignoreCallHistory)}a(XN,"shouldAppendAfcHistory");var Ih=class Ih extends en{constructor(e){super(),this.apiClient=e,this.embedContent=async n=>{if(!this.apiClient.isVertexAI())return n.model.includes("gemini-embedding-2")&&(n.contents=yt(n.contents)),await this.embedContentInternal(n);if(n.model.includes("gemini")&&n.model!=="gemini-embedding-001"||n.model.includes("maas")){let r=yt(n.contents);if(r.length>1)throw new Error("The embedContent API for this model only supports one content at a time.");let i=Object.assign(Object.assign({},n),{content:r[0],embeddingApiType:kl.EMBED_CONTENT});return await this.embedContentInternal(i)}else{let r=Object.assign(Object.assign({},n),{embeddingApiType:kl.PREDICT});return await this.embedContentInternal(r)}},this.generateContent=async n=>{var o,r,i,s,u;let c=await this.processParamsMaybeAddMcpUsage(n);if(this.maybeMoveToResponseJsonSchem(n),!k2(n)||jN(n.config))return await this.generateContentInternal(c);let l=YN(n);if(l.length>0){let y=l.map(_=>`tools[${_}]`).join(", ");throw new Error(`Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations is not yet supported. Incompatible tools found at ${y}.`)}let p,d,g=yt(c.contents),h=(i=(r=(o=c.config)===null||o===void 0?void 0:o.automaticFunctionCalling)===null||r===void 0?void 0:r.maximumRemoteCalls)!==null&&i!==void 0?i:WN,v=0;for(;v<h&&(p=await this.generateContentInternal(c),!(!p.functionCalls||p.functionCalls.length===0));){let y=p.candidates[0].content,_=[];for(let x of(u=(s=n.config)===null||s===void 0?void 0:s.tools)!==null&&u!==void 0?u:[])if(ni(x)){let T=await x.callTool(p.functionCalls);_.push(...T)}v++,d={role:"user",parts:_},c.contents=yt(c.contents),c.contents.push(y),c.contents.push(d),XN(c.config)&&(g.push(y),g.push(d))}return XN(c.config)&&(p.automaticFunctionCallingHistory=g),p},this.generateContentStream=async n=>{var o,r,i,s,u;if(this.maybeMoveToResponseJsonSchem(n),jN(n.config)){let d=await this.processParamsMaybeAddMcpUsage(n);return await this.generateContentStreamInternal(d)}let c=YN(n);if(c.length>0){let d=c.map(g=>`tools[${g}]`).join(", ");throw new Error(`Incompatible tools found at ${d}. Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations" is not yet supported.`)}let l=(i=(r=(o=n==null?void 0:n.config)===null||o===void 0?void 0:o.toolConfig)===null||r===void 0?void 0:r.functionCallingConfig)===null||i===void 0?void 0:i.streamFunctionCallArguments,p=(u=(s=n==null?void 0:n.config)===null||s===void 0?void 0:s.automaticFunctionCalling)===null||u===void 0?void 0:u.disable;if(l&&!p)throw new Error("Running in streaming mode with 'streamFunctionCallArguments' enabled, this feature is not compatible with automatic function calling (AFC). Please set 'config.automaticFunctionCalling.disable' to true to disable AFC or leave 'config.toolConfig.functionCallingConfig.streamFunctionCallArguments' to be undefined or set to false to disable streaming function call arguments feature.");return await this.processAfcStream(n)},this.generateImages=async n=>await this.generateImagesInternal(n).then(o=>{var r;let i,s=[];if(o!=null&&o.generatedImages)for(let c of o.generatedImages)c&&(c!=null&&c.safetyAttributes)&&((r=c==null?void 0:c.safetyAttributes)===null||r===void 0?void 0:r.contentType)==="Positive Prompt"?i=c==null?void 0:c.safetyAttributes:s.push(c);let u;return i?u={generatedImages:s,positivePromptSafetyAttributes:i,sdkHttpResponse:o.sdkHttpResponse}:u={generatedImages:s,sdkHttpResponse:o.sdkHttpResponse},u}),this.list=async n=>{var o;let s={config:Object.assign(Object.assign({},{queryBase:!0}),n==null?void 0:n.config)};if(this.apiClient.isVertexAI()&&!s.config.queryBase){if(!((o=s.config)===null||o===void 0)&&o.filter)throw new Error("Filtering tuned models list is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");s.config.filter="labels.tune-type:*"}return new zn(Fn.PAGED_ITEM_MODELS,u=>this.listInternal(u),await this.listInternal(s),s)},this.editImage=async n=>{let o={model:n.model,prompt:n.prompt,referenceImages:[],config:n.config};return n.referenceImages&&n.referenceImages&&(o.referenceImages=n.referenceImages.map(r=>r.toReferenceImageAPI())),await this.editImageInternal(o)},this.upscaleImage=async n=>{let o={numberOfImages:1,mode:"upscale"};n.config&&(o=Object.assign(Object.assign({},o),n.config));let r={model:n.model,image:n.image,upscaleFactor:n.upscaleFactor,config:o};return await this.upscaleImageInternal(r)},this.generateVideos=async n=>{var o,r,i,s,u,c;if((n.prompt||n.image||n.video)&&n.source)throw new Error("Source and prompt/image/video are mutually exclusive. Please only use source.");return this.apiClient.isVertexAI()||(!((o=n.video)===null||o===void 0)&&o.uri&&(!((r=n.video)===null||r===void 0)&&r.videoBytes)?n.video={uri:n.video.uri,mimeType:n.video.mimeType}:!((s=(i=n.source)===null||i===void 0?void 0:i.video)===null||s===void 0)&&s.uri&&(!((c=(u=n.source)===null||u===void 0?void 0:u.video)===null||c===void 0)&&c.videoBytes)&&(n.source.video={uri:n.source.video.uri,mimeType:n.source.video.mimeType})),await this.generateVideosInternal(n)}}maybeMoveToResponseJsonSchem(e){e.config&&e.config.responseSchema&&(e.config.responseJsonSchema||Object.keys(e.config.responseSchema).includes("$schema")&&(e.config.responseJsonSchema=e.config.responseSchema,delete e.config.responseSchema))}async processParamsMaybeAddMcpUsage(e){var n,o,r;let i=(n=e.config)===null||n===void 0?void 0:n.tools;if(!i)return e;let s=await Promise.all(i.map(async c=>ni(c)?await c.tool():c)),u={model:e.model,contents:e.contents,config:Object.assign(Object.assign({},e.config),{tools:s})};if(u.config.tools=s,e.config&&e.config.tools&&U$(e.config.tools)){let c=(r=(o=e.config.httpOptions)===null||o===void 0?void 0:o.headers)!==null&&r!==void 0?r:{},l=Object.assign({},c);Object.keys(l).length===0&&(l=this.apiClient.getDefaultHeaders()),F$(l),u.config.httpOptions=Object.assign(Object.assign({},e.config.httpOptions),{headers:l})}return u}async initAfcToolsMap(e){var n,o,r;let i=new Map;for(let s of(o=(n=e.config)===null||n===void 0?void 0:n.tools)!==null&&o!==void 0?o:[])if(ni(s)){let u=s,c=await u.tool();for(let l of(r=c.functionDeclarations)!==null&&r!==void 0?r:[]){if(!l.name)throw new Error("Function declaration name is required.");if(i.has(l.name))throw new Error(`Duplicate tool declaration name: ${l.name}`);i.set(l.name,u)}}return i}async processAfcStream(e){var n,o,r;let i=(r=(o=(n=e.config)===null||n===void 0?void 0:n.automaticFunctionCalling)===null||o===void 0?void 0:o.maximumRemoteCalls)!==null&&r!==void 0?r:WN,s=!1,u=0,c=await this.initAfcToolsMap(e);return(function(l,p,d){return ti(this,arguments,function*(){for(var g,h,v,y,_,x;u<i;){s&&(u++,s=!1);let I=yield Te(l.processParamsMaybeAddMcpUsage(d)),w=yield Te(l.generateContentStreamInternal(I)),b=[],B=[];try{for(var E=!0,T=(h=void 0,Qs(w)),S;S=yield Te(T.next()),g=S.done,!g;E=!0){y=S.value,E=!1;let k=y;if(yield yield Te(k),k.candidates&&(!((_=k.candidates[0])===null||_===void 0)&&_.content)){B.push(k.candidates[0].content);for(let V of(x=k.candidates[0].content.parts)!==null&&x!==void 0?x:[])if(u<i&&V.functionCall){if(!V.functionCall.name)throw new Error("Function call name was not returned by the model.");if(p.has(V.functionCall.name)){let ce=yield Te(p.get(V.functionCall.name).callTool([V.functionCall]));b.push(...ce)}else throw new Error(`Automatic function calling was requested, but not all the tools the model used implement the CallableTool interface. Available tools: ${p.keys()}, mising tool: ${V.functionCall.name}`)}}}}catch(k){h={error:k}}finally{try{!E&&!g&&(v=T.return)&&(yield Te(v.call(T)))}finally{if(h)throw h.error}}if(b.length>0){s=!0;let k=new Gr;k.candidates=[{content:{role:"user",parts:b}}],yield yield Te(k);let V=[];V.push(...B),V.push({role:"user",parts:b});let ce=yt(d.contents).concat(V);d.contents=ce}else break}})})(this,c,e)}async generateContentInternal(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=ZN(this.apiClient,e);return u=q("{model}:generateContent",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=JN(p),g=new Gr;return Object.assign(g,d),g})}else{let l=VN(this.apiClient,e);return u=q("{model}:generateContent",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=HN(p),g=new Gr;return Object.assign(g,d),g})}}async generateContentStreamInternal(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=ZN(this.apiClient,e);return u=q("{model}:streamGenerateContent?alt=sse",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.requestStream({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}),s.then(function(d){return ti(this,arguments,function*(){var g,h,v,y;try{for(var _=!0,x=Qs(d),E;E=yield Te(x.next()),g=E.done,!g;_=!0){y=E.value,_=!1;let T=y,S=JN(yield Te(T.json()),e);S.sdkHttpResponse={headers:T.headers};let I=new Gr;Object.assign(I,S),yield yield Te(I)}}catch(T){h={error:T}}finally{try{!_&&!g&&(v=x.return)&&(yield Te(v.call(x)))}finally{if(h)throw h.error}}})})}else{let l=VN(this.apiClient,e);return u=q("{model}:streamGenerateContent?alt=sse",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.requestStream({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}),s.then(function(d){return ti(this,arguments,function*(){var g,h,v,y;try{for(var _=!0,x=Qs(d),E;E=yield Te(x.next()),g=E.done,!g;_=!0){y=E.value,_=!1;let T=y,S=HN(yield Te(T.json()),e);S.sdkHttpResponse={headers:T.headers};let I=new Gr;Object.assign(I,S),yield yield Te(I)}}catch(T){h={error:T}}finally{try{!_&&!g&&(v=x.return)&&(yield Te(v.call(x)))}finally{if(h)throw h.error}}})})}}async embedContentInternal(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=CZ(this.apiClient,e,e),p=O4(e.model)?"{model}:embedContent":"{model}:predict";return u=q(p,l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(d=>d.json().then(g=>{let h=g;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{let g=AZ(d,e),h=new Pl;return Object.assign(h,g),h})}else{let l=TZ(this.apiClient,e);return u=q("{model}:batchEmbedContents",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=IZ(p),g=new Pl;return Object.assign(g,d),g})}}async generateImagesInternal(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=MZ(this.apiClient,e);return u=q("{model}:predict",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=FZ(p),g=new Nl;return Object.assign(g,d),g})}else{let l=LZ(this.apiClient,e);return u=q("{model}:predict",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=UZ(p),g=new Nl;return Object.assign(g,d),g})}}async editImageInternal(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){let u=_Z(this.apiClient,e);return i=q("{model}:predict",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json().then(l=>{let p=l;return p.sdkHttpResponse={headers:c.headers},p})),r.then(c=>{let l=xZ(c),p=new cm;return Object.assign(p,l),p})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async upscaleImageInternal(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){let u=zH(this.apiClient,e);return i=q("{model}:predict",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json().then(l=>{let p=l;return p.sdkHttpResponse={headers:c.headers},p})),r.then(c=>{let l=GH(c),p=new dm;return Object.assign(p,l),p})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async recontextImage(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){let u=xH(this.apiClient,e);return i=q("{model}:predict",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>{let l=EH(c),p=new fm;return Object.assign(p,l),p})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async segmentImage(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){let u=wH(this.apiClient,e);return i=q("{model}:predict",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>{let l=bH(c),p=new pm;return Object.assign(p,l),p})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async get(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=nH(this.apiClient,e);return u=q("{name}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json()),s.then(p=>Lm(p))}else{let l=tH(this.apiClient,e);return u=q("{name}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json()),s.then(p=>Om(p))}}async listInternal(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=dH(this.apiClient,e);return u=q("{models_url}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=pH(p),g=new $l;return Object.assign(g,d),g})}else{let l=cH(this.apiClient,e);return u=q("{models_url}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=fH(p),g=new $l;return Object.assign(g,d),g})}}async update(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=UH(this.apiClient,e);return u=q("{model}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"PATCH",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json()),s.then(p=>Lm(p))}else{let l=MH(this.apiClient,e);return u=q("{name}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"PATCH",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json()),s.then(p=>Om(p))}}async delete(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=gZ(this.apiClient,e);return u=q("{name}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=vZ(p),g=new Dl;return Object.assign(g,d),g})}else{let l=mZ(this.apiClient,e);return u=q("{name}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"DELETE",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=hZ(p),g=new Dl;return Object.assign(g,d),g})}}async countTokens(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=dZ(this.apiClient,e);return u=q("{model}:countTokens",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=pZ(p),g=new Ol;return Object.assign(g,d),g})}else{let l=cZ(this.apiClient,e);return u=q("{model}:countTokens",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=fZ(p),g=new Ol;return Object.assign(g,d),g})}}async computeTokens(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){let u=rZ(this.apiClient,e);return i=q("{model}:computeTokens",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json().then(l=>{let p=l;return p.sdkHttpResponse={headers:c.headers},p})),r.then(c=>{let l=oZ(c),p=new mm;return Object.assign(p,l),p})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async generateVideosInternal(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=ZZ(this.apiClient,e);return u=q("{model}:predictLongRunning",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json()),s.then(p=>{let d=qZ(p),g=new Ll;return Object.assign(g,d),g})}else{let l=VZ(this.apiClient,e);return u=q("{model}:predictLongRunning",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json()),s.then(p=>{let d=BZ(p),g=new Ll;return Object.assign(g,d),g})}}};a(Ih,"Models");var Vm=Ih;var Ah=class Ah extends en{constructor(e){super(),this.apiClient=e}async getVideosOperation(e){let n=e.operation,o=e.config;if(n.name===void 0||n.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){let r=n.name.split("/operations/")[0],i;o&&"httpOptions"in o&&(i=o.httpOptions);let s=await this.fetchPredictVideosOperationInternal({operationName:n.name,resourceName:r,config:{httpOptions:i}});return n._fromAPIResponse({apiResponse:s,_isVertexAI:!0})}else{let r=await this.getVideosOperationInternal({operationName:n.name,config:o});return n._fromAPIResponse({apiResponse:r,_isVertexAI:!1})}}async get(e){let n=e.operation,o=e.config;if(n.name===void 0||n.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){let r=n.name.split("/operations/")[0],i;o&&"httpOptions"in o&&(i=o.httpOptions);let s=await this.fetchPredictVideosOperationInternal({operationName:n.name,resourceName:r,config:{httpOptions:i}});return n._fromAPIResponse({apiResponse:s,_isVertexAI:!0})}else{let r=await this.getVideosOperationInternal({operationName:n.name,config:o});return n._fromAPIResponse({apiResponse:r,_isVertexAI:!1})}}async getVideosOperationInternal(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=x4(e);return u=q("{operationName}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json()),s}else{let l=_4(e);return u=q("{operationName}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json()),s}}async fetchPredictVideosOperationInternal(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){let u=f4(e);return i=q("{resourceName}:fetchPredictOperation",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}};a(Ah,"Operations");var Zm=Ah;function QN(t){let e={};if(f(t,["languageCodes"])!==void 0)throw new Error("languageCodes parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=f(t,["languageAuto"]);n!=null&&m(e,["languageAuto"],n);let o=f(t,["languageHints"]);o!=null&&m(e,["languageHints"],o);let r=f(t,["adaptationPhrases"]);return r!=null&&m(e,["adaptationPhrases"],r),e}a(QN,"audioTranscriptionConfigToMldev");function P2(t){let e={},n=f(t,["apiKey"]);if(n!=null&&m(e,["apiKey"],n),f(t,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["authType"])!==void 0)throw new Error("authType parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}a(P2,"authConfigToMldev");function N2(t){let e={},n=f(t,["data"]);if(n!=null&&m(e,["data"],n),f(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=f(t,["mimeType"]);return o!=null&&m(e,["mimeType"],o),e}a(N2,"blobToMldev");function $2(t){let e={},n=f(t,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>B2(i))),m(e,["parts"],r)}let o=f(t,["role"]);return o!=null&&m(e,["role"],o),e}a($2,"contentToMldev");function D2(t,e,n){let o={},r=f(e,["expireTime"]);n!==void 0&&r!=null&&m(n,["expireTime"],r);let i=f(e,["newSessionExpireTime"]);n!==void 0&&i!=null&&m(n,["newSessionExpireTime"],i);let s=f(e,["uses"]);n!==void 0&&s!=null&&m(n,["uses"],s);let u=f(e,["liveConnectConstraints"]);n!==void 0&&u!=null&&m(n,["bidiGenerateContentSetup"],G2(t,u));let c=f(e,["lockAdditionalFields"]);return n!==void 0&&c!=null&&m(n,["fieldMask"],c),o}a(D2,"createAuthTokenConfigToMldev");function O2(t,e){let n={},o=f(e,["config"]);return o!=null&&m(n,["config"],D2(t,o,n)),n}a(O2,"createAuthTokenParametersToMldev");function L2(t){let e={};if(f(t,["displayName"])!==void 0)throw new Error("displayName parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=f(t,["fileUri"]);n!=null&&m(e,["fileUri"],n);let o=f(t,["mimeType"]);return o!=null&&m(e,["mimeType"],o),e}a(L2,"fileDataToMldev");function M2(t){let e={},n=f(t,["id"]);n!=null&&m(e,["id"],n);let o=f(t,["args"]);o!=null&&m(e,["args"],o);let r=f(t,["name"]);if(r!=null&&m(e,["name"],r),f(t,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["willContinue"])!==void 0)throw new Error("willContinue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}a(M2,"functionCallToMldev");function U2(t){let e={},n=f(t,["authConfig"]);n!=null&&m(e,["authConfig"],P2(n));let o=f(t,["enableWidget"]);return o!=null&&m(e,["enableWidget"],o),e}a(U2,"googleMapsToMldev");function F2(t){let e={},n=f(t,["searchTypes"]);if(n!=null&&m(e,["searchTypes"],n),f(t,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=f(t,["timeRangeFilter"]);return o!=null&&m(e,["timeRangeFilter"],o),e}a(F2,"googleSearchToMldev");function z2(t,e){let n={},o=f(t,["generationConfig"]);e!==void 0&&o!=null&&m(e,["setup","generationConfig"],o);let r=f(t,["responseModalities"]);e!==void 0&&r!=null&&m(e,["setup","generationConfig","responseModalities"],r);let i=f(t,["temperature"]);e!==void 0&&i!=null&&m(e,["setup","generationConfig","temperature"],i);let s=f(t,["topP"]);e!==void 0&&s!=null&&m(e,["setup","generationConfig","topP"],s);let u=f(t,["topK"]);e!==void 0&&u!=null&&m(e,["setup","generationConfig","topK"],u);let c=f(t,["maxOutputTokens"]);e!==void 0&&c!=null&&m(e,["setup","generationConfig","maxOutputTokens"],c);let l=f(t,["mediaResolution"]);e!==void 0&&l!=null&&m(e,["setup","generationConfig","mediaResolution"],l);let p=f(t,["seed"]);e!==void 0&&p!=null&&m(e,["setup","generationConfig","seed"],p);let d=f(t,["speechConfig"]);e!==void 0&&d!=null&&m(e,["setup","generationConfig","speechConfig"],Ug(d));let g=f(t,["thinkingConfig"]);e!==void 0&&g!=null&&m(e,["setup","generationConfig","thinkingConfig"],g);let h=f(t,["enableAffectiveDialog"]);e!==void 0&&h!=null&&m(e,["setup","generationConfig","enableAffectiveDialog"],h);let v=f(t,["systemInstruction"]);e!==void 0&&v!=null&&m(e,["setup","systemInstruction"],$2(Ge(v)));let y=f(t,["tools"]);if(e!==void 0&&y!=null){let k=ci(y);Array.isArray(k)&&(k=k.map(V=>Z2(li(V)))),m(e,["setup","tools"],k)}let _=f(t,["sessionResumption"]);e!==void 0&&_!=null&&m(e,["setup","sessionResumption"],V2(_));let x=f(t,["inputAudioTranscription"]);e!==void 0&&x!=null&&m(e,["setup","inputAudioTranscription"],QN(x));let E=f(t,["outputAudioTranscription"]);e!==void 0&&E!=null&&m(e,["setup","outputAudioTranscription"],QN(E));let T=f(t,["realtimeInputConfig"]);e!==void 0&&T!=null&&m(e,["setup","realtimeInputConfig"],T);let S=f(t,["contextWindowCompression"]);e!==void 0&&S!=null&&m(e,["setup","contextWindowCompression"],S);let I=f(t,["proactivity"]);if(e!==void 0&&I!=null&&m(e,["setup","proactivity"],I),f(t,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let w=f(t,["avatarConfig"]);e!==void 0&&w!=null&&m(e,["setup","avatarConfig"],w);let b=f(t,["safetySettings"]);if(e!==void 0&&b!=null){let k=b;Array.isArray(k)&&(k=k.map(V=>q2(V))),m(e,["setup","safetySettings"],k)}let B=f(t,["translationConfig"]);return e!==void 0&&B!=null&&m(e,["setup","generationConfig","translationConfig"],B),n}a(z2,"liveConnectConfigToMldev");function G2(t,e){let n={},o=f(e,["model"]);o!=null&&m(n,["setup","model"],ue(t,o));let r=f(e,["config"]);return r!=null&&m(n,["config"],z2(r,n)),n}a(G2,"liveConnectConstraintsToMldev");function B2(t){let e={},n=f(t,["mediaResolution"]);n!=null&&m(e,["mediaResolution"],n);let o=f(t,["codeExecutionResult"]);o!=null&&m(e,["codeExecutionResult"],o);let r=f(t,["executableCode"]);r!=null&&m(e,["executableCode"],r);let i=f(t,["fileData"]);i!=null&&m(e,["fileData"],L2(i));let s=f(t,["functionCall"]);s!=null&&m(e,["functionCall"],M2(s));let u=f(t,["functionResponse"]);u!=null&&m(e,["functionResponse"],u);let c=f(t,["inlineData"]);c!=null&&m(e,["inlineData"],N2(c));let l=f(t,["text"]);l!=null&&m(e,["text"],l);let p=f(t,["thought"]);p!=null&&m(e,["thought"],p);let d=f(t,["thoughtSignature"]);d!=null&&m(e,["thoughtSignature"],d);let g=f(t,["videoMetadata"]);g!=null&&m(e,["videoMetadata"],g);let h=f(t,["toolCall"]);h!=null&&m(e,["toolCall"],h);let v=f(t,["toolResponse"]);v!=null&&m(e,["toolResponse"],v);let y=f(t,["partMetadata"]);return y!=null&&m(e,["partMetadata"],y),e}a(B2,"partToMldev");function q2(t){let e={},n=f(t,["category"]);if(n!=null&&m(e,["category"],n),f(t,["method"])!==void 0)throw new Error("method parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=f(t,["threshold"]);return o!=null&&m(e,["threshold"],o),e}a(q2,"safetySettingToMldev");function V2(t){let e={},n=f(t,["handle"]);if(n!=null&&m(e,["handle"],n),f(t,["transparent"])!==void 0)throw new Error("transparent parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return e}a(V2,"sessionResumptionConfigToMldev");function Z2(t){let e={};if(f(t,["retrieval"])!==void 0)throw new Error("retrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let n=f(t,["computerUse"]);n!=null&&m(e,["computerUse"],n);let o=f(t,["fileSearch"]);o!=null&&m(e,["fileSearch"],o);let r=f(t,["googleSearch"]);r!=null&&m(e,["googleSearch"],F2(r));let i=f(t,["googleMaps"]);i!=null&&m(e,["googleMaps"],U2(i));let s=f(t,["codeExecution"]);if(s!=null&&m(e,["codeExecution"],s),f(t,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let u=f(t,["functionDeclarations"]);if(u!=null){let d=u;Array.isArray(d)&&(d=d.map(g=>g)),m(e,["functionDeclarations"],d)}let c=f(t,["googleSearchRetrieval"]);if(c!=null&&m(e,["googleSearchRetrieval"],c),f(t,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let l=f(t,["urlContext"]);l!=null&&m(e,["urlContext"],l);let p=f(t,["mcpServers"]);if(p!=null){let d=p;Array.isArray(d)&&(d=d.map(g=>g)),m(e,["mcpServers"],d)}return e}a(Z2,"toolToMldev");function H2(t){let e=[];for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let o=t[n];if(typeof o=="object"&&o!=null&&Object.keys(o).length>0){let r=Object.keys(o).map(i=>`${n}.${i}`);e.push(...r)}else e.push(n)}return e.join(",")}a(H2,"getFieldMasks");function J2(t,e){let n=null,o=t.bidiGenerateContentSetup;if(typeof o=="object"&&o!==null&&"setup"in o){let i=o.setup;typeof i=="object"&&i!==null?(t.bidiGenerateContentSetup=i,n=i):delete t.bidiGenerateContentSetup}else o!==void 0&&delete t.bidiGenerateContentSetup;let r=t.fieldMask;if(n){let i=H2(n);if(Array.isArray(e==null?void 0:e.lockAdditionalFields)&&(e==null?void 0:e.lockAdditionalFields.length)===0)i?t.fieldMask=i:delete t.fieldMask;else if(e!=null&&e.lockAdditionalFields&&e.lockAdditionalFields.length>0&&r!==null&&Array.isArray(r)&&r.length>0){let s=["temperature","topK","topP","maxOutputTokens","responseModalities","seed","speechConfig"],u=[];r.length>0&&(u=r.map(l=>s.includes(l)?`generationConfig.${l}`:l));let c=[];i&&c.push(i),u.length>0&&c.push(...u),c.length>0?t.fieldMask=c.join(","):delete t.fieldMask}else delete t.fieldMask}else r!==null&&Array.isArray(r)&&r.length>0?t.fieldMask=r.join(","):delete t.fieldMask;return t}a(J2,"convertBidiSetupToTokenSetup");var wh=class wh extends en{constructor(e){super(),this.apiClient=e}async create(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("The client.tokens.create method is only supported by the Gemini Developer API.");{let u=O2(this.apiClient,e);i=q("auth_tokens",u._url),s=u._query,delete u.config,delete u._url,delete u._query;let c=J2(u,e.config);return r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(l=>l.json()),r.then(l=>l)}}};a(wh,"Tokens");var Hm=wh;function K2(t,e){let n={},o=f(t,["force"]);return e!==void 0&&o!=null&&m(e,["_query","force"],o),n}a(K2,"deleteDocumentConfigToMldev");function W2(t){let e={},n=f(t,["name"]);n!=null&&m(e,["_url","name"],n);let o=f(t,["config"]);return o!=null&&K2(o,e),e}a(W2,"deleteDocumentParametersToMldev");function j2(t){let e={},n=f(t,["name"]);return n!=null&&m(e,["_url","name"],n),e}a(j2,"getDocumentParametersToMldev");function Y2(t,e){let n={},o=f(t,["pageSize"]);e!==void 0&&o!=null&&m(e,["_query","pageSize"],o);let r=f(t,["pageToken"]);return e!==void 0&&r!=null&&m(e,["_query","pageToken"],r),n}a(Y2,"listDocumentsConfigToMldev");function X2(t){let e={},n=f(t,["parent"]);n!=null&&m(e,["_url","parent"],n);let o=f(t,["config"]);return o!=null&&Y2(o,e),e}a(X2,"listDocumentsParametersToMldev");function Q2(t){let e={},n=f(t,["sdkHttpResponse"]);n!=null&&m(e,["sdkHttpResponse"],n);let o=f(t,["nextPageToken"]);o!=null&&m(e,["nextPageToken"],o);let r=f(t,["documents"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),m(e,["documents"],i)}return e}a(Q2,"listDocumentsResponseFromMldev");var bh=class bh extends en{constructor(e){super(),this.apiClient=e,this.list=async n=>new zn(Fn.PAGED_ITEM_DOCUMENTS,o=>this.listInternal({parent:n.parent,config:o.config}),await this.listInternal(n),n)}async get(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let u=j2(e);return i=q("{name}",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>c)}}async delete(e){var n,o;let r="",i={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let s=W2(e);r=q("{name}",s._url),i=s._query,delete s._url,delete s._query,await this.apiClient.request({path:r,queryParams:i,body:JSON.stringify(s),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal})}}async listInternal(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let u=X2(e);return i=q("{parent}/documents",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>{let l=Q2(c),p=new vm;return Object.assign(p,l),p})}}};a(bh,"Documents");var Jm=bh;var Rh=class Rh extends en{constructor(e,n=new Jm(e)){super(),this.apiClient=e,this.documents=n,this.list=async(o={})=>new zn(Fn.PAGED_ITEM_FILE_SEARCH_STORES,r=>this.listInternal(r),await this.listInternal(o),o)}async uploadToFileSearchStore(e){if(this.apiClient.isVertexAI())throw new Error("Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support uploading files to a file search store.");return this.apiClient.uploadFileToFileSearchStore(e.fileSearchStoreName,e.file,e.config)}async downloadMedia(e,n){if(this.apiClient.isVertexAI())throw new Error("This method is only supported in the Gemini Developer client.");let o=new URL(e,"http://dummy.com"),r=o.pathname;if(r.startsWith("/")&&(r=r.slice(1)),!r.includes("/media/"))throw new Error(`Invalid uri format: ${e}. Expected to contain /media/`);let i={};o.searchParams.forEach((c,l)=>{i[l]=c}),i.alt="media";let s=Object.assign({},n==null?void 0:n.httpOptions),u=await this.apiClient.request({path:r,httpMethod:"GET",queryParams:i,httpOptions:s});if(u instanceof ii){let c=await u.responseInternal.arrayBuffer();return new Uint8Array(c)}else throw new Error("Unexpected response type from downloadMedia")}async create(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let u=KH(this.apiClient,e);return i=q("fileSearchStores",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>c)}}async get(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let u=YH(e);return i=q("{name}",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>c)}}async delete(e){var n,o;let r="",i={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let s=jH(e);r=q("{name}",s._url),i=s._query,delete s._url,delete s._query,await this.apiClient.request({path:r,queryParams:i,body:JSON.stringify(s),httpMethod:"DELETE",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal})}}async listInternal(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let u=r2(e);return i=q("fileSearchStores",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>{let l=o2(c),p=new ym;return Object.assign(p,l),p})}}async uploadToFileSearchStoreInternal(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let u=i2(e);return i=q("upload/v1beta/{file_search_store_name}:uploadToFileSearchStore",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>{let l=s2(c),p=new _m;return Object.assign(p,l),p})}}async importFile(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let u=e2(e);return i=q("{file_search_store_name}:importFile",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json()),r.then(c=>{let l=QH(c),p=new xm;return Object.assign(p,l),p})}}};a(Rh,"FileSearchStores");var Km=Rh;function eJ(){return"Deno"in globalThis}a(eJ,"isDeno");var Tl;function na(){var t,e,n,o,r,i;if(Tl)return Tl;let s=globalThis,u={};return eJ()?u=(o=(n=(e=(t=s.Deno)===null||t===void 0?void 0:t.env)===null||e===void 0?void 0:e.toObject)===null||n===void 0?void 0:n.call(e))!==null&&o!==void 0?o:{}:u=(i=(r=s.process)===null||r===void 0?void 0:r.env)!==null&&i!==void 0?i:{},Tl=u,Tl}a(na,"env");function tJ(t){var e,n,o;let r=Object.assign({},t),i=na();return typeof i.GOOGLE_GENAI_API_VERSION<"u"&&((e=r.api_version)!==null&&e!==void 0||(r.api_version=i.GOOGLE_GENAI_API_VERSION)),typeof i.GOOGLE_GENAI_API_REVISION<"u"&&((n=r.api_revision)!==null&&n!==void 0||(r.api_revision=i.GOOGLE_GENAI_API_REVISION)),typeof i.GOOGLE_GENAI_USER_PROJECT<"u"&&((o=r.user_project)!==null&&o!==void 0||(r.user_project=i.GOOGLE_GENAI_USER_PROJECT)),r}a(tJ,"fillGlobals");var nJ="2026-05-20",kh=class kh{constructor(e){this.options=e}getDefaultHeaders(){return this.options.defaultHeaders}async resolveGoogleGenAISecurity(e){return sJ(await this.options.getAuthHeaders(e))}};a(kh,"GoogleGenAISecurityProvider");var Wm=kh,Ph=class Ph{beforeCreateRequest(e,n){return Object.assign(Object.assign({},n),{url:rJ(n.url)})}async beforeRequest(e,n){if(t$(n.headers,iJ(e.security_source)),aJ(e,n.headers),uJ(e,n.headers),cJ(n.headers))return n;let o=await oJ(e.security_source,n.url);return t$(n.headers,o==null?void 0:o.default_headers),lJ(n.headers,o),n}};a(Ph,"GoogleGenAIAuthHook");var jm=Ph;function rJ(t){let[,e,...n]=t.pathname.split("/");if(!e)return t;let o=decodeURIComponent(e);if(!o.includes("/"))return t;let r=new URL(t);return r.pathname=`/${o}/${n.join("/")}`,r}a(rJ,"decodeSDKLevelAPIVersionPath");async function oJ(t,e){if(G$(t))return t.resolveGoogleGenAISecurity(e);let n=typeof t=="function"?await t():t;return z$(n)?e$(n):e$(void 0)}a(oJ,"resolveSecurity$1");function iJ(t){var e,n;if(G$(t))return(n=(e=t.getDefaultHeaders)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:t.defaultHeaders;if(z$(t))return t.default_headers}a(iJ,"getStaticDefaultHeaders");function e$(t){var e,n;let o=na(),r=Object.assign(Object.assign({},t),{api_key:(e=t==null?void 0:t.api_key)!==null&&e!==void 0?e:o.GOOGLE_GENAI_API_KEY,access_token:(n=t==null?void 0:t.access_token)!==null&&n!==void 0?n:o.GOOGLE_GENAI_ACCESS_TOKEN});return B$(r)?r:void 0}a(e$,"withEnvSecurity");function sJ(t){var e,n;let o={};for(let[i,s]of t){let u=i.toLowerCase();u!=="authorization"&&u!=="x-goog-api-key"&&(o[i]=s)}let r={access_token:(e=t.get("authorization"))!==null&&e!==void 0?e:void 0,api_key:(n=t.get("x-goog-api-key"))!==null&&n!==void 0?n:void 0,default_headers:Object.keys(o).length?o:void 0};return B$(r)?r:void 0}a(sJ,"securityFromHeaders");function t$(t,e){if(e)for(let[n,o]of new Headers(e))t.get(n)===null&&t.set(n,o)}a(t$,"applyDefaultHeaders");function aJ(t,e){var n;e.get("api-revision")===null&&e.set("Api-Revision",(n=t.options.api_revision)!==null&&n!==void 0?n:nJ)}a(aJ,"applyApiRevision");function uJ(t,e){t.options.user_project!==void 0&&e.get("x-goog-user-project")===null&&e.set("x-goog-user-project",t.options.user_project)}a(uJ,"applyUserProject");function lJ(t,e){if(e){if(e.api_key){t.set("x-goog-api-key",e.api_key);return}e.access_token&&t.set("Authorization",dJ(e.access_token))}}a(lJ,"applyAuth");function cJ(t){return t.get("authorization")!==null||t.get("x-goog-api-key")!==null}a(cJ,"hasAuthHeaders");function dJ(t){return t.slice(0,7).toLowerCase()==="bearer "?t:`Bearer ${t}`}a(dJ,"bearer");function z$(t){return typeof t=="object"&&t!==null}a(z$,"isSecurity");function G$(t){return typeof t=="object"&&t!==null&&"resolveGoogleGenAISecurity"in t&&typeof t.resolveGoogleGenAISecurity=="function"}a(G$,"isSecurityResolver");function B$(t){return t.api_key!==void 0||t.access_token!==void 0||t.default_headers!==void 0}a(B$,"hasSecurityValue");var Nh=class Nh extends Error{constructor(e,n){let o=e;n!=null&&n.cause&&(o+=`: ${n.cause}`),super(o,n),this.name="HTTPClientError",typeof this.cause>"u"&&(this.cause=n==null?void 0:n.cause)}};a(Nh,"HTTPClientError");var lr=Nh,$h=class $h extends lr{constructor(){super(...arguments),this.name="UnexpectedClientError"}};a($h,"UnexpectedClientError");var ql=$h,Dh=class Dh extends lr{constructor(){super(...arguments),this.name="InvalidRequestError"}};a(Dh,"InvalidRequestError");var Xo=Dh,Oh=class Oh extends lr{constructor(){super(...arguments),this.name="RequestAbortedError"}};a(Oh,"RequestAbortedError");var Vl=Oh,Lh=class Lh extends lr{constructor(){super(...arguments),this.name="RequestTimeoutError"}};a(Lh,"RequestTimeoutError");var Zl=Lh,Mh=class Mh extends lr{constructor(){super(...arguments),this.name="ConnectionError"}};a(Mh,"ConnectionError");var Hl=Mh;var Uh=class Uh extends Error{constructor(e,n){var o,r,i,s;super(e),this.statusCode=(o=n==null?void 0:n.response)===null||o===void 0?void 0:o.status,this.body=(r=n==null?void 0:n.body)!==null&&r!==void 0?r:"",this.headers=(i=n==null?void 0:n.response)===null||i===void 0?void 0:i.headers,this.contentType=((s=n==null?void 0:n.response)===null||s===void 0?void 0:s.headers.get("content-type"))||"",this.rawResponse=n==null?void 0:n.response,this.name="GoogleGenAiError"}};a(Uh,"GoogleGenAiError");var qt=Uh;var Fh=class Fh extends Error{};a(Fh,"GeminiNextGenAPIClientError");var Ym=Fh,ea=class ea extends Ym{constructor(e,n,o,r){super(ea.makeMessage(e,n,o)),this.status=e,this.headers=r,this.error=n,this.statusCode=e,this.body=r$(n),this.contentType=(r==null?void 0:r.get("content-type"))||"",this.rawResponse=void 0,this.cause=void 0,this.name=this.constructor.name,Object.setPrototypeOf(this,new.target.prototype)}static makeMessage(e,n,o){var r;let i=n&&gJ(n)&&typeof n.message=="string"?n.message:void 0,s=r$(n),u=(r=i!=null?i:o)!==null&&r!==void 0?r:s||"An error occurred";return`${e?`${e} `:""}${u}`}static generate(e,n,o,r){return!e||!r?new si({message:o,cause:n instanceof Error?n:void 0}):e===400?new eg(e,n,o,r):e===401?new tg(e,n,o,r):e===403?new ng(e,n,o,r):e===404?new rg(e,n,o,r):e===409?new og(e,n,o,r):e===422?new ig(e,n,o,r):e===429?new sg(e,n,o,r):e>=500?new ag(e,n,o,r):new ea(e,n,o,r)}};a(ea,"APIError");var _t=ea,zh=class zh extends _t{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}};a(zh,"APIUserAbortError");var Xm=zh,Gh=class Gh extends _t{constructor({message:e,cause:n}){super(void 0,void 0,e||"Connection error.",void 0),this.cause=n}};a(Gh,"APIConnectionError");var si=Gh,Bh=class Bh extends si{constructor({message:e}={}){super({message:e||"Request timed out. This is a client-side timeout. You can increase the timeout by setting the `timeout` argument in your request or client http options."})}};a(Bh,"APIConnectionTimeoutError");var Qm=Bh,qh=class qh extends _t{};a(qh,"BadRequestError");var eg=qh,Vh=class Vh extends _t{};a(Vh,"AuthenticationError");var tg=Vh,Zh=class Zh extends _t{};a(Zh,"PermissionDeniedError");var ng=Zh,Hh=class Hh extends _t{};a(Hh,"NotFoundError");var rg=Hh,Jh=class Jh extends _t{};a(Jh,"ConflictError");var og=Jh,Kh=class Kh extends _t{};a(Kh,"UnprocessableEntityError");var ig=Kh,Wh=class Wh extends _t{};a(Wh,"RateLimitError");var sg=Wh,jh=class jh extends _t{};a(jh,"InternalServerError");var ag=jh;function Qo(t){return hJ(t)?t:t instanceof qt?fJ(t):t instanceof lr?pJ(t):t}a(Qo,"wrapSDKError");function fJ(t){let e=mJ(t),n=_t.generate(t.statusCode,e,t.message,t.headers);return Xs(n,"body",t.body),Xs(n,"contentType",t.contentType),Xs(n,"rawResponse",t.rawResponse),Xs(n,"statusCode",t.statusCode),Xs(n,"cause",t),n}a(fJ,"wrapAPIError");function pJ(t){return t instanceof Zl?new Qm({message:t.message}):t instanceof Vl?new Xm({message:t.message}):t instanceof Hl?new si({message:t.message,cause:t}):new si({message:t.message,cause:t})}a(pJ,"wrapHTTPClientError");function mJ(t){let e=n$(t,"data$");if(e&&typeof e=="object")return e;try{let o=JSON.parse(t.body);if(o&&typeof o=="object")return o}catch(o){}let n=n$(t,"error");return n&&typeof n=="object"?n:void 0}a(mJ,"getErrorPayload");function n$(t,e){return t&&typeof t=="object"?t[e]:void 0}a(n$,"getObjectProperty");function r$(t){if(!t)return"";try{return JSON.stringify(t)}catch(e){return String(t)}}a(r$,"stringifyErrorBody");function gJ(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}a(gJ,"isPlainObject$2");function hJ(t){return typeof t=="object"&&t!==null?_t.prototype.isPrototypeOf(t):!1}a(hJ,"isCompatAPIErrorInstance");function Xs(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!1})}a(Xs,"defineReadonly");function vJ(t){let e=new jm;t.registerBeforeCreateRequestHook(e),t.registerBeforeRequestHook(e)}a(vJ,"initHooks");var Yh=class Yh{constructor(){this.sdkInitHooks=[],this.beforeCreateRequestHooks=[],this.beforeRequestHooks=[],this.afterSuccessHooks=[],this.afterErrorHooks=[];let e=[];for(let n of e)"sdkInit"in n&&this.registerSDKInitHook(n),"beforeCreateRequest"in n&&this.registerBeforeCreateRequestHook(n),"beforeRequest"in n&&this.registerBeforeRequestHook(n),"afterSuccess"in n&&this.registerAfterSuccessHook(n),"afterError"in n&&this.registerAfterErrorHook(n);vJ(this)}registerSDKInitHook(e){this.sdkInitHooks.push(e)}registerBeforeCreateRequestHook(e){this.beforeCreateRequestHooks.push(e)}registerBeforeRequestHook(e){this.beforeRequestHooks.push(e)}registerAfterSuccessHook(e){this.afterSuccessHooks.push(e)}registerAfterErrorHook(e){this.afterErrorHooks.push(e)}sdkInit(e){return this.sdkInitHooks.reduce((n,o)=>o.sdkInit(n),e)}beforeCreateRequest(e,n){let o=n;for(let r of this.beforeCreateRequestHooks)o=r.beforeCreateRequest(e,o);return o}async beforeRequest(e,n){let o=n;for(let r of this.beforeRequestHooks)o=await r.beforeRequest(e,o);return o}async afterSuccess(e,n){let o=n;for(let r of this.afterSuccessHooks)o=await r.afterSuccess(e,o);return o}async afterError(e,n,o){let r=n,i=o;for(let s of this.afterErrorHooks){let u=await s.afterError(e,r,i);r=u.response,i=u.error}return{response:r,error:i}}};a(Yh,"SDKHooks");var Jl=Yh;function o$(t){return{ok:!0,value:t}}a(o$,"OK");function Un(t){return{ok:!1,error:t}}a(Un,"ERR");function Fg(t){return btoa(String.fromCodePoint(...t))}a(Fg,"bytesToBase64");function yJ(t){return new TextEncoder().encode(t)}a(yJ,"stringToBytes");function _J(t){return Fg(yJ(t))}a(_J,"stringToBase64");var xJ=Object.prototype.hasOwnProperty;function Xe(t,e){let n=/\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;return a(function(r={}){return t.replace(n,function(i,s){if(!xJ.call(r,s))throw new Error(`Parameter '${s}' is required`);let u=r[s];if(typeof u!="string"&&typeof u!="number")throw new Error(`Parameter '${s}' must be a string or number`);return`${u}`}).replace(/^\/+/,"")},"buildURLPath")}a(Xe,"pathToFunc");var i$=["https://generativelanguage.googleapis.com"];function EJ(t){var e;let n=t.server_url,o={};if(!n){let i=(e=t.server_idx)!==null&&e!==void 0?e:0;if(i<0||i>=i$.length)throw new Error(`Invalid server index ${i}`);n=i$[i]||""}let r=Xe(n)(o);return new URL(r)}a(EJ,"serverURLFromOptions");var SJ={userAgent:"speakeasy-sdk/typescript 2.4.1-preview.4 2.911.0 v1beta @google/genai"};function TJ(...t){let e=[];for(let n of t)n&&e.push(n);switch(e.length){case 0:case 1:return e[0]||null;default:return"any"in AbortSignal&&typeof AbortSignal.any=="function"?AbortSignal.any(e):CJ(e)}}a(TJ,"combineSignals");function CJ(t){let e=new AbortController,n=e.signal;if(!t.length)return e.signal;if(t.length===1)return t[0]||e.signal;for(let s of t)if(s.aborted)return s;function o(){e.abort(this.reason),i()}a(o,"abort");let r=[];function i(){for(let s of r){let u=s.deref();u&&u.removeEventListener("abort",o)}}a(i,"clean");for(let s of t)r.push(new WeakRef(s)),s.addEventListener("abort",o);return n}a(CJ,"abortSignalAny");function it(t){let e={};for(let[n,o]of Object.entries(t))typeof o<"u"&&(e[n]=o);return e}a(it,"compactMap");function cr(t){if(t===null||typeof t!="object"||Object.prototype.toString.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);if(e===null||e===Object.prototype)return!0;try{return Object.getPrototypeOf(e)===null}catch(n){return!1}}a(cr,"isPlainObject$1");function IJ(t){return(e,n,o)=>{let r="",i=o!=null&&o.explode?V$(e,n):[[e,n]];if(i.every(([l,p])=>p==null))return;let s=a(l=>(o==null?void 0:o.charEncoding)==="percent"?encodeURIComponent(l):l,"encodeString"),u=a(l=>s(Z$(l)),"encodeValue"),c=s(t);return i.forEach(([l,p])=>{var d,g;let h="",v=null;p!=null&&(Array.isArray(p)?v=(d=J$(p,y=>`${u(y)}`))===null||d===void 0?void 0:d.join(c):cr(p)?v=(g=K$(Object.entries(p),([y,_])=>`${s(y)}${c}${u(_)}`))===null||g===void 0?void 0:g.join(c):v=`${u(p)}`,v!=null&&(h=`${s(l)}=${v}`,!(!h||h==="=")&&(r+=`&${h}`)))}),r.slice(1)}}a(IJ,"formEncoder");var q$=IJ(",");function pi(t,e,n){if(typeof e>"u")return;let o=a(i=>(n==null?void 0:n.charEncoding)==="percent"?encodeURIComponent(i):i,"encodeString"),r=o(JSON.stringify(e,H$));return n!=null&&n.explode?r:`${o(t)}=${r}`}a(pi,"encodeJSON");var Ce=a((t,e,n)=>{let o="",r=n!=null&&n.explode?V$(t,e):[[t,e]];if(r.every(([u,c])=>c==null))return;let i=a(u=>(n==null?void 0:n.charEncoding)==="percent"?encodeURIComponent(u):u,"encodeString"),s=a(u=>i(Z$(u)),"encodeValue");return r.forEach(([u,c])=>{var l;let p="";if(c!=null){if(Array.isArray(c))p=(l=J$(c,d=>`${s(d)}`))===null||l===void 0?void 0:l.join(",");else if(cr(c)){let d=K$(Object.entries(c),([g,h])=>`,${i(g)},${s(h)}`);p=d==null?void 0:d.join("").slice(1)}else p=`${n!=null&&n.explode&&cr(e)?`${u}=`:""}${s(c)}`;o+=p?`,${p}`:""}}),o.slice(1)},"encodeSimple");function V$(t,e){if(Array.isArray(e))return e.map(n=>[t,n]);if(cr(e)){let n=e!=null?e:{};return Object.entries(n).map(([o,r])=>[o,r])}else return[[t,e]]}a(V$,"explode");function Z$(t){return t==null?"":t instanceof Date?t.toISOString():t instanceof Uint8Array?Fg(t):typeof t=="object"?JSON.stringify(t,H$):`${t}`}a(Z$,"serializeValue");function H$(t,e){return e instanceof Uint8Array?Fg(e):e}a(H$,"jsonReplacer");function J$(t,e){let n=t.reduce((o,r)=>{if(r==null)return o;let i=e(r);return i==null||o.push(i),o},[]);return n.length?n:null}a(J$,"mapDefined");function K$(t,e){let n=[];for(let[o,r]of t){if(r==null)continue;let i=e([o,r]);i!=null&&n.push(i)}return n.length?n:null}a(K$,"mapDefinedEntries");function AJ(...t){return t.filter(Boolean).join("&")}a(AJ,"queryJoin");function wJ(t){return a(function(n,o){var r,i,s;let u=Object.assign(Object.assign({},o),{explode:(r=o==null?void 0:o.explode)!==null&&r!==void 0?r:!0,charEncoding:(i=o==null?void 0:o.charEncoding)!==null&&i!==void 0?i:"percent"}),c=new Set((s=o==null?void 0:o.allowEmptyValue)!==null&&s!==void 0?s:[]),l=Object.entries(n).map(([p,d])=>c.has(p)&&(d==null||d===""||Array.isArray(d)&&d.length===0)?`${encodeURIComponent(p)}=`:t(p,d,u));return AJ(...l)},"bulkEncode")}a(wJ,"queryEncoder");var dc=wJ(q$);var bJ=a((t,e)=>e==null?fetch(t):fetch(t,e),"DEFAULT_FETCHER"),rc=class rc{constructor(e={}){this.options=e,this.requestHooks=[],this.requestErrorHooks=[],this.responseHooks=[],this.fetcher=e.fetcher||bJ}async request(e){let n=e;for(let o of this.requestHooks){let r=await o(n);r&&(n=r)}try{let o=await this.fetcher(n);for(let r of this.responseHooks)await r(o,n);return o}catch(o){for(let r of this.requestErrorHooks)await r(o,n);throw o}}addHook(...e){if(e[0]==="beforeRequest")this.requestHooks.push(e[1]);else if(e[0]==="requestError")this.requestErrorHooks.push(e[1]);else if(e[0]==="response")this.responseHooks.push(e[1]);else throw new Error(`Invalid hook type: ${e[0]}`);return this}removeHook(...e){let n;if(e[0]==="beforeRequest")n=this.requestHooks;else if(e[0]==="requestError")n=this.requestErrorHooks;else if(e[0]==="response")n=this.responseHooks;else throw new Error(`Invalid hook type: ${e[0]}`);let o=n.findIndex(r=>r===e[1]);return o>=0&&n.splice(o,1),this}clone(){let e=new rc(this.options);return e.requestHooks=this.requestHooks.slice(),e.requestErrorHooks=this.requestErrorHooks.slice(),e.responseHooks=this.responseHooks.slice(),e}};a(rc,"HTTPClient");var ug=rc,s$=/\s*;\s*/g;function jo(t,e){var n;if(e==="*")return!0;let o=((n=t.headers.get("content-type"))===null||n===void 0?void 0:n.trim())||"application/octet-stream";o=o.toLowerCase();let r=e.toLowerCase().trim().split(s$),[i="",...s]=r;if(i.split("/").length!==2)return!1;let u=o.split(s$),[c="",...l]=u,[p="",d=""]=c.split("/");if(!p||!d||i!=="*/*"&&c!==i&&`${p}/*`!==i&&`*/${d}`!==i||l.length<s.length)return!1;let g=new Set(l);for(let h of s)if(!g.has(h))return!1;return!0}a(jo,"matchContentType");var RJ=new RegExp("^[0-9]xx$","i");function Je(t,e){let n=`${t.status}`,o=Array.isArray(e)?e:[e];return o.length?o.some(r=>{let i=`${r}`;if(i==="default")return!0;if(!RJ.test(`${i}`))return i===n;let s=i.charAt(0);if(!s)throw new Error("Invalid status code range");let u=n.charAt(0);if(!u)throw new Error(`Invalid response status code: ${n}`);return u===s}):!1}a(Je,"matchStatusCode");function kJ(t,e,n){return Je(t,e)&&jo(t,n)}a(kJ,"matchResponse");function W$(t){if(typeof t!="object"||t==null)return!1;let e=t instanceof TypeError&&t.message.toLowerCase().startsWith("failed to fetch"),n=t instanceof TypeError&&t.message.toLowerCase().startsWith("fetch failed"),o="name"in t&&t.name==="ConnectionError",r="code"in t&&typeof t.code=="string"&&t.code.toLowerCase()==="econnreset";return e||n||r||o}a(W$,"isConnectionError");function j$(t){if(typeof t!="object"||t==null)return!1;let e="name"in t&&t.name==="TimeoutError",n="code"in t&&t.code===23,o="code"in t&&typeof t.code=="string"&&t.code.toLowerCase()==="econnaborted";return e||n||o}a(j$,"isTimeoutError");function PJ(t){if(typeof t!="object"||t==null)return!1;let e="name"in t&&t.name==="AbortError",n="code"in t&&t.code===20,o="code"in t&&typeof t.code=="string"&&t.code.toLowerCase()==="econnaborted";return e||n||o}a(PJ,"isAbortError");var a$={initialInterval:500,maxInterval:6e4,exponent:1.5,maxElapsedTime:36e5},oc=class oc extends Error{constructor(e,n){let o=e;n!=null&&n.cause&&(o+=`: ${n.cause}`),super(o,n),this.name="PermanentError",typeof this.cause>"u"&&(this.cause=n==null?void 0:n.cause),Object.setPrototypeOf(this,oc.prototype)}};a(oc,"PermanentError");var ra=oc,ic=class ic extends Error{constructor(e,n){super(e),this.response=n,this.name="TemporaryError",Object.setPrototypeOf(this,ic.prototype)}};a(ic,"TemporaryError");var dr=ic;async function NJ(t,e){var n;switch(e.config.strategy){case"backoff":return OJ(u$(t,{statusCodes:e.statusCodes,retryConnectionErrors:!!e.config.retryConnectionErrors}),(n=e.config.backoff)!==null&&n!==void 0?n:a$);case"attempt-count-backoff":return LJ(u$(t,{statusCodes:e.statusCodes,retryConnectionErrors:!!e.config.retryConnectionErrors}),Object.assign(Object.assign({},a$),e.config.backoff),e.config);default:return await t(0)}}a(NJ,"retry");function u$(t,e){return async n=>{try{let o=await t(n);if(DJ(o,e.statusCodes))throw new dr("Response failed with retryable status code",o);return o}catch(o){throw o instanceof dr||e.retryConnectionErrors&&(j$(o)||W$(o))?o:new ra("Permanent error",{cause:o})}}}a(u$,"wrapFetcher");var $J=new RegExp("^[0-9]xx$","i");function DJ(t,e){let n=`${t.status}`;return e.some(o=>{if(!$J.test(o))return o===n;let r=o.charAt(0);if(!r)throw new Error("Invalid status code range");let i=n.charAt(0);if(!i)throw new Error(`Invalid response status code: ${n}`);return i===r})}a(DJ,"isRetryableResponse");async function OJ(t,e){let{maxElapsedTime:n,initialInterval:o,exponent:r,maxInterval:i}=e,s=Date.now(),u=0;for(;;)try{return await t(u)}catch(c){if(c instanceof ra)throw c.cause;if(Date.now()-s>n){if(c instanceof dr)return c.response;throw c}let p=0;c instanceof dr&&(p=Y$(c.response)),p<=0&&(p=o*Math.pow(u,r)+Math.random()*1e3);let d=Math.min(p,i);await X$(d),u++}}a(OJ,"retryBackoff");async function LJ(t,e,n){let o=0;for(;;)try{return await t(o)}catch(r){if(r instanceof ra)throw r.cause;if(o>=n.maxRetries){if(r instanceof dr)return r.response;throw r}let i=0;r instanceof dr&&(i=Y$(r.response)),i<=0&&(i=e.initialInterval*Math.pow(e.exponent,o)*(1-Math.random()*.25));let s=Math.min(i,e.maxInterval);await X$(s),o++}}a(LJ,"retryAttemptCountBackoff");function Y$(t){let e=t.headers.get("retry-after-ms");if(e){let i=Number(e);if(Number.isFinite(i)&&i>=0)return i}let n=t.headers.get("retry-after")||"";if(!n)return 0;let o=Number(n);if(Number.isInteger(o))return o*1e3;let r=Date.parse(n);if(Number.isInteger(r)){let i=r-Date.now();return i>0?Math.ceil(i):0}return 0}a(Y$,"retryIntervalFromResponse");async function X$(t){return new Promise(e=>setTimeout(e,t))}a(X$,"delay");var Cl=typeof globalThis>"u"?null:globalThis,MJ=typeof Cl=="object"&&Cl!=null&&"importScripts"in Cl&&typeof Cl.importScripts=="function",UJ=MJ||typeof navigator<"u"&&"serviceWorker"in navigator||typeof window=="object"&&typeof window.document<"u",Xh=class Xh{constructor(e={}){let n=e;typeof n=="object"&&n!=null&&"hooks"in n&&n.hooks instanceof Jl?this._hooks=n.hooks:this._hooks=new Jl;let o=new ug;e.http_client=e.http_client||o,e=this._hooks.sdkInit(e);let r=EJ(e);r&&(r.pathname=r.pathname.replace(/\/+$/,"")+"/"),this._baseURL=r,this._httpClient=e.http_client||o,this._options=Object.assign(Object.assign({},tJ(e)),{hooks:this._hooks}),this._logger=this._options.debug_logger,!this._logger&&na().GOOGLE_GENAI_DEBUG&&(this._logger=console)}_createRequest(e,n,o){var r,i,s,u,c;let{method:l,path:p,query:d,headers:g,security:h}=n,v=(r=n.baseURL)!==null&&r!==void 0?r:this._baseURL;if(!v)return Un(new Xo("No base URL provided for operation"));let y=new URL(v),_;p?(y.pathname=y.pathname.replace(/\/+$/,"")+"/",_=new URL(p,y),!_.search&&y.search&&(_.search=y.search)):_=y,_.hash="";let x=a((P,O)=>{if(!O)return P;let X=new Set(O.split("&").filter(we=>we!=="").map(we=>{var de;return(de=we.split("=")[0])!==null&&de!==void 0?de:""}));return[...P.split("&").filter(we=>{var de;return we!==""&&!X.has((de=we.split("=")[0])!==null&&de!==void 0?de:"")}),O].join("&")},"mergeQuery"),E=a(P=>Object.entries(P).map(([O,X])=>{if(X==null)return;let Ae=cr(X)?JSON.stringify(X):X;return q$(O,Ae,{explode:Array.isArray(Ae),charEncoding:"percent"})}).filter(O=>typeof O<"u").join("&"),"encodeQueryRecord"),T=[d||"",E((o==null?void 0:o.extra_query)||{}),E((h==null?void 0:h.queryParams)||{})].reduce(x,_.search.slice(1));T&&(_.search=`?${T}`);let S=new Headers(g),I=h==null?void 0:h.basic.username,w=h==null?void 0:h.basic.password;if(I!=null||w!=null){let P=_J([I||"",w||""].join(":"));S.set("Authorization",`Basic ${P}`)}let b=new Headers((h==null?void 0:h.headers)||{});for(let[P,O]of b)S.set(P,O);let B=S.get("cookie")||"";for(let[P,O]of Object.entries((h==null?void 0:h.cookies)||{}))B+=`; ${P}=${O}`;B=B.startsWith("; ")?B.slice(2):B,S.set("cookie",B);let k=new Headers((i=o==null?void 0:o.headers)!==null&&i!==void 0?i:(s=o==null?void 0:o.fetch_options)===null||s===void 0?void 0:s.headers);for(let[P,O]of k)S.set(P,O);UJ||S.set((u=n.uaHeader)!==null&&u!==void 0?u:"user-agent",(c=n.userAgent)!==null&&c!==void 0?c:SJ.userAgent);let V=n.body,ce=Object.fromEntries(Object.entries((o==null?void 0:o.extra_body)||{}).filter(([,P])=>typeof P<"u"));if(Object.keys(ce).length>0){let P=new Headers(g).get("content-type")||"";if(!/^(application|text)\/([^+]+\+)*json/.test(P)||typeof V!="string"&&V!=null)return Un(new Xo("extra_body can only be merged into JSON object request bodies"));let X;try{X=V?JSON.parse(V):{}}catch(Ae){return Un(new Xo("extra_body can only be merged into JSON object request bodies",{cause:Ae}))}if(!cr(X))return Un(new Xo("extra_body can only be merged into JSON object request bodies"));V=JSON.stringify(Object.assign(Object.assign({},X),ce)),S.delete("content-length")}let Ee=Object.assign(Object.assign({},o==null?void 0:o.fetch_options),o);!(Ee!=null&&Ee.signal)&&n.timeout_ms!=null&&n.timeout_ms>0&&(e.timeout_ms=n.timeout_ms),n.body instanceof ReadableStream&&Object.assign(Ee,{duplex:"half"});let Ne;try{Ne=this._hooks.beforeCreateRequest(e,{url:_,options:Object.assign(Object.assign({},Ee),{body:V!=null?V:null,headers:S,method:l})})}catch(P){return Un(new ql("Create request hook failed to execute",{cause:P}))}return o$(new Request(Ne.url,Ne.options))}async _do(e,n){let{context:o,isErrorStatusCode:r}=n,i=o.timeout_ms;return NJ(async()=>{var s;let u=e.clone(),c=u;if(i!=null&&i>0){let d=AbortSignal.timeout(i),g=(s=TJ(u.signal,d))!==null&&s!==void 0?s:d;c=new Request(u,{signal:g})}let l=await this._hooks.beforeRequest(o,c);await FJ(this._logger,l).catch(d=>{var g;return(g=this._logger)===null||g===void 0?void 0:g.log("Failed to log request:",d)});let p=await this._httpClient.request(l);try{if(r(p.status)){let d=await this._hooks.afterError(o,p,null);if(d.error)throw d.error;p=d.response||p}else p=await this._hooks.afterSuccess(o,p)}finally{await zJ(this._logger,p,l).catch(d=>{var g;return(g=this._logger)===null||g===void 0?void 0:g.log("Failed to log response:",d)})}return p},{config:n.retryConfig,statusCodes:n.retryCodes}).then(s=>o$(s),s=>{switch(!0){case PJ(s):return Un(new Vl("Request aborted by client",{cause:s}));case j$(s):return Un(new Zl("Request timed out",{cause:s}));case W$(s):return Un(new Hl("Unable to make request",{cause:s}));default:return Un(new ql("Unexpected HTTP client error",{cause:s}))}})}};a(Xh,"ClientSDK");var ai=Xh,Q$=/^(application|text)\/([^+]+\+)*json.*/,l$=/^(application|text)\/([^+]+\+)*(jsonl|x-ndjson)\b.*/;async function FJ(t,e){if(!t)return;let n=e.headers.get("content-type"),o=(n==null?void 0:n.split(";")[0])||"";t.group(`> Request: ${e.method} ${e.url}`),t.group("Headers:");for(let[r,i]of e.headers.entries())t.log(`${r}: ${i}`);switch(t.groupEnd(),t.group("Body:"),!0){case Q$.test(o):t.log(await e.clone().json());break;case o.startsWith("text/"):t.log(await e.clone().text());break;case o==="multipart/form-data":{let r=await e.clone().formData();for(let[i,s]of r){let u=s instanceof Blob?"<Blob>":s;t.log(`${i}: ${u}`)}break}default:t.log(`<${n}>`);break}t.groupEnd(),t.groupEnd()}a(FJ,"logRequest");async function zJ(t,e,n){if(!t)return;let o=e.headers.get("content-type"),r=(o==null?void 0:o.split(";")[0])||"";t.group(`< Response: ${n.method} ${n.url}`),t.log("Status Code:",e.status,e.statusText),t.group("Headers:");for(let[i,s]of e.headers.entries())t.log(`${i}: ${s}`);switch(t.groupEnd(),t.group("Body:"),!0){case(jo(e,"application/json")||Q$.test(r)&&!l$.test(r)):t.log(await e.clone().json());break;case(jo(e,"application/jsonl")||l$.test(r)):case jo(e,"text/event-stream"):t.log(`<${o}>`);break;case jo(e,"text/*"):t.log(await e.clone().text());break;case jo(e,"multipart/form-data"):{let i=await e.clone().formData();for(let[s,u]of i){let c=u instanceof Blob?"<Blob>":u;t.log(`${s}: ${c}`)}break}default:t.log(`<${o}>`);break}t.groupEnd(),t.groupEnd()}a(zJ,"logResponse");var Qh=class Qh extends qt{constructor(e,n){e&&(e+=": "),e+=`Status ${n.response.status}`;let o=n.response.headers.get("content-type")||'""';o!=="application/json"&&(e+=` Content-Type ${o.includes(" ")?`"${o}"`:o}`);let r=n.body||'""';e+=r.length>100?`
12
+ `:". ";let i=r;if(r.length>1e4){let s=r.substring(0,1e4),u=r.length-1e4;i=`${s}...and ${u} more chars`}e+=`Body: ${i}`,e=e.trim(),super(e,n),this.name="GoogleGenAiDefaultError"}};a(Qh,"GoogleGenAiDefaultError");var Kl=Qh;function c$(t){try{return JSON.parse(t)}catch(e){return t}}a(c$,"tryParseJson");function GJ(t,e={}){var n,o;let r=e.flattened===!0,i=(n=e.sentinel)!==null&&n!==void 0?n:"";return new lg(t,s=>i!==""&&s.data===i?{done:!0,value:void 0}:r?{done:!1,value:s.data==null?void 0:c$(s.data)}:{done:!1,value:Object.assign(Object.assign({},s),{data:s.data==null?s.data:c$(s.data)})},{dataRequired:(o=e.dataRequired)!==null&&o!==void 0?o:!0})}a(GJ,"wrapEventStreamResponse");var ev=class ev extends ReadableStream{constructor(e,n,o){var r;let i=e.getReader(),s=new Uint8Array(4096),u=0,c=0,l={eventId:void 0},p=(r=o==null?void 0:o.dataRequired)!==null&&r!==void 0?r:!0;super({async pull(d){try{for(;;){let g=qJ(s,u,c);if(!g){c=Math.max(0,u-BJ+1);let y=await i.read();if(y.done)return d.close();if(u+y.value.length>s.length){let _=new Uint8Array(Math.max(s.length*2,u+y.value.length));_.set(s.subarray(0,u)),s=_}s.set(y.value,u),u+=y.value.length;continue}let h=s.slice(0,g.index);if(s.copyWithin(0,g.index+g.length,u),u-=g.index+g.length,s.length>4096&&u<=s.length>>2){let y=new Uint8Array(Math.max(4096,u*2));y.set(s.subarray(0,u)),s=y}c=0;let v=VJ(h,n,l,p);if(v&&!v.done)return d.enqueue(v.value);if(v!=null&&v.done)return await i.cancel("done"),d.close()}}catch(g){d.error(g),await i.cancel(g)}},cancel:a(d=>i.cancel(d),"cancel")})}[Symbol.asyncIterator](e){let n=ReadableStream.prototype[Symbol.asyncIterator];if(typeof n=="function")return n.call(this,e);let o=this.getReader(),r={next:a(async()=>{let s=await o.read();return s.done?(o.releaseLock(),{done:!0,value:void 0}):{done:!1,value:s.value}},"next"),throw:a(async s=>(await o.cancel(s),o.releaseLock(),{done:!0,value:void 0}),"throw"),return:a(async()=>(await o.cancel("done"),o.releaseLock(),{done:!0,value:void 0}),"return"),[Symbol.asyncIterator](){return this}},i=Symbol.asyncDispose;return i&&(r[i]=async()=>{var s;await((s=r.return)===null||s===void 0?void 0:s.call(r))}),r}values(e){return this[Symbol.asyncIterator](e)}};a(ev,"Stream");var lg=ev,Gt=13,Bt=10,e0=[[Gt,Bt,Gt,Bt],[Gt,Bt,Gt],[Gt,Bt,Bt],[Gt,Gt,Bt],[Bt,Gt,Bt],[Gt,Gt],[Bt,Gt],[Bt,Bt]],BJ=e0.reduce((t,e)=>Math.max(t,e.length),0);function qJ(t,e,n){for(let o=n;o<e;o++)if(!(t[o]!==Gt&&t[o]!==Bt))for(let r of e0){if(o+r.length>e)continue;let i=!0;for(let s=0;s<r.length;s++)if(t[o+s]!==r[s]){i=!1;break}if(i)return{index:o,length:r.length}}return null}a(qJ,"findBoundary");function VJ(t,e,n,o){let i=new TextDecoder().decode(t).split(/\r\n|\r|\n/),s=[],u={},c=!0;for(let l of i){if(!l||l.startsWith(":"))continue;c=!1;let p=l.indexOf(":"),d=l,g="";p>0&&(d=l.slice(0,p),g=l[p+1]===" "?l.slice(p+2):l.slice(p+1)),d==="data"?s.push(g):d==="event"?u.event=g:d==="id"&&!g.includes("\0")?n.eventId=g:d==="retry"&&/^\d+$/.test(g)&&(u.retry=Number(g))}if(!c){if(u.id=n.eventId,s.length)u.data=s.join(`
13
+ `);else if(o)return;return e(u)}}a(VJ,"parseMessage");var ZJ={jsonl:"application/jsonl",json:"application/json",text:"text/plain",bytes:"application/octet-stream",stream:"application/octet-stream",sse:"text/event-stream",nil:"*",fail:"*"};function fr(t,e,n){return Object.assign(Object.assign({},n),{err:!0,enc:"json",codes:t,errorClass:e})}a(fr,"jsonErr");function xt(t,e){return Object.assign(Object.assign({},e),{enc:"json",codes:t})}a(xt,"json");function t0(t,e,n){return Object.assign(Object.assign(Object.assign({},n),{enc:"sse",codes:t}),e?{sse:e}:{})}a(t0,"sse");function HJ(t,e){return Object.assign(Object.assign({},e),{enc:"nil",codes:t})}a(HJ,"nil");function ke(t){return{enc:"fail",codes:t}}a(ke,"fail");function st(...t){return a(async function(n,o,r){let i,s;for(let g of t){let{codes:h}=g,v="ctype"in g?g.ctype:ZJ[g.enc];if(v&&kJ(n,h,v)){s=g;break}else if(!v&&Je(n,h)){s=g;break}}if(!s)return[{ok:!1,error:new Kl("Unexpected Status or Content-Type",{response:n,request:o,body:await n.text().catch(()=>"")})},i];let u=s.enc,c="";switch(u){case"json":c=await n.text();try{i=JSON.parse(c)}catch(g){if(!("err"in s))throw g;i=c}break;case"jsonl":i=n.body;break;case"bytes":i=new Uint8Array(await n.arrayBuffer());break;case"stream":i=n.body;break;case"text":c=await n.text(),i=c;break;case"sse":if(n.body){let g="sse"in s&&s.sse||{};i=GJ(n.body,g)}else i=null;break;case"nil":c=await n.text(),i=void 0;break;case"fail":c=await n.text(),i=c;break;default:throw new Error(`Unsupported response type: ${u}`)}if(s.enc==="fail")return[{ok:!1,error:new Kl("API error occurred",{request:o,response:n,body:c})},i];let l=s.key||(r==null?void 0:r.resultKey),p,d=s.hdrs?{headers:KJ(n.headers)}:null;return"err"in s?p=Object.assign(Object.assign(Object.assign({},r==null?void 0:r.extraFields),d),cr(i)?i:null):l?p=Object.assign(Object.assign(Object.assign({},r==null?void 0:r.extraFields),d),{[l]:i}):s.hdrs?p=Object.assign(Object.assign(Object.assign({},r==null?void 0:r.extraFields),d),cr(i)?i:null):p=i,"err"in s?[{ok:!1,error:s.errorClass?new s.errorClass(p,{request:o,response:n,body:c}):p},i]:[{ok:!0,value:p},i]},"matchFunc")}a(st,"match");var JJ=/, */;function KJ(t){let e={};for(let[n,o]of t.entries())e[n]=o.split(JJ);return e}a(KJ,"unpackHeaders");var Wl;(function(t){t.Incomplete="incomplete",t.UnrecognisedSecurityType="unrecognized_security_type"})(Wl||(Wl={}));var ta=class ta extends Error{constructor(e,n){super(n),this.code=e,this.name="SecurityError"}static incomplete(){return new ta(Wl.Incomplete,"Security requirements not met in order to perform the operation")}static unrecognizedType(e){return new ta(Wl.UnrecognisedSecurityType,`Unrecognised security type: ${e}`)}};a(ta,"SecurityError");var cg=ta;function WJ(...t){let e={basic:{},headers:{},queryParams:{},cookies:{},oauth2:{type:"none"}},n=t.find(o=>o.every(r=>{if(r.value==null)return!1;if(r.type==="http:basic")return r.value.username!=null||r.value.password!=null;if(r.type==="http:custom")return null;if(r.type==="oauth2:password")return typeof r.value=="string"&&!!r.value;if(r.type==="oauth2:client_credentials")return typeof r.value=="string"?!!r.value:r.value.client_id!=null||r.value.client_secret!=null;if(typeof r.value=="string")return!!r.value;throw new Error(`Unrecognized security type: ${r.type} (value type: ${typeof r.value})`)}));return n==null?null:(n.forEach(o=>{if(o.value==null)return;let{type:r}=o;switch(r){case"apiKey:header":e.headers[o.fieldName]=o.value;break;case"apiKey:query":e.queryParams[o.fieldName]=o.value;break;case"apiKey:cookie":e.cookies[o.fieldName]=o.value;break;case"http:basic":jJ(e,o);break;case"http:custom":break;case"http:bearer":Il(e,o);break;case"oauth2":Il(e,o);break;case"oauth2:password":Il(e,o);break;case"oauth2:client_credentials":break;case"openIdConnect":Il(e,o);break;default:throw cg.unrecognizedType(r)}}),e)}a(WJ,"resolveSecurity");function jJ(t,e){e.value!=null&&(t.basic=e.value)}a(jJ,"applyBasic");function Il(t,e){if(typeof e.value!="string"||!e.value)return;let n=e.value;n.slice(0,7).toLowerCase()!=="bearer "&&(n=`Bearer ${n}`),e.fieldName!==void 0&&(t.headers[e.fieldName]=n)}a(Il,"applyBearer");function at(t,e){var n,o;let r=[[{fieldName:"apiKey",type:"http:custom",value:(n=t==null?void 0:t.api_key)!==null&&n!==void 0?n:na().GOOGLE_GENAI_API_KEY},{fieldName:"accessToken",type:"http:custom",value:(o=t==null?void 0:t.access_token)!==null&&o!==void 0?o:na().GOOGLE_GENAI_ACCESS_TOKEN},{fieldName:"defaultHeaders",type:"http:custom",value:t==null?void 0:t.default_headers}]];return WJ(...r)}a(at,"resolveGlobalSecurity");async function ut(t){if(t!=null)return typeof t=="function"?t():t}a(ut,"extractSecurity");var n0,sc=class sc{constructor(e,n){this[n0]="APIPromise",this._promise=e instanceof Promise?e:Promise.resolve(e),this._unwrapped=e instanceof Promise?null:Promise.resolve(e[0]),this._callSource=n!=null?n:null}_getUnwrapped(){var e;return(e=this._unwrapped)!==null&&e!==void 0?e:this._unwrapped=this._promise.then(([n])=>n)}then(e,n){return this._promise.then(e?([o])=>e(o):void 0,n)}catch(e){return this._getUnwrapped().catch(e)}finally(e){return this._getUnwrapped().finally(e)}$inspect(){return this._promise}asResponse(){var e;return((e=this._callSource)!==null&&e!==void 0?e:this._callSource=this._promise.then(([,o])=>o)).then(o=>{if(!o.response)throw new Error("APIPromise.asResponse: response unavailable");return o.response})}async withResponse(){let[[e],n]=await Promise.all([this._promise,this.asResponse()]);return{data:e,response:n}}_thenUnwrap(e){var n;let o=this._promise.then(([r,i])=>[e(r),i]);return o.catch(()=>{}),new sc(o,(n=this._callSource)!==null&&n!==void 0?n:void 0)}};a(sc,"APIPromise");var Be=sc;n0=Symbol.toStringTag;function ot(t){let e=t.$inspect(),n=e.then(([r,i])=>{if(!r.ok)throw r.error;return[r.value,i]}),o=e.then(([r,i])=>{var s;if(!r.ok&&!(!((s=i.response)===null||s===void 0)&&s.ok))throw r.error;return i});return n.catch(()=>{}),o.catch(()=>{}),new Be(n,o)}a(ot,"unwrapAsAPIPromise");function r0(t,e,n,o){return new Be(YJ(t,e,n,o))}a(r0,"agentsCreate");async function YJ(t,e,n,o){var r,i,s;let c={body:e,api_version:n},l=pi("body",c.body,{explode:!0}),p={api_version:Ce("api_version",(r=c.api_version)!==null&&r!==void 0?r:t._options.api_version,{explode:!1,charEncoding:"percent"})},d=Xe("/{api_version}/agents")(p),g=new Headers(it({"Content-Type":"application/json",Accept:"application/json"})),h=await ut(t._options.security),v=at(h),y={options:t._options,base_url:(s=(i=o==null?void 0:o.server_url)!==null&&i!==void 0?i:t._baseURL)!==null&&s!==void 0?s:"",operation_id:"CreateAgent",o_auth2_scopes:null,resolved_security:v,security_source:t._options.security,retry_config:(o==null?void 0:o.retries)||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:(o==null?void 0:o.retry_codes)||["408","409","429","5XX"]},_=t._createRequest(y,{security:v,method:"POST",baseURL:o==null?void 0:o.server_url,path:d,headers:g,body:l,userAgent:t._options.user_agent,timeout_ms:(o==null?void 0:o.timeout_ms)||t._options.timeout_ms||-1},o);if(!_.ok)return[_,{status:"invalid"}];let x=_.value,E=await t._do(x,{context:y,isErrorStatusCode:a(I=>Je({status:I},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:y.retry_config,retryCodes:y.retry_codes});if(!E.ok)return[E,{status:"request-error",request:x}];let T=E.value,[S]=await st(ke("4XX"),ke("5XX"),xt("default"))(T,x);return S.ok?[S,{status:"complete",request:x,response:T}]:[S,{status:"complete",request:x,response:T}]}a(YJ,"$do$e");function o0(t,e,n,o){return new Be(XJ(t,e,n,o))}a(o0,"agentsDelete");async function XJ(t,e,n,o){var r,i,s;let c={id:e,api_version:n},l=null,p={api_version:Ce("api_version",(r=c.api_version)!==null&&r!==void 0?r:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ce("id",c.id,{explode:!1,charEncoding:"percent"})},d=Xe("/{api_version}/agents/{id}")(p),g=new Headers(it({Accept:"application/json"})),h=await ut(t._options.security),v=at(h),y={options:t._options,base_url:(s=(i=o==null?void 0:o.server_url)!==null&&i!==void 0?i:t._baseURL)!==null&&s!==void 0?s:"",operation_id:"DeleteAgent",o_auth2_scopes:null,resolved_security:v,security_source:t._options.security,retry_config:(o==null?void 0:o.retries)||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:(o==null?void 0:o.retry_codes)||["408","409","429","5XX"]},_=t._createRequest(y,{security:v,method:"DELETE",baseURL:o==null?void 0:o.server_url,path:d,headers:g,body:l,userAgent:t._options.user_agent,timeout_ms:(o==null?void 0:o.timeout_ms)||t._options.timeout_ms||-1},o);if(!_.ok)return[_,{status:"invalid"}];let x=_.value,E=await t._do(x,{context:y,isErrorStatusCode:a(I=>Je({status:I},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:y.retry_config,retryCodes:y.retry_codes});if(!E.ok)return[E,{status:"request-error",request:x}];let T=E.value,[S]=await st(ke("4XX"),ke("5XX"),xt("default"))(T,x);return S.ok?[S,{status:"complete",request:x,response:T}]:[S,{status:"complete",request:x,response:T}]}a(XJ,"$do$d");function i0(t,e,n,o){return new Be(QJ(t,e,n,o))}a(i0,"agentsGet");async function QJ(t,e,n,o){var r,i,s;let c={id:e,api_version:n},l=null,p={api_version:Ce("api_version",(r=c.api_version)!==null&&r!==void 0?r:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ce("id",c.id,{explode:!1,charEncoding:"percent"})},d=Xe("/{api_version}/agents/{id}")(p),g=new Headers(it({Accept:"application/json"})),h=await ut(t._options.security),v=at(h),y={options:t._options,base_url:(s=(i=o==null?void 0:o.server_url)!==null&&i!==void 0?i:t._baseURL)!==null&&s!==void 0?s:"",operation_id:"GetAgent",o_auth2_scopes:null,resolved_security:v,security_source:t._options.security,retry_config:(o==null?void 0:o.retries)||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:(o==null?void 0:o.retry_codes)||["408","409","429","5XX"]},_=t._createRequest(y,{security:v,method:"GET",baseURL:o==null?void 0:o.server_url,path:d,headers:g,body:l,userAgent:t._options.user_agent,timeout_ms:(o==null?void 0:o.timeout_ms)||t._options.timeout_ms||-1},o);if(!_.ok)return[_,{status:"invalid"}];let x=_.value,E=await t._do(x,{context:y,isErrorStatusCode:a(I=>Je({status:I},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:y.retry_config,retryCodes:y.retry_codes});if(!E.ok)return[E,{status:"request-error",request:x}];let T=E.value,[S]=await st(ke("4XX"),ke("5XX"),xt("default"))(T,x);return S.ok?[S,{status:"complete",request:x,response:T}]:[S,{status:"complete",request:x,response:T}]}a(QJ,"$do$c");function s0(t,e,n,o,r,i){return new Be(eK(t,e,n,o,r,i))}a(s0,"agentsList");async function eK(t,e,n,o,r,i){var s,u,c;let p={api_version:e,page_size:n,page_token:o,parent:r},d=null,g={api_version:Ce("api_version",(s=p==null?void 0:p.api_version)!==null&&s!==void 0?s:t._options.api_version,{explode:!1,charEncoding:"percent"})},h=Xe("/{api_version}/agents")(g),v=dc({page_size:p==null?void 0:p.page_size,page_token:p==null?void 0:p.page_token,parent:p==null?void 0:p.parent}),y=new Headers(it({Accept:"application/json"})),_=await ut(t._options.security),x=at(_),E={options:t._options,base_url:(c=(u=i==null?void 0:i.server_url)!==null&&u!==void 0?u:t._baseURL)!==null&&c!==void 0?c:"",operation_id:"ListAgents",o_auth2_scopes:null,resolved_security:x,security_source:t._options.security,retry_config:(i==null?void 0:i.retries)||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:(i==null?void 0:i.retry_codes)||["408","409","429","5XX"]},T=t._createRequest(E,{security:x,method:"GET",baseURL:i==null?void 0:i.server_url,path:h,headers:y,query:v,body:d,userAgent:t._options.user_agent,timeout_ms:(i==null?void 0:i.timeout_ms)||t._options.timeout_ms||-1},i);if(!T.ok)return[T,{status:"invalid"}];let S=T.value,I=await t._do(S,{context:E,isErrorStatusCode:a(B=>Je({status:B},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:E.retry_config,retryCodes:E.retry_codes});if(!I.ok)return[I,{status:"request-error",request:S}];let w=I.value,[b]=await st(ke("4XX"),ke("5XX"),xt("default"))(w,S);return b.ok?[b,{status:"complete",request:S,response:w}]:[b,{status:"complete",request:S,response:w}]}a(eK,"$do$b");var tv=class tv extends ai{create(e,n){let{api_version:o}=e,r=Qt(e,["api_version"]);return ot(r0(this,r,o,n))}list(e,n){return ot(s0(this,e==null?void 0:e.api_version,e==null?void 0:e.page_size,e==null?void 0:e.page_token,e==null?void 0:e.parent,n))}get(e,n,o){return ot(i0(this,e,n==null?void 0:n.api_version,o))}delete(e,n,o){return ot(o0(this,e,n==null?void 0:n.api_version,o))}};a(tv,"Agents");var dg=tv;var nv=class nv extends qt{constructor(e,n){var o;let r=((o=e.error)===null||o===void 0?void 0:o.message)||`API error occurred: ${JSON.stringify(e)}`;super(r,n),this.data$=e,this.error=e.error,this.name="CancelInteractionByIdServerError"}};a(nv,"CancelInteractionByIdServerError");var fg=nv,rv=class rv extends qt{constructor(e,n){var o;let r=((o=e.error)===null||o===void 0?void 0:o.message)||`API error occurred: ${JSON.stringify(e)}`;super(r,n),this.data$=e,this.error=e.error,this.name="CancelInteractionByIdClientError"}};a(rv,"CancelInteractionByIdClientError");var pg=rv;var ov=class ov extends qt{constructor(e,n){var o;let r=((o=e.error)===null||o===void 0?void 0:o.message)||`API error occurred: ${JSON.stringify(e)}`;super(r,n),this.data$=e,this.error=e.error,this.name="CreateInteractionServerError"}};a(ov,"CreateInteractionServerError");var mg=ov,iv=class iv extends qt{constructor(e,n){var o;let r=((o=e.error)===null||o===void 0?void 0:o.message)||`API error occurred: ${JSON.stringify(e)}`;super(r,n),this.data$=e,this.error=e.error,this.name="CreateInteractionClientError"}};a(iv,"CreateInteractionClientError");var gg=iv;var sv=class sv extends qt{constructor(e,n){var o;let r=((o=e.error)===null||o===void 0?void 0:o.message)||`API error occurred: ${JSON.stringify(e)}`;super(r,n),this.data$=e,this.error=e.error,this.name="DeleteInteractionServerError"}};a(sv,"DeleteInteractionServerError");var hg=sv,av=class av extends qt{constructor(e,n){var o;let r=((o=e.error)===null||o===void 0?void 0:o.message)||`API error occurred: ${JSON.stringify(e)}`;super(r,n),this.data$=e,this.error=e.error,this.name="DeleteInteractionClientError"}};a(av,"DeleteInteractionClientError");var vg=av;var uv=class uv extends qt{constructor(e,n){var o;let r=((o=e.error)===null||o===void 0?void 0:o.message)||`API error occurred: ${JSON.stringify(e)}`;super(r,n),this.data$=e,this.error=e.error,this.name="GetInteractionByIdServerError"}};a(uv,"GetInteractionByIdServerError");var yg=uv,lv=class lv extends qt{constructor(e,n){var o;let r=((o=e.error)===null||o===void 0?void 0:o.message)||`API error occurred: ${JSON.stringify(e)}`;super(r,n),this.data$=e,this.error=e.error,this.name="GetInteractionByIdClientError"}};a(lv,"GetInteractionByIdClientError");var _g=lv;function a0(t,e,n,o){return new Be(tK(t,e,n,o))}a(a0,"interactionsCancel");async function tK(t,e,n,o){var r,i,s;let c={id:e,api_version:n},l=null,p={api_version:Ce("api_version",(r=c.api_version)!==null&&r!==void 0?r:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ce("id",c.id,{explode:!1,charEncoding:"percent"})},d=Xe("/{api_version}/interactions/{id}/cancel")(p),g=new Headers(it({Accept:"application/json"})),h=await ut(t._options.security),v=at(h),y={options:t._options,base_url:(s=(i=o==null?void 0:o.server_url)!==null&&i!==void 0?i:t._baseURL)!==null&&s!==void 0?s:"",operation_id:"cancelInteractionById",o_auth2_scopes:null,resolved_security:v,security_source:t._options.security,retry_config:(o==null?void 0:o.retries)||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:(o==null?void 0:o.retry_codes)||["408","409","429","5XX"]},_=t._createRequest(y,{security:v,method:"POST",baseURL:o==null?void 0:o.server_url,path:d,headers:g,body:l,userAgent:t._options.user_agent,timeout_ms:(o==null?void 0:o.timeout_ms)||t._options.timeout_ms||-1},o);if(!_.ok)return[_,{status:"invalid"}];let x=_.value,E=await t._do(x,{context:y,isErrorStatusCode:a(w=>Je({status:w},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:y.retry_config,retryCodes:y.retry_codes});if(!E.ok)return[E,{status:"request-error",request:x}];let T=E.value,S={httpMeta:{response:T,request:x}},[I]=await st(xt(200),fr("4XX",pg),fr("5XX",fg))(T,x,{extraFields:S});return I.ok?[I,{status:"complete",request:x,response:T}]:[I,{status:"complete",request:x,response:T}]}a(tK,"$do$a");function u0(t,e,n,o){return new Be(nK(t,e,n,o))}a(u0,"interactionsCreate");async function nK(t,e,n,o){var r,i,s,u;let c={body:e,api_version:n},l=c,p=pi("body",l.body,{explode:!0}),d={api_version:Ce("api_version",(r=l.api_version)!==null&&r!==void 0?r:t._options.api_version,{explode:!1,charEncoding:"percent"})},g=Xe("/{api_version}/interactions")(d),h=new Headers(it({"Content-Type":"application/json",Accept:!((i=c==null?void 0:c.body)===null||i===void 0)&&i.stream?"text/event-stream":"application/json"})),v=await ut(t._options.security),y=at(v),_={options:t._options,base_url:(u=(s=o==null?void 0:o.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&u!==void 0?u:"",operation_id:"CreateInteraction",o_auth2_scopes:null,resolved_security:y,security_source:t._options.security,retry_config:(o==null?void 0:o.retries)||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:(o==null?void 0:o.retry_codes)||["408","409","429","5XX"]},x=t._createRequest(_,{security:y,method:"POST",baseURL:o==null?void 0:o.server_url,path:g,headers:h,body:p,userAgent:t._options.user_agent,timeout_ms:(o==null?void 0:o.timeout_ms)||t._options.timeout_ms||-1},o);if(!x.ok)return[x,{status:"invalid"}];let E=x.value,T=await t._do(E,{context:_,isErrorStatusCode:a(b=>Je({status:b},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:_.retry_config,retryCodes:_.retry_codes});if(!T.ok)return[T,{status:"request-error",request:E}];let S=T.value,I={httpMeta:{response:S,request:E}},[w]=await st(xt(200),t0(200,{sentinel:"[DONE]",flattened:!0}),fr("4XX",gg),fr("5XX",mg))(S,E,{extraFields:I});return w.ok?[w,{status:"complete",request:E,response:S}]:[w,{status:"complete",request:E,response:S}]}a(nK,"$do$9");function rK(t,e,n,o){return new Be(oK(t,e,n,o))}a(rK,"interactionsDelete");async function oK(t,e,n,o){var r,i,s;let c={id:e,api_version:n},l=null,p={api_version:Ce("api_version",(r=c.api_version)!==null&&r!==void 0?r:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ce("id",c.id,{explode:!1,charEncoding:"percent"})},d=Xe("/{api_version}/interactions/{id}")(p),g=new Headers(it({Accept:"application/json"})),h=await ut(t._options.security),v=at(h),y={options:t._options,base_url:(s=(i=o==null?void 0:o.server_url)!==null&&i!==void 0?i:t._baseURL)!==null&&s!==void 0?s:"",operation_id:"deleteInteraction",o_auth2_scopes:null,resolved_security:v,security_source:t._options.security,retry_config:(o==null?void 0:o.retries)||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:(o==null?void 0:o.retry_codes)||["408","409","429","5XX"]},_=t._createRequest(y,{security:v,method:"DELETE",baseURL:o==null?void 0:o.server_url,path:d,headers:g,body:l,userAgent:t._options.user_agent,timeout_ms:(o==null?void 0:o.timeout_ms)||t._options.timeout_ms||-1},o);if(!_.ok)return[_,{status:"invalid"}];let x=_.value,E=await t._do(x,{context:y,isErrorStatusCode:a(w=>Je({status:w},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:y.retry_config,retryCodes:y.retry_codes});if(!E.ok)return[E,{status:"request-error",request:x}];let T=E.value,S={httpMeta:{response:T,request:x}},[I]=await st(HJ(200),fr("4XX",vg),fr("5XX",hg))(T,x,{extraFields:S});return I.ok?[I,{status:"complete",request:x,response:T}]:[I,{status:"complete",request:x,response:T}]}a(oK,"$do$8");function l0(t,e,n,o,r,i,s){return new Be(iK(t,e,n,o,r,i,s))}a(l0,"interactionsGet");async function iK(t,e,n,o,r,i,s){var u,c,l;let p={id:e,stream:n,last_event_id:o,include_input:r,api_version:i},d=p,g=null,h={api_version:Ce("api_version",(u=d.api_version)!==null&&u!==void 0?u:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ce("id",d.id,{explode:!1,charEncoding:"percent"})},v=Xe("/{api_version}/interactions/{id}")(h),y=dc({include_input:d.include_input,last_event_id:d.last_event_id,stream:d.stream}),_=new Headers(it({Accept:p!=null&&p.stream?"text/event-stream":"application/json"})),x=await ut(t._options.security),E=at(x),T={options:t._options,base_url:(l=(c=s==null?void 0:s.server_url)!==null&&c!==void 0?c:t._baseURL)!==null&&l!==void 0?l:"",operation_id:"getInteractionById",o_auth2_scopes:null,resolved_security:E,security_source:t._options.security,retry_config:(s==null?void 0:s.retries)||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:(s==null?void 0:s.retry_codes)||["408","409","429","5XX"]},S=t._createRequest(T,{security:E,method:"GET",baseURL:s==null?void 0:s.server_url,path:v,headers:_,query:y,body:g,userAgent:t._options.user_agent,timeout_ms:(s==null?void 0:s.timeout_ms)||t._options.timeout_ms||-1},s);if(!S.ok)return[S,{status:"invalid"}];let I=S.value,w=await t._do(I,{context:T,isErrorStatusCode:a(V=>Je({status:V},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:T.retry_config,retryCodes:T.retry_codes});if(!w.ok)return[w,{status:"request-error",request:I}];let b=w.value,B={httpMeta:{response:b,request:I}},[k]=await st(xt(200),t0(200,{sentinel:"[DONE]",flattened:!0}),fr("4XX",_g),fr("5XX",yg))(b,I,{extraFields:B});return k.ok?[k,{status:"complete",request:I,response:b}]:[k,{status:"complete",request:I,response:b}]}a(iK,"$do$7");var cv=class cv extends ai{create(e,n){let{api_version:o}=e,r=Qt(e,["api_version"]);return ot(u0(this,r,o,n))}get(e,n,o){return ot(l0(this,e,n==null?void 0:n.stream,n==null?void 0:n.last_event_id,n==null?void 0:n.include_input,n==null?void 0:n.api_version,o))}delete(e,n,o){return ot(rK(this,e,n==null?void 0:n.api_version,o))}cancel(e,n,o){return ot(a0(this,e,n==null?void 0:n.api_version,o))}};a(cv,"Interactions");var xg=cv;function c0(t,e,n,o){return new Be(sK(t,e,n,o))}a(c0,"webhooksCreate");async function sK(t,e,n,o){var r,i,s;let c={body:e,api_version:n},l=pi("body",c.body,{explode:!0}),p={api_version:Ce("api_version",(r=c.api_version)!==null&&r!==void 0?r:t._options.api_version,{explode:!1,charEncoding:"percent"})},d=Xe("/{api_version}/webhooks")(p),g=new Headers(it({"Content-Type":"application/json",Accept:"application/json"})),h=await ut(t._options.security),v=at(h),y={options:t._options,base_url:(s=(i=o==null?void 0:o.server_url)!==null&&i!==void 0?i:t._baseURL)!==null&&s!==void 0?s:"",operation_id:"CreateWebhook",o_auth2_scopes:null,resolved_security:v,security_source:t._options.security,retry_config:(o==null?void 0:o.retries)||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:(o==null?void 0:o.retry_codes)||["408","409","429","5XX"]},_=t._createRequest(y,{security:v,method:"POST",baseURL:o==null?void 0:o.server_url,path:d,headers:g,body:l,userAgent:t._options.user_agent,timeout_ms:(o==null?void 0:o.timeout_ms)||t._options.timeout_ms||-1},o);if(!_.ok)return[_,{status:"invalid"}];let x=_.value,E=await t._do(x,{context:y,isErrorStatusCode:a(I=>Je({status:I},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:y.retry_config,retryCodes:y.retry_codes});if(!E.ok)return[E,{status:"request-error",request:x}];let T=E.value,[S]=await st(ke("4XX"),ke("5XX"),xt("default"))(T,x);return S.ok?[S,{status:"complete",request:x,response:T}]:[S,{status:"complete",request:x,response:T}]}a(sK,"$do$6");function d0(t,e,n,o){return new Be(aK(t,e,n,o))}a(d0,"webhooksDelete");async function aK(t,e,n,o){var r,i,s;let c={id:e,api_version:n},l=null,p={api_version:Ce("api_version",(r=c.api_version)!==null&&r!==void 0?r:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ce("id",c.id,{explode:!1,charEncoding:"percent"})},d=Xe("/{api_version}/webhooks/{id}")(p),g=new Headers(it({Accept:"application/json"})),h=await ut(t._options.security),v=at(h),y={options:t._options,base_url:(s=(i=o==null?void 0:o.server_url)!==null&&i!==void 0?i:t._baseURL)!==null&&s!==void 0?s:"",operation_id:"DeleteWebhook",o_auth2_scopes:null,resolved_security:v,security_source:t._options.security,retry_config:(o==null?void 0:o.retries)||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:(o==null?void 0:o.retry_codes)||["408","409","429","5XX"]},_=t._createRequest(y,{security:v,method:"DELETE",baseURL:o==null?void 0:o.server_url,path:d,headers:g,body:l,userAgent:t._options.user_agent,timeout_ms:(o==null?void 0:o.timeout_ms)||t._options.timeout_ms||-1},o);if(!_.ok)return[_,{status:"invalid"}];let x=_.value,E=await t._do(x,{context:y,isErrorStatusCode:a(I=>Je({status:I},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:y.retry_config,retryCodes:y.retry_codes});if(!E.ok)return[E,{status:"request-error",request:x}];let T=E.value,[S]=await st(ke("4XX"),ke("5XX"),xt("default"))(T,x);return S.ok?[S,{status:"complete",request:x,response:T}]:[S,{status:"complete",request:x,response:T}]}a(aK,"$do$5");function f0(t,e,n,o){return new Be(uK(t,e,n,o))}a(f0,"webhooksGet");async function uK(t,e,n,o){var r,i,s;let c={id:e,api_version:n},l=null,p={api_version:Ce("api_version",(r=c.api_version)!==null&&r!==void 0?r:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ce("id",c.id,{explode:!1,charEncoding:"percent"})},d=Xe("/{api_version}/webhooks/{id}")(p),g=new Headers(it({Accept:"application/json"})),h=await ut(t._options.security),v=at(h),y={options:t._options,base_url:(s=(i=o==null?void 0:o.server_url)!==null&&i!==void 0?i:t._baseURL)!==null&&s!==void 0?s:"",operation_id:"GetWebhook",o_auth2_scopes:null,resolved_security:v,security_source:t._options.security,retry_config:(o==null?void 0:o.retries)||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:(o==null?void 0:o.retry_codes)||["408","409","429","5XX"]},_=t._createRequest(y,{security:v,method:"GET",baseURL:o==null?void 0:o.server_url,path:d,headers:g,body:l,userAgent:t._options.user_agent,timeout_ms:(o==null?void 0:o.timeout_ms)||t._options.timeout_ms||-1},o);if(!_.ok)return[_,{status:"invalid"}];let x=_.value,E=await t._do(x,{context:y,isErrorStatusCode:a(I=>Je({status:I},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:y.retry_config,retryCodes:y.retry_codes});if(!E.ok)return[E,{status:"request-error",request:x}];let T=E.value,[S]=await st(ke("4XX"),ke("5XX"),xt("default"))(T,x);return S.ok?[S,{status:"complete",request:x,response:T}]:[S,{status:"complete",request:x,response:T}]}a(uK,"$do$4");function p0(t,e,n,o,r){return new Be(lK(t,e,n,o,r))}a(p0,"webhooksList");async function lK(t,e,n,o,r){var i,s,u;let l={api_version:e,page_size:n,page_token:o},p=null,d={api_version:Ce("api_version",(i=l==null?void 0:l.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"})},g=Xe("/{api_version}/webhooks")(d),h=dc({page_size:l==null?void 0:l.page_size,page_token:l==null?void 0:l.page_token}),v=new Headers(it({Accept:"application/json"})),y=await ut(t._options.security),_=at(y),x={options:t._options,base_url:(u=(s=r==null?void 0:r.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&u!==void 0?u:"",operation_id:"ListWebhooks",o_auth2_scopes:null,resolved_security:_,security_source:t._options.security,retry_config:(r==null?void 0:r.retries)||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:(r==null?void 0:r.retry_codes)||["408","409","429","5XX"]},E=t._createRequest(x,{security:_,method:"GET",baseURL:r==null?void 0:r.server_url,path:g,headers:v,query:h,body:p,userAgent:t._options.user_agent,timeout_ms:(r==null?void 0:r.timeout_ms)||t._options.timeout_ms||-1},r);if(!E.ok)return[E,{status:"invalid"}];let T=E.value,S=await t._do(T,{context:x,isErrorStatusCode:a(b=>Je({status:b},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:x.retry_config,retryCodes:x.retry_codes});if(!S.ok)return[S,{status:"request-error",request:T}];let I=S.value,[w]=await st(ke("4XX"),ke("5XX"),xt("default"))(I,T);return w.ok?[w,{status:"complete",request:T,response:I}]:[w,{status:"complete",request:T,response:I}]}a(lK,"$do$3");function m0(t,e,n,o,r){return new Be(cK(t,e,n,o,r))}a(m0,"webhooksPing");async function cK(t,e,n,o,r){var i,s,u;let l={id:e,api_version:n,body:o},p=pi("body",l.body,{explode:!0}),d={api_version:Ce("api_version",(i=l.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ce("id",l.id,{explode:!1,charEncoding:"percent"})},g=Xe("/{api_version}/webhooks/{id}:ping")(d),h=new Headers(it({"Content-Type":"application/json",Accept:"application/json"})),v=await ut(t._options.security),y=at(v),_={options:t._options,base_url:(u=(s=r==null?void 0:r.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&u!==void 0?u:"",operation_id:"PingWebhook",o_auth2_scopes:null,resolved_security:y,security_source:t._options.security,retry_config:(r==null?void 0:r.retries)||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:(r==null?void 0:r.retry_codes)||["408","409","429","5XX"]},x=t._createRequest(_,{security:y,method:"POST",baseURL:r==null?void 0:r.server_url,path:g,headers:h,body:p,userAgent:t._options.user_agent,timeout_ms:(r==null?void 0:r.timeout_ms)||t._options.timeout_ms||-1},r);if(!x.ok)return[x,{status:"invalid"}];let E=x.value,T=await t._do(E,{context:_,isErrorStatusCode:a(w=>Je({status:w},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:_.retry_config,retryCodes:_.retry_codes});if(!T.ok)return[T,{status:"request-error",request:E}];let S=T.value,[I]=await st(ke("4XX"),ke("5XX"),xt("default"))(S,E);return I.ok?[I,{status:"complete",request:E,response:S}]:[I,{status:"complete",request:E,response:S}]}a(cK,"$do$2");function g0(t,e,n,o,r){return new Be(dK(t,e,n,o,r))}a(g0,"webhooksRotateSigningSecret");async function dK(t,e,n,o,r){var i,s,u;let l={id:e,api_version:n,body:o},p=pi("body",l.body,{explode:!0}),d={api_version:Ce("api_version",(i=l.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ce("id",l.id,{explode:!1,charEncoding:"percent"})},g=Xe("/{api_version}/webhooks/{id}:rotateSigningSecret")(d),h=new Headers(it({"Content-Type":"application/json",Accept:"application/json"})),v=await ut(t._options.security),y=at(v),_={options:t._options,base_url:(u=(s=r==null?void 0:r.server_url)!==null&&s!==void 0?s:t._baseURL)!==null&&u!==void 0?u:"",operation_id:"RotateSigningSecret",o_auth2_scopes:null,resolved_security:y,security_source:t._options.security,retry_config:(r==null?void 0:r.retries)||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:(r==null?void 0:r.retry_codes)||["408","409","429","5XX"]},x=t._createRequest(_,{security:y,method:"POST",baseURL:r==null?void 0:r.server_url,path:g,headers:h,body:p,userAgent:t._options.user_agent,timeout_ms:(r==null?void 0:r.timeout_ms)||t._options.timeout_ms||-1},r);if(!x.ok)return[x,{status:"invalid"}];let E=x.value,T=await t._do(E,{context:_,isErrorStatusCode:a(w=>Je({status:w},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:_.retry_config,retryCodes:_.retry_codes});if(!T.ok)return[T,{status:"request-error",request:E}];let S=T.value,[I]=await st(ke("4XX"),ke("5XX"),xt("default"))(S,E);return I.ok?[I,{status:"complete",request:E,response:S}]:[I,{status:"complete",request:E,response:S}]}a(dK,"$do$1");function h0(t,e,n,o,r,i){return new Be(fK(t,e,n,o,r,i))}a(h0,"webhooksUpdate");async function fK(t,e,n,o,r,i){var s,u,c;let p={id:e,api_version:n,update_mask:o,body:r},d=pi("body",p.body,{explode:!0}),g={api_version:Ce("api_version",(s=p.api_version)!==null&&s!==void 0?s:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ce("id",p.id,{explode:!1,charEncoding:"percent"})},h=Xe("/{api_version}/webhooks/{id}")(g),v=dc({update_mask:p.update_mask}),y=new Headers(it({"Content-Type":"application/json",Accept:"application/json"})),_=await ut(t._options.security),x=at(_),E={options:t._options,base_url:(c=(u=i==null?void 0:i.server_url)!==null&&u!==void 0?u:t._baseURL)!==null&&c!==void 0?c:"",operation_id:"UpdateWebhook",o_auth2_scopes:null,resolved_security:x,security_source:t._options.security,retry_config:(i==null?void 0:i.retries)||t._options.retry_config||{strategy:"attempt-count-backoff",backoff:{initialInterval:500,maxInterval:8e3,exponent:2,maxElapsedTime:3e4},retryConnectionErrors:!0,maxRetries:4},retry_codes:(i==null?void 0:i.retry_codes)||["408","409","429","5XX"]},T=t._createRequest(E,{security:x,method:"PATCH",baseURL:i==null?void 0:i.server_url,path:h,headers:y,query:v,body:d,userAgent:t._options.user_agent,timeout_ms:(i==null?void 0:i.timeout_ms)||t._options.timeout_ms||-1},i);if(!T.ok)return[T,{status:"invalid"}];let S=T.value,I=await t._do(S,{context:E,isErrorStatusCode:a(B=>Je({status:B},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:E.retry_config,retryCodes:E.retry_codes});if(!I.ok)return[I,{status:"request-error",request:S}];let w=I.value,[b]=await st(ke("4XX"),ke("5XX"),xt("default"))(w,S);return b.ok?[b,{status:"complete",request:S,response:w}]:[b,{status:"complete",request:S,response:w}]}a(fK,"$do");var dv=class dv extends ai{create(e,n){let{api_version:o}=e,r=Qt(e,["api_version"]);return ot(c0(this,r,o,n))}list(e,n){return ot(p0(this,e==null?void 0:e.api_version,e==null?void 0:e.page_size,e==null?void 0:e.page_token,n))}get(e,n,o){return ot(f0(this,e,n==null?void 0:n.api_version,o))}update(e,n,o){let r=n!=null?n:{},{api_version:i,update_mask:s}=r,u=Qt(r,["api_version","update_mask"]),c=n===void 0||Object.keys(u).length===0?void 0:u;return ot(h0(this,e,i,s,c,o))}delete(e,n,o){return ot(d0(this,e,n==null?void 0:n.api_version,o))}rotateSigningSecret(e,n,o,r){return ot(g0(this,e,n,o,r))}ping(e,n,o,r){return ot(m0(this,e,n,o,r))}};a(dv,"Webhooks");var Eg=dv;var ri,pK=(ri=class extends ai{get interactions(){var e;return(e=this._interactions)!==null&&e!==void 0?e:this._interactions=new xg(this._options)}get webhooks(){var e;return(e=this._webhooks)!==null&&e!==void 0?e:this._webhooks=new Eg(this._options)}get agents(){var e;return(e=this._agents)!==null&&e!==void 0?e:this._agents=new dg(this._options)}},a(ri,"GoogleGenAI"),ri);var mK=new Set(["lyria-3-pro-preview","lyria-3-clip-preview"]);function gK(t){let e=t.getBaseUrl();if(!e)throw new Error("Base URL must be set.");return e.replace(/\/+$/,"")}a(gK,"getGoogleGenAIServerURL");function hK(t){let e=vK(t.getApiVersion()),n=t.getProject(),o=t.getLocation();return t.isVertexAI()&&e&&n&&o?`${e}/projects/${encodeURIComponent(n)}/locations/${encodeURIComponent(o)}`:e}a(hK,"getGoogleGenAIAPIVersion");function ui(t,e={}){var n,o,r,i;return new pK(Object.assign(Object.assign({},e),{api_version:(n=e.api_version)!==null&&n!==void 0?n:hK(t),security:(o=e.security)!==null&&o!==void 0?o:new Wm({defaultHeaders:(r=t.getDefaultHeaders)===null||r===void 0?void 0:r.call(t),getAuthHeaders:a(u=>t.getAuthHeaders(u),"getAuthHeaders")}),server_url:(i=e.server_url)!==null&&i!==void 0?i:gK(t)}))}a(ui,"buildGoogleGenAIClient");var fv=class fv{constructor(e){this.parentClient=e}async create(e,n){let{api_version:o}=e,r=Qt(e,["api_version"]);if(r.stream===!0){let s=await im(()=>this.getClient(o).interactions.create(Object.assign(Object.assign({},r),{stream:!0,api_version:o}),He(n,!0)));return f$(s)}let i=await vt(u0(this.getClient(o),r,o,He(n)));return sm(i)}async get(e,n={},o){let{api_version:r,stream:i=!1,last_event_id:s,include_input:u}=n!=null?n:{};if(i===!0){let l=await im(()=>this.getClient(r).interactions.get(e,{stream:i,last_event_id:s,include_input:u,api_version:r},He(o,!0)));return f$(l)}let c=await vt(l0(this.getClient(r),e,i,s,u,r,He(o)));return sm(c)}async delete(e,n={},o){return im(()=>this.getClient(n==null?void 0:n.api_version).interactions.delete(e,{api_version:n==null?void 0:n.api_version},He(o)))}async cancel(e,n={},o){return sm(await vt(a0(this.getClient(n==null?void 0:n.api_version),e,n==null?void 0:n.api_version,He(o))))}getClient(e){var n;return e?ui(this.parentClient,{api_version:e}):((n=this.sdk)!==null&&n!==void 0||(this.sdk=ui(this.parentClient)),this.sdk)}};a(fv,"GeminiNextGenInteractions");var Sg=fv,pv=class pv{constructor(e){this.parentClient=e}async create(e={},n){let o=e!=null?e:{},{api_version:r}=o,i=Qt(o,["api_version"]);return vt(r0(this.getClient(r),i,r,He(n)))}async list(e={},n){let{api_version:o,pageSize:r,pageToken:i,parent:s}=e!=null?e:{};return vt(s0(this.getClient(o),o,r,i,s,He(n)))}async get(e,n={},o){return vt(i0(this.getClient(n==null?void 0:n.api_version),e,n==null?void 0:n.api_version,He(o)))}async delete(e,n={},o){return vt(o0(this.getClient(n==null?void 0:n.api_version),e,n==null?void 0:n.api_version,He(o)))}getClient(e){var n;return e?ui(this.parentClient,{api_version:e}):((n=this.sdk)!==null&&n!==void 0||(this.sdk=ui(this.parentClient)),this.sdk)}};a(pv,"GeminiNextGenAgents");var Tg=pv,mv=class mv{constructor(e){this.parentClient=e}async create(e,n){let{api_version:o}=e,r=Qt(e,["api_version"]);return vt(c0(this.getClient(),r,o,He(n)))}async list(e={},n){let{api_version:o,page_size:r,page_token:i}=e!=null?e:{};return vt(p0(this.getClient(),o,r,i,He(n)))}async get(e,n={},o){return vt(f0(this.getClient(),e,n==null?void 0:n.api_version,He(o)))}async update(e,n={},o){let r=n!=null?n:{},{api_version:i,update_mask:s}=r,u=Qt(r,["api_version","update_mask"]);return vt(h0(this.getClient(),e,i,s,u,He(o)))}async delete(e,n={},o){return vt(d0(this.getClient(),e,n==null?void 0:n.api_version,He(o)))}async rotateSigningSecret(e,n={},o){let r=n!=null?n:{},{api_version:i}=r,s=Qt(r,["api_version"]);return vt(g0(this.getClient(),e,i,s,He(o)))}async ping(e,n=void 0,o){let{api_version:r,body:i}=n!=null?n:{};return vt(m0(this.getClient(),e,r,i,He(o)))}getClient(){var e;return(e=this.sdk)!==null&&e!==void 0||(this.sdk=ui(this.parentClient)),this.sdk}};a(mv,"GeminiNextGenWebhooks");var Cg=mv;function vK(t){return t.replace(/^\/+|\/+$/g,"")}a(vK,"trimSlashes");function He(t,e=!1){var n,o,r,i;if(!t&&!e)return;let s=t!=null?t:{},{timeout:u,maxRetries:c,defaultBaseURL:l,query:p,body:d,fetchOptions:g}=s,h=Qt(s,["timeout","maxRetries","defaultBaseURL","query","body","fetchOptions"]),v=Object.assign({},h);jl(p)?v.extra_query=p:d$("query",p),jl(d)?v.extra_body=d:d$("body",d);let y=(n=h.fetch_options)!==null&&n!==void 0?n:g;y&&(v.fetch_options=y);let _=(o=h.server_url)!==null&&o!==void 0?o:l;_&&(v.server_url=_);let x=(r=h.timeout_ms)!==null&&r!==void 0?r:u;if(x!==void 0&&(v.timeout_ms=x),c!==void 0&&(v.retries={strategy:"attempt-count-backoff",retryConnectionErrors:!0,maxRetries:c}),e){let E=new Headers((i=v.headers)!==null&&i!==void 0?i:y==null?void 0:y.headers);E.set("Accept","text/event-stream"),v.headers=E}return v}a(He,"toGoogleGenAIRequestOptions");function d$(t,e){e!=null&&console.warn(`GoogleGenAI.interactions: request option ${t} is not supported by the Google GenAI interactions bridge and will be ignored.`)}a(d$,"warnIgnoredOption");async function vt(t){let[e,n]=await t.$inspect();if(!e.ok)throw Qo(e.error);return yK(e.value,n)}a(vt,"unwrapWithSdkHttpResponse");async function im(t){try{return await t()}catch(e){throw Qo(e)}}a(im,"wrapSDKCall");function f$(t){let e=t;return new Proxy(t,{get(n,o){if(o!==Symbol.asyncIterator){let r=Reflect.get(n,o,n);return typeof r=="function"?r.bind(n):r}return a(function(){let i=e[Symbol.asyncIterator]();return{async next(...s){try{return await i.next(...s)}catch(u){throw Qo(u)}},async return(s){if(!i.return)return{done:!0,value:s};try{return await i.return(s)}catch(u){throw Qo(u)}},async throw(s){if(!i.throw)throw Qo(s);try{return await i.throw(s)}catch(u){throw Qo(u)}},[Symbol.asyncIterator](){return this}}},"wrappedAsyncIterator")}})}a(f$,"wrapStreamErrors");function yK(t,e){return!jl(t)||e.status!=="complete"?t:Object.assign(Object.assign({},t),{sdkHttpResponse:_K(e.response,t)})}a(yK,"attachSdkHttpResponse");function _K(t,e){let n={};for(let[o,r]of t.headers.entries())n[o]=r;return{headers:n,responseInternal:t,json:a(async()=>e,"json")}}a(_K,"createSdkHttpResponse");function sm(t){let e=xK(t);return e?SK(e):t}a(sm,"addOutputPropertiesIfInteraction");function xK(t){if(jl(t)){if(Array.isArray(t.steps))return t;if(EK(t)){let e=t.outputs;if(Array.isArray(e)){let{outputs:n}=t,o=Qt(t,["outputs"]);return Object.assign(Object.assign({},o),{steps:[{type:"model_output",content:e}]})}}return Object.assign(Object.assign({},t),{steps:[]})}}a(xK,"normalizeInteractionShape");function EK(t){let e=t.model;return typeof e=="string"&&mK.has(e)}a(EK,"isLegacyLyriaInteraction");function jl(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(jl,"isPlainObject");function SK(t){var e,n;let o=TK(t),r=(e=o.steps)!==null&&e!==void 0?e:[],i=[],s=!1;e:for(let d=r.length-1;d>=0;d--){let g=r[d];if(g.type==="user_input")break;if(g.type!=="model_output"||!g.content){if(s)break;continue}let h=g.content;for(let v=h.length-1;v>=0;v--){let y=h[v];if(y.type==="text")s=!0,i.push((n=y.text)!==null&&n!==void 0?n:"");else if(s)break e}}let u,c,l;for(let d=r.length-1;d>=0;d--){let g=r[d];if(g.type==="user_input")break;if(g.type==="model_output"&&g.content)for(let h=g.content.length-1;h>=0;h--){let v=g.content[h];v.type==="image"&&!u&&(u=v),v.type==="audio"&&!c&&(c=v),v.type==="video"&&!l&&(l=v)}}let p=i.reverse().join("");return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},o),p&&{output_text:p}),u?{output_image:u}:{}),c?{output_audio:c}:{}),l?{output_video:l}:{})}a(SK,"addOutputProperties");function TK(t){return Object.assign(Object.assign({},t),{created:p$(t.created),updated:p$(t.updated)})}a(TK,"normalizeInteractionDates");function p$(t){return t instanceof Date?t.toISOString():t}a(p$,"normalizeDateLike");function CK(t,e){let n={},o=f(t,["name"]);return o!=null&&m(n,["_url","name"],o),n}a(CK,"cancelTuningJobParametersToMldev");function IK(t,e){let n={},o=f(t,["name"]);return o!=null&&m(n,["_url","name"],o),n}a(IK,"cancelTuningJobParametersToVertex");function AK(t,e){let n={},o=f(t,["sdkHttpResponse"]);return o!=null&&m(n,["sdkHttpResponse"],o),n}a(AK,"cancelTuningJobResponseFromMldev");function wK(t,e){let n={},o=f(t,["sdkHttpResponse"]);return o!=null&&m(n,["sdkHttpResponse"],o),n}a(wK,"cancelTuningJobResponseFromVertex");function bK(t,e){let n={},o=f(t,["outcome"]);o!=null&&m(n,["outcome"],o);let r=f(t,["output"]);if(r!=null&&m(n,["output"],r),f(t,["id"])!==void 0)throw new Error("id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return n}a(bK,"codeExecutionResultToVertex");function Ig(t,e){let n={},o=f(t,["parts"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>BK(s))),m(n,["parts"],i)}let r=f(t,["role"]);return r!=null&&m(n,["role"],r),n}a(Ig,"contentToVertex");function RK(t,e,n){let o={};if(f(t,["validationDataset"])!==void 0)throw new Error("validationDataset parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let r=f(t,["tunedModelDisplayName"]);if(e!==void 0&&r!=null&&m(e,["displayName"],r),f(t,["description"])!==void 0)throw new Error("description parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let i=f(t,["epochCount"]);e!==void 0&&i!=null&&m(e,["tuningTask","hyperparameters","epochCount"],i);let s=f(t,["learningRateMultiplier"]);if(s!=null&&m(o,["tuningTask","hyperparameters","learningRateMultiplier"],s),f(t,["exportLastCheckpointOnly"])!==void 0)throw new Error("exportLastCheckpointOnly parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["preTunedModelCheckpointId"])!==void 0)throw new Error("preTunedModelCheckpointId parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["adapterSize"])!==void 0)throw new Error("adapterSize parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["tuningMode"])!==void 0)throw new Error("tuningMode parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["customBaseModel"])!==void 0)throw new Error("customBaseModel parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let u=f(t,["batchSize"]);e!==void 0&&u!=null&&m(e,["tuningTask","hyperparameters","batchSize"],u);let c=f(t,["learningRate"]);if(e!==void 0&&c!=null&&m(e,["tuningTask","hyperparameters","learningRate"],c),f(t,["labels"])!==void 0)throw new Error("labels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["beta"])!==void 0)throw new Error("beta parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["baseTeacherModel"])!==void 0)throw new Error("baseTeacherModel parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["tunedTeacherModelSource"])!==void 0)throw new Error("tunedTeacherModelSource parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["sftLossWeightMultiplier"])!==void 0)throw new Error("sftLossWeightMultiplier parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["outputUri"])!==void 0)throw new Error("outputUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["encryptionSpec"])!==void 0)throw new Error("encryptionSpec parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["rewardConfig"])!==void 0)throw new Error("rewardConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["compositeRewardConfig"])!==void 0)throw new Error("compositeRewardConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["samplesPerPrompt"])!==void 0)throw new Error("samplesPerPrompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["evaluateInterval"])!==void 0)throw new Error("evaluateInterval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["checkpointInterval"])!==void 0)throw new Error("checkpointInterval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["maxOutputTokens"])!==void 0)throw new Error("maxOutputTokens parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["thinkingLevel"])!==void 0)throw new Error("thinkingLevel parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["validationDatasetUri"])!==void 0)throw new Error("validationDatasetUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");return o}a(RK,"createTuningJobConfigToMldev");function kK(t,e,n){let o={},r=f(n,["config","method"]);if(r===void 0&&(r="SUPERVISED_FINE_TUNING"),r==="SUPERVISED_FINE_TUNING"){let P=f(t,["validationDataset"]);e!==void 0&&P!=null&&m(e,["supervisedTuningSpec"],Al(P))}else if(r==="PREFERENCE_TUNING"){let P=f(t,["validationDataset"]);e!==void 0&&P!=null&&m(e,["preferenceOptimizationSpec"],Al(P))}else if(r==="DISTILLATION"){let P=f(t,["validationDataset"]);e!==void 0&&P!=null&&m(e,["distillationSpec"],Al(P))}else if(r==="REINFORCEMENT_TUNING"){let P=f(t,["validationDataset"]);e!==void 0&&P!=null&&m(e,["reinforcementTuningSpec"],Al(P))}let i=f(t,["tunedModelDisplayName"]);e!==void 0&&i!=null&&m(e,["tunedModelDisplayName"],i);let s=f(t,["description"]);e!==void 0&&s!=null&&m(e,["description"],s);let u=f(n,["config","method"]);if(u===void 0&&(u="SUPERVISED_FINE_TUNING"),u==="SUPERVISED_FINE_TUNING"){let P=f(t,["epochCount"]);e!==void 0&&P!=null&&m(e,["supervisedTuningSpec","hyperParameters","epochCount"],P)}else if(u==="PREFERENCE_TUNING"){let P=f(t,["epochCount"]);e!==void 0&&P!=null&&m(e,["preferenceOptimizationSpec","hyperParameters","epochCount"],P)}else if(u==="DISTILLATION"){let P=f(t,["epochCount"]);e!==void 0&&P!=null&&m(e,["distillationSpec","hyperParameters","epochCount"],P)}else if(u==="REINFORCEMENT_TUNING"){let P=f(t,["epochCount"]);e!==void 0&&P!=null&&m(e,["reinforcementTuningSpec","hyperParameters","epochCount"],P)}let c=f(n,["config","method"]);if(c===void 0&&(c="SUPERVISED_FINE_TUNING"),c==="SUPERVISED_FINE_TUNING"){let P=f(t,["learningRateMultiplier"]);e!==void 0&&P!=null&&m(e,["supervisedTuningSpec","hyperParameters","learningRateMultiplier"],P)}else if(c==="PREFERENCE_TUNING"){let P=f(t,["learningRateMultiplier"]);e!==void 0&&P!=null&&m(e,["preferenceOptimizationSpec","hyperParameters","learningRateMultiplier"],P)}else if(c==="DISTILLATION"){let P=f(t,["learningRateMultiplier"]);e!==void 0&&P!=null&&m(e,["distillationSpec","hyperParameters","learningRateMultiplier"],P)}else if(c==="REINFORCEMENT_TUNING"){let P=f(t,["learningRateMultiplier"]);e!==void 0&&P!=null&&m(e,["reinforcementTuningSpec","hyperParameters","learningRateMultiplier"],P)}let l=f(n,["config","method"]);if(l===void 0&&(l="SUPERVISED_FINE_TUNING"),l==="SUPERVISED_FINE_TUNING"){let P=f(t,["exportLastCheckpointOnly"]);e!==void 0&&P!=null&&m(e,["supervisedTuningSpec","exportLastCheckpointOnly"],P)}else if(l==="PREFERENCE_TUNING"){let P=f(t,["exportLastCheckpointOnly"]);e!==void 0&&P!=null&&m(e,["preferenceOptimizationSpec","exportLastCheckpointOnly"],P)}else if(l==="DISTILLATION"){let P=f(t,["exportLastCheckpointOnly"]);e!==void 0&&P!=null&&m(e,["distillationSpec","exportLastCheckpointOnly"],P)}let p=f(n,["config","method"]);if(p===void 0&&(p="SUPERVISED_FINE_TUNING"),p==="SUPERVISED_FINE_TUNING"){let P=f(t,["adapterSize"]);e!==void 0&&P!=null&&m(e,["supervisedTuningSpec","hyperParameters","adapterSize"],P)}else if(p==="PREFERENCE_TUNING"){let P=f(t,["adapterSize"]);e!==void 0&&P!=null&&m(e,["preferenceOptimizationSpec","hyperParameters","adapterSize"],P)}else if(p==="DISTILLATION"){let P=f(t,["adapterSize"]);e!==void 0&&P!=null&&m(e,["distillationSpec","hyperParameters","adapterSize"],P)}else if(p==="REINFORCEMENT_TUNING"){let P=f(t,["adapterSize"]);e!==void 0&&P!=null&&m(e,["reinforcementTuningSpec","hyperParameters","adapterSize"],P)}let d=f(n,["config","method"]);if(d===void 0&&(d="SUPERVISED_FINE_TUNING"),d==="SUPERVISED_FINE_TUNING"){let P=f(t,["tuningMode"]);e!==void 0&&P!=null&&m(e,["supervisedTuningSpec","tuningMode"],P)}else if(d==="DISTILLATION"){let P=f(t,["tuningMode"]);e!==void 0&&P!=null&&m(e,["distillationSpec","tuningMode"],P)}let g=f(t,["customBaseModel"]);e!==void 0&&g!=null&&m(e,["customBaseModel"],g);let h=f(n,["config","method"]);if(h===void 0&&(h="SUPERVISED_FINE_TUNING"),h==="SUPERVISED_FINE_TUNING"){let P=f(t,["batchSize"]);e!==void 0&&P!=null&&m(e,["supervisedTuningSpec","hyperParameters","batchSize"],P)}else if(h==="DISTILLATION"){let P=f(t,["batchSize"]);e!==void 0&&P!=null&&m(e,["distillationSpec","hyperParameters","batchSize"],P)}else if(h==="REINFORCEMENT_TUNING"){let P=f(t,["batchSize"]);e!==void 0&&P!=null&&m(e,["reinforcementTuningSpec","hyperParameters","batchSize"],P)}let v=f(n,["config","method"]);if(v===void 0&&(v="SUPERVISED_FINE_TUNING"),v==="SUPERVISED_FINE_TUNING"){let P=f(t,["learningRate"]);e!==void 0&&P!=null&&m(e,["supervisedTuningSpec","hyperParameters","learningRate"],P)}else if(v==="DISTILLATION"){let P=f(t,["learningRate"]);e!==void 0&&P!=null&&m(e,["distillationSpec","hyperParameters","learningRate"],P)}let y=f(t,["labels"]);e!==void 0&&y!=null&&m(e,["labels"],y);let _=f(t,["beta"]);e!==void 0&&_!=null&&m(e,["preferenceOptimizationSpec","hyperParameters","beta"],_);let x=f(t,["baseTeacherModel"]);e!==void 0&&x!=null&&m(e,["distillationSpec","baseTeacherModel"],x);let E=f(t,["tunedTeacherModelSource"]);e!==void 0&&E!=null&&m(e,["distillationSpec","tunedTeacherModelSource"],E);let T=f(t,["sftLossWeightMultiplier"]);e!==void 0&&T!=null&&m(e,["distillationSpec","hyperParameters","sftLossWeightMultiplier"],T);let S=f(t,["outputUri"]);e!==void 0&&S!=null&&m(e,["outputUri"],S);let I=f(t,["encryptionSpec"]);e!==void 0&&I!=null&&m(e,["encryptionSpec"],I);let w=f(t,["rewardConfig"]);e!==void 0&&w!=null&&m(e,["reinforcementTuningSpec","singleRewardConfig"],w);let b=f(t,["compositeRewardConfig"]);e!==void 0&&b!=null&&m(e,["reinforcementTuningSpec","compositeRewardConfig"],b);let B=f(t,["samplesPerPrompt"]);e!==void 0&&B!=null&&m(e,["reinforcementTuningSpec","hyperParameters","samplesPerPrompt"],B);let k=f(t,["evaluateInterval"]);e!==void 0&&k!=null&&m(e,["reinforcementTuningSpec","hyperParameters","evaluateInterval"],k);let V=f(t,["checkpointInterval"]);e!==void 0&&V!=null&&m(e,["reinforcementTuningSpec","hyperParameters","checkpointInterval"],V);let ce=f(t,["maxOutputTokens"]);e!==void 0&&ce!=null&&m(e,["reinforcementTuningSpec","hyperParameters","maxOutputTokens"],ce);let Ee=f(t,["thinkingLevel"]);e!==void 0&&Ee!=null&&m(e,["reinforcementTuningSpec","hyperParameters","thinkingLevel"],Ee);let Ne=f(t,["validationDatasetUri"]);return e!==void 0&&Ne!=null&&m(e,["reinforcementTuningSpec","validationDatasetUri"],Ne),o}a(kK,"createTuningJobConfigToVertex");function PK(t,e){let n={},o=f(t,["baseModel"]);o!=null&&m(n,["baseModel"],o);let r=f(t,["preTunedModel"]);r!=null&&m(n,["preTunedModel"],r);let i=f(t,["trainingDataset"]);i!=null&&ZK(i);let s=f(t,["config"]);return s!=null&&RK(s,n),n}a(PK,"createTuningJobParametersPrivateToMldev");function NK(t,e){let n={},o=f(t,["baseModel"]);o!=null&&m(n,["baseModel"],o);let r=f(t,["preTunedModel"]);r!=null&&m(n,["preTunedModel"],r);let i=f(t,["trainingDataset"]);i!=null&&HK(i,n,e);let s=f(t,["config"]);return s!=null&&kK(s,n,e),n}a(NK,"createTuningJobParametersPrivateToVertex");function v0(t,e){let n={},o=f(t,["adapterSize"]);o!=null&&m(n,["adapterSize"],o);let r=f(t,["epochCount"]);r!=null&&m(n,["epochCount"],r);let i=f(t,["learningRateMultiplier"]);i!=null&&m(n,["learningRateMultiplier"],i);let s=f(t,["generationConfig"]);s!=null&&m(n,["generationConfig"],LK(s));let u=f(t,["learningRate"]);u!=null&&m(n,["learningRate"],u);let c=f(t,["batchSize"]);return c!=null&&m(n,["batchSize"],c),n}a(v0,"distillationHyperParametersFromVertex");function $K(t,e){let n={},o=f(t,["baseTeacherModel"]);o!=null&&m(n,["baseTeacherModel"],o);let r=f(t,["tunedTeacherModelSource"]);r!=null&&m(n,["tunedTeacherModelSource"],r);let i=f(t,["validationDatasetUri"]);i!=null&&m(n,["validationDatasetUri"],i);let s=f(t,["promptDatasetUri"]);s!=null&&m(n,["promptDatasetUri"],s);let u=f(t,["hyperparameters"]);return u!=null&&m(n,["hyperparameters"],v0(u)),n}a($K,"distillationSamplingSpecFromVertex");function DK(t,e){let n={},o=f(t,["promptDatasetUri"]);o!=null&&m(n,["promptDatasetUri"],o);let r=f(t,["baseTeacherModel"]);r!=null&&m(n,["baseTeacherModel"],r);let i=f(t,["hyperParameters"]);i!=null&&m(n,["hyperParameters"],v0(i));let s=f(t,["pipelineRootDirectory"]);s!=null&&m(n,["pipelineRootDirectory"],s);let u=f(t,["studentModel"]);u!=null&&m(n,["studentModel"],u);let c=f(t,["trainingDatasetUri"]);c!=null&&m(n,["trainingDatasetUri"],c);let l=f(t,["tunedTeacherModelSource"]);l!=null&&m(n,["tunedTeacherModelSource"],l);let p=f(t,["validationDatasetUri"]);p!=null&&m(n,["validationDatasetUri"],p);let d=f(t,["tuningMode"]);return d!=null&&m(n,["tuningMode"],d),n}a(DK,"distillationSpecFromVertex");function OK(t,e){let n={},o=f(t,["code"]);o!=null&&m(n,["code"],o);let r=f(t,["language"]);if(r!=null&&m(n,["language"],r),f(t,["id"])!==void 0)throw new Error("id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return n}a(OK,"executableCodeToVertex");function LK(t,e){let n={},o=f(t,["modelConfig"]);o!=null&&m(n,["modelSelectionConfig"],o);let r=f(t,["responseJsonSchema"]);r!=null&&m(n,["responseJsonSchema"],r);let i=f(t,["audioTimestamp"]);i!=null&&m(n,["audioTimestamp"],i);let s=f(t,["candidateCount"]);s!=null&&m(n,["candidateCount"],s);let u=f(t,["enableAffectiveDialog"]);u!=null&&m(n,["enableAffectiveDialog"],u);let c=f(t,["frequencyPenalty"]);c!=null&&m(n,["frequencyPenalty"],c);let l=f(t,["logprobs"]);l!=null&&m(n,["logprobs"],l);let p=f(t,["maxOutputTokens"]);p!=null&&m(n,["maxOutputTokens"],p);let d=f(t,["mediaResolution"]);d!=null&&m(n,["mediaResolution"],d);let g=f(t,["presencePenalty"]);g!=null&&m(n,["presencePenalty"],g);let h=f(t,["responseLogprobs"]);h!=null&&m(n,["responseLogprobs"],h);let v=f(t,["responseMimeType"]);v!=null&&m(n,["responseMimeType"],v);let y=f(t,["responseModalities"]);y!=null&&m(n,["responseModalities"],y);let _=f(t,["responseSchema"]);_!=null&&m(n,["responseSchema"],_);let x=f(t,["routingConfig"]);x!=null&&m(n,["routingConfig"],x);let E=f(t,["seed"]);E!=null&&m(n,["seed"],E);let T=f(t,["speechConfig"]);T!=null&&m(n,["speechConfig"],T);let S=f(t,["stopSequences"]);S!=null&&m(n,["stopSequences"],S);let I=f(t,["temperature"]);I!=null&&m(n,["temperature"],I);let w=f(t,["thinkingConfig"]);w!=null&&m(n,["thinkingConfig"],w);let b=f(t,["topK"]);b!=null&&m(n,["topK"],b);let B=f(t,["topP"]);return B!=null&&m(n,["topP"],B),n}a(LK,"generationConfigFromVertex");function MK(t,e){let n={},o=f(t,["name"]);return o!=null&&m(n,["_url","name"],o),n}a(MK,"getTuningJobParametersToMldev");function UK(t,e){let n={},o=f(t,["name"]);return o!=null&&m(n,["_url","name"],o),n}a(UK,"getTuningJobParametersToVertex");function FK(t,e,n){let o={},r=f(t,["pageSize"]);e!==void 0&&r!=null&&m(e,["_query","pageSize"],r);let i=f(t,["pageToken"]);e!==void 0&&i!=null&&m(e,["_query","pageToken"],i);let s=f(t,["filter"]);return e!==void 0&&s!=null&&m(e,["_query","filter"],s),o}a(FK,"listTuningJobsConfigToVertex");function zK(t,e){let n={},o=f(t,["config"]);return o!=null&&FK(o,n),n}a(zK,"listTuningJobsParametersToVertex");function GK(t,e){let n={},o=f(t,["sdkHttpResponse"]);o!=null&&m(n,["sdkHttpResponse"],o);let r=f(t,["nextPageToken"]);r!=null&&m(n,["nextPageToken"],r);let i=f(t,["tuningJobs"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(u=>Ag(u))),m(n,["tuningJobs"],s)}return n}a(GK,"listTuningJobsResponseFromVertex");function BK(t,e){let n={},o=f(t,["mediaResolution"]);o!=null&&m(n,["mediaResolution"],o);let r=f(t,["codeExecutionResult"]);r!=null&&m(n,["codeExecutionResult"],bK(r));let i=f(t,["executableCode"]);i!=null&&m(n,["executableCode"],OK(i));let s=f(t,["fileData"]);s!=null&&m(n,["fileData"],s);let u=f(t,["functionCall"]);u!=null&&m(n,["functionCall"],u);let c=f(t,["functionResponse"]);c!=null&&m(n,["functionResponse"],c);let l=f(t,["inlineData"]);l!=null&&m(n,["inlineData"],l);let p=f(t,["text"]);p!=null&&m(n,["text"],p);let d=f(t,["thought"]);d!=null&&m(n,["thought"],d);let g=f(t,["thoughtSignature"]);g!=null&&m(n,["thoughtSignature"],g);let h=f(t,["videoMetadata"]);if(h!=null&&m(n,["videoMetadata"],h),f(t,["toolCall"])!==void 0)throw new Error("toolCall parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(f(t,["toolResponse"])!==void 0)throw new Error("toolResponse parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");if(f(t,["partMetadata"])!==void 0)throw new Error("partMetadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return n}a(BK,"partToVertex");function qK(t,e){let n={},o=f(t,["contents"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(u=>Ig(u))),m(n,["contents"],s)}let r=f(t,["references"]);r!=null&&m(n,["references"],r);let i=f(t,["systemInstruction"]);return i!=null&&m(n,["systemInstruction"],Ig(i)),n}a(qK,"reinforcementTuningExampleToVertex");function VK(t,e){let n={},o=f(t,["name"]);o!=null&&m(n,["model"],o);let r=f(t,["name"]);return r!=null&&m(n,["endpoint"],r),n}a(VK,"tunedModelFromMldev");function ZK(t,e){let n={};if(f(t,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");if(f(t,["vertexDatasetResource"])!==void 0)throw new Error("vertexDatasetResource parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.");let o=f(t,["examples"]);if(o!=null){let r=o;Array.isArray(r)&&(r=r.map(i=>i)),m(n,["examples","examples"],r)}return n}a(ZK,"tuningDatasetToMldev");function HK(t,e,n){let o={},r=f(n,["config","method"]);if(r===void 0&&(r="SUPERVISED_FINE_TUNING"),r==="SUPERVISED_FINE_TUNING"){let s=f(t,["gcsUri"]);e!==void 0&&s!=null&&m(e,["supervisedTuningSpec","trainingDatasetUri"],s)}else if(r==="PREFERENCE_TUNING"){let s=f(t,["gcsUri"]);e!==void 0&&s!=null&&m(e,["preferenceOptimizationSpec","trainingDatasetUri"],s)}else if(r==="DISTILLATION"){let s=f(t,["gcsUri"]);e!==void 0&&s!=null&&m(e,["distillationSpec","promptDatasetUri"],s)}else if(r==="REINFORCEMENT_TUNING"){let s=f(t,["gcsUri"]);e!==void 0&&s!=null&&m(e,["reinforcementTuningSpec","trainingDatasetUri"],s)}let i=f(n,["config","method"]);if(i===void 0&&(i="SUPERVISED_FINE_TUNING"),i==="SUPERVISED_FINE_TUNING"){let s=f(t,["vertexDatasetResource"]);e!==void 0&&s!=null&&m(e,["supervisedTuningSpec","trainingDatasetUri"],s)}else if(i==="PREFERENCE_TUNING"){let s=f(t,["vertexDatasetResource"]);e!==void 0&&s!=null&&m(e,["preferenceOptimizationSpec","trainingDatasetUri"],s)}else if(i==="DISTILLATION"){let s=f(t,["vertexDatasetResource"]);e!==void 0&&s!=null&&m(e,["distillationSpec","promptDatasetUri"],s)}else if(i==="REINFORCEMENT_TUNING"){let s=f(t,["vertexDatasetResource"]);e!==void 0&&s!=null&&m(e,["reinforcementTuningSpec","trainingDatasetUri"],s)}if(f(t,["examples"])!==void 0)throw new Error("examples parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.");return o}a(HK,"tuningDatasetToVertex");function JK(t,e){let n={},o=f(t,["sdkHttpResponse"]);o!=null&&m(n,["sdkHttpResponse"],o);let r=f(t,["name"]);r!=null&&m(n,["name"],r);let i=f(t,["state"]);i!=null&&m(n,["state"],S$(i));let s=f(t,["createTime"]);s!=null&&m(n,["createTime"],s);let u=f(t,["tuningTask","startTime"]);u!=null&&m(n,["startTime"],u);let c=f(t,["tuningTask","completeTime"]);c!=null&&m(n,["endTime"],c);let l=f(t,["updateTime"]);l!=null&&m(n,["updateTime"],l);let p=f(t,["description"]);p!=null&&m(n,["description"],p);let d=f(t,["baseModel"]);d!=null&&m(n,["baseModel"],d);let g=f(t,["_self"]);return g!=null&&m(n,["tunedModel"],VK(g)),n}a(JK,"tuningJobFromMldev");function Ag(t,e){let n={},o=f(t,["sdkHttpResponse"]);o!=null&&m(n,["sdkHttpResponse"],o);let r=f(t,["name"]);r!=null&&m(n,["name"],r);let i=f(t,["state"]);i!=null&&m(n,["state"],S$(i));let s=f(t,["createTime"]);s!=null&&m(n,["createTime"],s);let u=f(t,["startTime"]);u!=null&&m(n,["startTime"],u);let c=f(t,["endTime"]);c!=null&&m(n,["endTime"],c);let l=f(t,["updateTime"]);l!=null&&m(n,["updateTime"],l);let p=f(t,["error"]);p!=null&&m(n,["error"],p);let d=f(t,["description"]);d!=null&&m(n,["description"],d);let g=f(t,["baseModel"]);g!=null&&m(n,["baseModel"],g);let h=f(t,["tunedModel"]);h!=null&&m(n,["tunedModel"],h);let v=f(t,["preTunedModel"]);v!=null&&m(n,["preTunedModel"],v);let y=f(t,["supervisedTuningSpec"]);y!=null&&m(n,["supervisedTuningSpec"],y);let _=f(t,["preferenceOptimizationSpec"]);_!=null&&m(n,["preferenceOptimizationSpec"],_);let x=f(t,["distillationSpec"]);x!=null&&m(n,["distillationSpec"],DK(x));let E=f(t,["reinforcementTuningSpec"]);E!=null&&m(n,["reinforcementTuningSpec"],E);let T=f(t,["tuningDataStats"]);T!=null&&m(n,["tuningDataStats"],T);let S=f(t,["encryptionSpec"]);S!=null&&m(n,["encryptionSpec"],S);let I=f(t,["partnerModelTuningSpec"]);I!=null&&m(n,["partnerModelTuningSpec"],I);let w=f(t,["customBaseModel"]);w!=null&&m(n,["customBaseModel"],w);let b=f(t,["evaluateDatasetRuns"]);if(b!=null){let Mt=b;Array.isArray(Mt)&&(Mt=Mt.map(Rp=>Rp)),m(n,["evaluateDatasetRuns"],Mt)}let B=f(t,["experiment"]);B!=null&&m(n,["experiment"],B);let k=f(t,["fullFineTuningSpec"]);k!=null&&m(n,["fullFineTuningSpec"],k);let V=f(t,["labels"]);V!=null&&m(n,["labels"],V);let ce=f(t,["outputUri"]);ce!=null&&m(n,["outputUri"],ce);let Ee=f(t,["pipelineJob"]);Ee!=null&&m(n,["pipelineJob"],Ee);let Ne=f(t,["serviceAccount"]);Ne!=null&&m(n,["serviceAccount"],Ne);let P=f(t,["tunedModelDisplayName"]);P!=null&&m(n,["tunedModelDisplayName"],P);let O=f(t,["tuningJobState"]);O!=null&&m(n,["tuningJobState"],O);let X=f(t,["veoTuningSpec"]);X!=null&&m(n,["veoTuningSpec"],X);let Ae=f(t,["tuningJobMetadata"]);Ae!=null&&m(n,["tuningJobMetadata"],Ae);let we=f(t,["veoLoraTuningSpec"]);we!=null&&m(n,["veoLoraTuningSpec"],we);let de=f(t,["distillationSamplingSpec"]);return de!=null&&m(n,["distillationSamplingSpec"],$K(de)),n}a(Ag,"tuningJobFromVertex");function KK(t,e){let n={},o=f(t,["sdkHttpResponse"]);o!=null&&m(n,["sdkHttpResponse"],o);let r=f(t,["name"]);r!=null&&m(n,["name"],r);let i=f(t,["metadata"]);i!=null&&m(n,["metadata"],i);let s=f(t,["done"]);s!=null&&m(n,["done"],s);let u=f(t,["error"]);return u!=null&&m(n,["error"],u),n}a(KK,"tuningOperationFromMldev");function Al(t,e){let n={},o=f(t,["gcsUri"]);o!=null&&m(n,["validationDatasetUri"],o);let r=f(t,["vertexDatasetResource"]);return r!=null&&m(n,["validationDatasetUri"],r),n}a(Al,"tuningValidationDatasetToVertex");function WK(t,e){let n={},o=f(t,["parent"]);o!=null&&m(n,["_url","parent"],o);let r=f(t,["sampleResponse"]);r!=null&&m(n,["sampleResponse"],Ig(r));let i=f(t,["example"]);i!=null&&m(n,["example"],qK(i));let s=f(t,["singleRewardConfig"]);s!=null&&m(n,["singleRewardConfig"],s);let u=f(t,["compositeRewardConfig"]);return u!=null&&m(n,["compositeRewardConfig"],u),n}a(WK,"validateRewardParametersToVertex");function jK(t,e){let n={},o=f(t,["sdkHttpResponse"]);o!=null&&m(n,["sdkHttpResponse"],o);let r=f(t,["overallReward"]);r!=null&&m(n,["overallReward"],r);let i=f(t,["error"]);i!=null&&m(n,["error"],i);let s=f(t,["rewardInfoDetails"]);return s!=null&&m(n,["rewardInfoDetails"],s),n}a(jK,"validateRewardResponseFromVertex");var gv=class gv extends en{constructor(e){super(),this.apiClient=e,this.list=async(n={})=>new zn(Fn.PAGED_ITEM_TUNING_JOBS,o=>this.listInternal(o),await this.listInternal(n),n),this.get=async n=>await this.getInternal(n),this.tune=async n=>{var o;if(this.apiClient.isVertexAI())if(n.baseModel.startsWith("projects/")){let r={tunedModelName:n.baseModel};!((o=n.config)===null||o===void 0)&&o.preTunedModelCheckpointId&&(r.checkpointId=n.config.preTunedModelCheckpointId);let i=Object.assign(Object.assign({},n),{preTunedModel:r});return i.baseModel=void 0,await this.tuneInternal(i)}else{let r=Object.assign({},n);return await this.tuneInternal(r)}else{let r=Object.assign({},n),i=await this.tuneMldevInternal(r),s="";return i.metadata!==void 0&&i.metadata.tunedModel!==void 0?s=i.metadata.tunedModel:i.name!==void 0&&i.name.includes("/operations/")&&(s=i.name.split("/operations/")[0]),{name:s,state:um.JOB_STATE_QUEUED}}}}async getInternal(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=UK(e);return u=q("{name}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>Ag(p))}else{let l=MK(e);return u=q("{name}",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>JK(p))}}async listInternal(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){let u=zK(e);return i=q("tuningJobs",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json().then(l=>{let p=l;return p.sdkHttpResponse={headers:c.headers},p})),r.then(c=>{let l=GK(c),p=new gm;return Object.assign(p,l),p})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async cancel(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=IK(e);return u=q("{name}:cancel",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=wK(p),g=new Ml;return Object.assign(g,d),g})}else{let l=CK(e);return u=q("{name}:cancel",l._url),c=l._query,delete l._url,delete l._query,s=this.apiClient.request({path:u,queryParams:c,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(p=>p.json().then(d=>{let g=d;return g.sdkHttpResponse={headers:p.headers},g})),s.then(p=>{let d=AK(p),g=new Ml;return Object.assign(g,d),g})}}async tuneInternal(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){let u=NK(e,e);return i=q("tuningJobs",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json().then(l=>{let p=l;return p.sdkHttpResponse={headers:c.headers},p})),r.then(c=>Ag(c))}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}async tuneMldevInternal(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{let u=PK(e);return i=q("tunedModels",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json().then(l=>{let p=l;return p.sdkHttpResponse={headers:c.headers},p})),r.then(c=>KK(c))}}async validateReward(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){let u=WK(e);return i=q("{parent}/tuningJobs:validateReinforcementTuningReward",u._url),s=u._query,delete u._url,delete u._query,r=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=e.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(o=e.config)===null||o===void 0?void 0:o.abortSignal}).then(c=>c.json().then(l=>{let p=l;return p.sdkHttpResponse={headers:c.headers},p})),r.then(c=>{let l=jK(c),p=new hm;return Object.assign(p,l),p})}else throw new Error("This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).")}};a(gv,"Tunings");var wg=gv;var hv=class hv{async download(e,n){throw new Error("Download to file is not supported in the browser, please use a browser compliant download like an <a> tag.")}};a(hv,"BrowserDownloader");var bg=hv,YK=1024*1024*8,XK=3,QK=1e3,eW=2,Yl="x-goog-upload-status";async function tW(t,e,n,o){var r;let i=await y0(t,e,n,o),s=await(i==null?void 0:i.json());if(((r=i==null?void 0:i.headers)===null||r===void 0?void 0:r[Yl])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return s.file}a(tW,"uploadBlob");async function nW(t,e,n,o){var r;let i=await y0(t,e,n,o),s=await(i==null?void 0:i.json());if(((r=i==null?void 0:i.headers)===null||r===void 0?void 0:r[Yl])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");let u=g$(s),c=new wm;return Object.assign(c,u),c}a(nW,"uploadBlobToFileSearchStore");async function y0(t,e,n,o){var r,i,s;let u=e,c=(o==null?void 0:o.baseUrl)||((r=n.clientOptions.httpOptions)===null||r===void 0?void 0:r.baseUrl);if(c){let h=new URL(c),v=new URL(e);v.protocol=h.protocol,v.host=h.host,v.port=h.port,u=v.toString()}let l=0,p=0,d=new ii(new Response),g="upload";for(l=t.size;p<l;){let h=Math.min(YK,l-p),v=t.slice(p,p+h);p+h>=l&&(g+=", finalize");let y=0,_=QK;for(;y<XK;){let x=Object.assign(Object.assign({},(o==null?void 0:o.headers)||{}),{"X-Goog-Upload-Command":g,"X-Goog-Upload-Offset":String(p),"Content-Length":String(h)});if(d=await n.request({path:"",body:v,httpMethod:"POST",httpOptions:Object.assign(Object.assign({},o),{apiVersion:"",baseUrl:u,headers:x})}),!((i=d==null?void 0:d.headers)===null||i===void 0)&&i[Yl])break;y++,await oW(_),_=_*eW}if(p+=h,((s=d==null?void 0:d.headers)===null||s===void 0?void 0:s[Yl])!=="active")break;if(l<=p)throw new Error("All content has been uploaded, but the upload status is not finalized.")}return d}a(y0,"uploadBlobInternal");async function rW(t){return{size:t.size,type:t.type}}a(rW,"getBlobStat");function oW(t){return new Promise(e=>setTimeout(e,t))}a(oW,"sleep");var vv=class vv{async upload(e,n,o,r){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await tW(e,n,o,r)}async uploadToFileSearchStore(e,n,o,r){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await nW(e,n,o,r)}async stat(e){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await rW(e)}};a(vv,"BrowserUploader");var Rg=vv;var yv=class yv{create(e,n,o){return new Pg(e,n,o)}};a(yv,"BrowserWebSocketFactory");var kg=yv,_v=class _v{constructor(e,n,o){this.url=e,this.headers=n,this.callbacks=o}connect(){this.ws=new WebSocket(this.url),this.ws.onopen=this.callbacks.onopen,this.ws.onerror=this.callbacks.onerror,this.ws.onclose=this.callbacks.onclose,this.ws.onmessage=this.callbacks.onmessage}send(e){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.send(e)}close(){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.close()}};a(_v,"BrowserWebSocket");var Pg=_v;var m$="x-goog-api-key",xv=class xv{constructor(e){this.apiKey=e}async addAuthHeaders(e,n){if(e.get(m$)===null){if(this.apiKey.startsWith("auth_tokens/"))throw new Error("Ephemeral tokens are only supported by the live API.");if(!this.apiKey)throw new Error("API key is missing. Please provide a valid API key.");e.append(m$,this.apiKey)}}};a(xv,"WebAuth");var Ng=xv;var iW="gl-node/",Ev=class Ev{getNextGenClient(){let e=this.httpOptions;return this._nextGenClient===void 0&&(this._nextGenClient=ui(this.apiClient,{timeout_ms:e==null?void 0:e.timeout})),e!=null&&e.extraBody&&console.warn("GoogleGenAI: Client level httpOptions.extraBody is not supported by the Gemini NextGen client and will be ignored."),this._nextGenClient}get interactions(){return this._interactions!==void 0?this._interactions:(this._interactions=new Sg(this.apiClient),this._interactions)}get webhooks(){return this._webhooks!==void 0?this._webhooks:(this._webhooks=new Cg(this.apiClient),this._webhooks)}get agents(){return this._agents!==void 0?this._agents:(console.warn("GoogleGenAI.agents: Agents usage is experimental and may change in future versions."),this._agents=new Tg(this.apiClient),this._agents)}constructor(e){var n;if(e.apiKey==null)throw new Error("An API Key must be set when running in a browser");if(e.project||e.location)throw new Error("Vertex AI project based authentication is not supported on browser runtimes. Please do not provide a project or location.");this.vertexai=(n=e.vertexai)!==null&&n!==void 0?n:!1,this.apiKey=e.apiKey;let o=c4(e.httpOptions,e.vertexai,void 0,void 0);o&&(e.httpOptions?e.httpOptions.baseUrl=o:e.httpOptions={baseUrl:o}),this.apiVersion=e.apiVersion,this.httpOptions=e.httpOptions;let r=new Ng(this.apiKey);this.apiClient=new Um({auth:r,apiVersion:this.apiVersion,apiKey:this.apiKey,vertexai:this.vertexai,httpOptions:this.httpOptions,userAgentExtra:iW+"web",uploader:new Rg,downloader:new bg}),this.models=new Vm(this.apiClient),this.live=new Bm(this.apiClient,r,new kg),this.batches=new km(this.apiClient),this.chats=new Nm(this.models,this.apiClient),this.caches=new Pm(this.apiClient),this.files=new Dm(this.apiClient),this.operations=new Zm(this.apiClient),this.authTokens=new Hm(this.apiClient),this.tunings=new wg(this.apiClient),this.fileSearchStores=new Km(this.apiClient)}};a(Ev,"GoogleGenAI");var qr=Ev;var x0=Symbol("Let zodToJsonSchema decide on which parser to use");var _0={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},E0=a(t=>typeof t=="string"?{..._0,name:t}:{..._0,...t},"getDefaultOptions");var S0=a(t=>{let e=E0(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([o,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,o],jsonSchema:void 0}]))}},"getRefs");function Sv(t,e,n,o){o!=null&&o.errorMessages&&n&&(t.errorMessage={...t.errorMessage,[e]:n})}a(Sv,"addErrorMessage");function ie(t,e,n,o,r){t[e]=n,Sv(t,e,o,r)}a(ie,"setResponseValueAndErrors");var fc=a((t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")},"getRelativePath");var oe;(function(t){t.assertEqual=r=>{};function e(r){}a(e,"assertIs"),t.assertIs=e;function n(r){throw new Error}a(n,"assertNever"),t.assertNever=n,t.arrayToEnum=r=>{let i={};for(let s of r)i[s]=s;return i},t.getValidEnumValues=r=>{let i=t.objectKeys(r).filter(u=>typeof r[r[u]]!="number"),s={};for(let u of i)s[u]=r[u];return t.objectValues(s)},t.objectValues=r=>t.objectKeys(r).map(function(i){return r[i]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let i=[];for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&i.push(s);return i},t.find=(r,i)=>{for(let s of r)if(i(s))return s},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function o(r,i=" | "){return r.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}a(o,"joinValues"),t.joinValues=o,t.jsonStringifyReplacer=(r,i)=>typeof i=="bigint"?i.toString():i})(oe||(oe={}));var T0;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(T0||(T0={}));var Z=oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Bn=a(t=>{switch(typeof t){case"undefined":return Z.undefined;case"string":return Z.string;case"number":return Number.isNaN(t)?Z.nan:Z.number;case"boolean":return Z.boolean;case"function":return Z.function;case"bigint":return Z.bigint;case"symbol":return Z.symbol;case"object":return Array.isArray(t)?Z.array:t===null?Z.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Z.promise:typeof Map<"u"&&t instanceof Map?Z.map:typeof Set<"u"&&t instanceof Set?Z.set:typeof Date<"u"&&t instanceof Date?Z.date:Z.object;default:return Z.unknown}},"getParsedType");var M=oe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var pc=class pc extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(i){return i.message},o={_errors:[]},r=a(i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)o._errors.push(n(s));else{let u=o,c=0;for(;c<s.path.length;){let l=s.path[c];c===s.path.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(n(s))):u[l]=u[l]||{_errors:[]},u=u[l],c++}}},"processError");return r(this),o}static assert(e){if(!(e instanceof pc))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n=Object.create(null),o=[];for(let r of this.issues)if(r.path.length>0){let i=r.path[0];n[i]=n[i]||[],n[i].push(e(r))}else o.push(e(r));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}};a(pc,"ZodError");var Rt=pc;Rt.create=t=>new Rt(t);var sW=a((t,e)=>{let n;switch(t.code){case M.invalid_type:t.received===Z.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case M.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,oe.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:n=`Unrecognized key(s) in object: ${oe.joinValues(t.keys,", ")}`;break;case M.invalid_union:n="Invalid input";break;case M.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${oe.joinValues(t.options)}`;break;case M.invalid_enum_value:n=`Invalid enum value. Expected ${oe.joinValues(t.options)}, received '${t.received}'`;break;case M.invalid_arguments:n="Invalid function arguments";break;case M.invalid_return_type:n="Invalid function return type";break;case M.invalid_date:n="Invalid date";break;case M.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:oe.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case M.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case M.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case M.custom:n="Invalid input";break;case M.invalid_intersection_types:n="Intersection results could not be merged";break;case M.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case M.not_finite:n="Number must be finite";break;default:n=e.defaultError,oe.assertNever(t)}return{message:n}},"errorMap"),mr=sW;var aW=mr;function ia(){return aW}a(ia,"getErrorMap");var gc=a(t=>{let{data:e,path:n,errorMaps:o,issueData:r}=t,i=[...n,...r.path||[]],s={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let u="",c=o.filter(l=>!!l).slice().reverse();for(let l of c)u=l(s,{data:e,defaultError:u}).message;return{...r,path:i,message:u}},"makeIssue");function z(t,e){let n=ia(),o=gc({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===mr?void 0:mr].filter(r=>!!r)});t.common.issues.push(o)}a(z,"addIssueToContext");var mc=class mc{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let o=[];for(let r of n){if(r.status==="aborted")return K;r.status==="dirty"&&e.dirty(),o.push(r.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){let o=[];for(let r of n){let i=await r.key,s=await r.value;o.push({key:i,value:s})}return mc.mergeObjectSync(e,o)}static mergeObjectSync(e,n){let o={};for(let r of n){let{key:i,value:s}=r;if(i.status==="aborted"||s.status==="aborted")return K;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet)&&(o[i.value]=s.value)}return{status:e.value,value:o}}};a(mc,"ParseStatus");var Qe=mc,K=Object.freeze({status:"aborted"}),mi=a(t=>({status:"dirty",value:t}),"DIRTY"),lt=a(t=>({status:"valid",value:t}),"OK"),Tv=a(t=>t.status==="aborted","isAborted"),Cv=a(t=>t.status==="dirty","isDirty"),Vr=a(t=>t.status==="valid","isValid"),sa=a(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync");var H;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(H||(H={}));var kv=class kv{constructor(e,n,o,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};a(kv,"ParseInputLazyPath");var Vt=kv,C0=a((t,e)=>{if(Vr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Rt(t.common.issues);return this._error=n,this._error}}},"handleResult");function Q(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:o,description:r}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:a((s,u)=>{var l,p;let{message:c}=t;return s.code==="invalid_enum_value"?{message:c!=null?c:u.defaultError}:typeof u.data>"u"?{message:(l=c!=null?c:o)!=null?l:u.defaultError}:s.code!=="invalid_type"?{message:u.defaultError}:{message:(p=c!=null?c:n)!=null?p:u.defaultError}},"customMap"),description:r}}a(Q,"processCreateParams");var Pv=class Pv{get description(){return this._def.description}_getType(e){return Bn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Bn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Qe,ctx:{common:e.parent.common,data:e.data,parsedType:Bn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(sa(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var i;let o={common:{issues:[],async:(i=n==null?void 0:n.async)!=null?i:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Bn(e)},r=this._parseSync({data:e,path:o.path,parent:o});return C0(o,r)}"~validate"(e){var o,r;let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Bn(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:n});return Vr(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(r=(o=i==null?void 0:i.message)==null?void 0:o.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>Vr(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){let o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){let o={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Bn(e)},r=this._parse({data:e,path:o.path,parent:o}),i=await(sa(r)?r:Promise.resolve(r));return C0(o,i)}refine(e,n){let o=a(r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n,"getIssueProperties");return this._refinement((r,i)=>{let s=e(r),u=a(()=>i.addIssue({code:M.custom,...o(r)}),"setError");return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(u(),!1)):s?!0:(u(),!1)})}refinement(e,n){return this._refinement((o,r)=>e(o)?!0:(r.addIssue(typeof n=="function"?n(o,r):n),!1))}_refinement(e){return new rn({schema:this,typeName:U.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a(n=>this["~validate"](n),"validate")}}optional(){return nn.create(this,this._def)}nullable(){return Zn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hr.create(this)}promise(){return Hr.create(this,this._def)}or(e){return Ei.create([this,e],this._def)}and(e){return Si.create(this,e,this._def)}transform(e){return new rn({...Q(this._def),schema:this,typeName:U.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new wi({...Q(this._def),innerType:this,defaultValue:n,typeName:U.ZodDefault})}brand(){return new hc({typeName:U.ZodBranded,type:this,...Q(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new bi({...Q(this._def),innerType:this,catchValue:n,typeName:U.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return vc.create(this,e)}readonly(){return Ri.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};a(Pv,"ZodType");var ne=Pv,uW=/^c[^\s-]{8,}$/i,lW=/^[0-9a-z]+$/,cW=/^[0-9A-HJKMNP-TV-Z]{26}$/i,dW=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,fW=/^[a-z0-9_-]{21}$/i,pW=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,mW=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,gW=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hW="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Iv,vW=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,yW=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,_W=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,xW=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,EW=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,SW=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,I0="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",TW=new RegExp(`^${I0}$`);function A0(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}a(A0,"timeRegexSource");function CW(t){return new RegExp(`^${A0(t)}$`)}a(CW,"timeRegex");function IW(t){let e=`${I0}T${A0(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}a(IW,"datetimeRegex");function AW(t,e){return!!((e==="v4"||!e)&&vW.test(t)||(e==="v6"||!e)&&_W.test(t))}a(AW,"isValidIP");function wW(t,e){if(!pW.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(o));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||e&&r.alg!==e)}catch(n){return!1}}a(wW,"isValidJWT");function bW(t,e){return!!((e==="v4"||!e)&&yW.test(t)||(e==="v6"||!e)&&xW.test(t))}a(bW,"isValidCidr");var Zr=class Zr extends ne{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Z.string){let i=this._getOrReturnCtx(e);return z(i,{code:M.invalid_type,expected:Z.string,received:i.parsedType}),K}let o=new Qe,r;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(r=this._getOrReturnCtx(e,r),z(r,{code:M.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),o.dirty());else if(i.kind==="max")e.data.length>i.value&&(r=this._getOrReturnCtx(e,r),z(r,{code:M.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),o.dirty());else if(i.kind==="length"){let s=e.data.length>i.value,u=e.data.length<i.value;(s||u)&&(r=this._getOrReturnCtx(e,r),s?z(r,{code:M.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&z(r,{code:M.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),o.dirty())}else if(i.kind==="email")gW.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"email",code:M.invalid_string,message:i.message}),o.dirty());else if(i.kind==="emoji")Iv||(Iv=new RegExp(hW,"u")),Iv.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"emoji",code:M.invalid_string,message:i.message}),o.dirty());else if(i.kind==="uuid")dW.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"uuid",code:M.invalid_string,message:i.message}),o.dirty());else if(i.kind==="nanoid")fW.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"nanoid",code:M.invalid_string,message:i.message}),o.dirty());else if(i.kind==="cuid")uW.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"cuid",code:M.invalid_string,message:i.message}),o.dirty());else if(i.kind==="cuid2")lW.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"cuid2",code:M.invalid_string,message:i.message}),o.dirty());else if(i.kind==="ulid")cW.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"ulid",code:M.invalid_string,message:i.message}),o.dirty());else if(i.kind==="url")try{new URL(e.data)}catch(s){r=this._getOrReturnCtx(e,r),z(r,{validation:"url",code:M.invalid_string,message:i.message}),o.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"regex",code:M.invalid_string,message:i.message}),o.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(r=this._getOrReturnCtx(e,r),z(r,{code:M.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),o.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(r=this._getOrReturnCtx(e,r),z(r,{code:M.invalid_string,validation:{startsWith:i.value},message:i.message}),o.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(r=this._getOrReturnCtx(e,r),z(r,{code:M.invalid_string,validation:{endsWith:i.value},message:i.message}),o.dirty()):i.kind==="datetime"?IW(i).test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{code:M.invalid_string,validation:"datetime",message:i.message}),o.dirty()):i.kind==="date"?TW.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{code:M.invalid_string,validation:"date",message:i.message}),o.dirty()):i.kind==="time"?CW(i).test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{code:M.invalid_string,validation:"time",message:i.message}),o.dirty()):i.kind==="duration"?mW.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"duration",code:M.invalid_string,message:i.message}),o.dirty()):i.kind==="ip"?AW(e.data,i.version)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"ip",code:M.invalid_string,message:i.message}),o.dirty()):i.kind==="jwt"?wW(e.data,i.alg)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"jwt",code:M.invalid_string,message:i.message}),o.dirty()):i.kind==="cidr"?bW(e.data,i.version)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"cidr",code:M.invalid_string,message:i.message}),o.dirty()):i.kind==="base64"?EW.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"base64",code:M.invalid_string,message:i.message}),o.dirty()):i.kind==="base64url"?SW.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"base64url",code:M.invalid_string,message:i.message}),o.dirty()):oe.assertNever(i);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(r=>e.test(r),{validation:n,code:M.invalid_string,...H.errToObj(o)})}_addCheck(e){return new Zr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...H.errToObj(e)})}url(e){return this._addCheck({kind:"url",...H.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...H.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...H.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...H.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...H.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...H.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...H.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...H.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...H.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...H.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...H.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...H.errToObj(e)})}datetime(e){var n,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!=null?n:!1,local:(o=e==null?void 0:e.local)!=null?o:!1,...H.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...H.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...H.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...H.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...H.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...H.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...H.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...H.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...H.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...H.errToObj(n)})}nonempty(e){return this.min(1,H.errToObj(e))}trim(){return new Zr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Zr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Zr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};a(Zr,"ZodString");var yi=Zr;yi.create=t=>{var e;return new yi({checks:[],typeName:U.ZodString,coerce:(e=t==null?void 0:t.coerce)!=null?e:!1,...Q(t)})};function RW(t,e){let n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,r=n>o?n:o,i=Number.parseInt(t.toFixed(r).replace(".","")),s=Number.parseInt(e.toFixed(r).replace(".",""));return i%s/10**r}a(RW,"floatSafeRemainder");var aa=class aa extends ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Z.number){let i=this._getOrReturnCtx(e);return z(i,{code:M.invalid_type,expected:Z.number,received:i.parsedType}),K}let o,r=new Qe;for(let i of this._def.checks)i.kind==="int"?oe.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),z(o,{code:M.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(o=this._getOrReturnCtx(e,o),z(o,{code:M.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(o=this._getOrReturnCtx(e,o),z(o,{code:M.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?RW(e.data,i.value)!==0&&(o=this._getOrReturnCtx(e,o),z(o,{code:M.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),z(o,{code:M.not_finite,message:i.message}),r.dirty()):oe.assertNever(i);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,H.toString(n))}gt(e,n){return this.setLimit("min",e,!1,H.toString(n))}lte(e,n){return this.setLimit("max",e,!0,H.toString(n))}lt(e,n){return this.setLimit("max",e,!1,H.toString(n))}setLimit(e,n,o,r){return new aa({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:H.toString(r)}]})}_addCheck(e){return new aa({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:H.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:H.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:H.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:H.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:H.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&oe.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}};a(aa,"ZodNumber");var fa=aa;fa.create=t=>new fa({checks:[],typeName:U.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Q(t)});var ua=class ua extends ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(i){return this._getInvalidInput(e)}if(this._getType(e)!==Z.bigint)return this._getInvalidInput(e);let o,r=new Qe;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(o=this._getOrReturnCtx(e,o),z(o,{code:M.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(o=this._getOrReturnCtx(e,o),z(o,{code:M.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),z(o,{code:M.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):oe.assertNever(i);return{status:r.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return z(n,{code:M.invalid_type,expected:Z.bigint,received:n.parsedType}),K}gte(e,n){return this.setLimit("min",e,!0,H.toString(n))}gt(e,n){return this.setLimit("min",e,!1,H.toString(n))}lte(e,n){return this.setLimit("max",e,!0,H.toString(n))}lt(e,n){return this.setLimit("max",e,!1,H.toString(n))}setLimit(e,n,o,r){return new ua({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:H.toString(r)}]})}_addCheck(e){return new ua({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:H.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};a(ua,"ZodBigInt");var pa=ua;pa.create=t=>{var e;return new pa({checks:[],typeName:U.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!=null?e:!1,...Q(t)})};var Nv=class Nv extends ne{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Z.boolean){let o=this._getOrReturnCtx(e);return z(o,{code:M.invalid_type,expected:Z.boolean,received:o.parsedType}),K}return lt(e.data)}};a(Nv,"ZodBoolean");var ma=Nv;ma.create=t=>new ma({typeName:U.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Q(t)});var yc=class yc extends ne{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Z.date){let i=this._getOrReturnCtx(e);return z(i,{code:M.invalid_type,expected:Z.date,received:i.parsedType}),K}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return z(i,{code:M.invalid_date}),K}let o=new Qe,r;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(r=this._getOrReturnCtx(e,r),z(r,{code:M.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),o.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(r=this._getOrReturnCtx(e,r),z(r,{code:M.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),o.dirty()):oe.assertNever(i);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new yc({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:H.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:H.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};a(yc,"ZodDate");var ga=yc;ga.create=t=>new ga({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:U.ZodDate,...Q(t)});var $v=class $v extends ne{_parse(e){if(this._getType(e)!==Z.symbol){let o=this._getOrReturnCtx(e);return z(o,{code:M.invalid_type,expected:Z.symbol,received:o.parsedType}),K}return lt(e.data)}};a($v,"ZodSymbol");var ha=$v;ha.create=t=>new ha({typeName:U.ZodSymbol,...Q(t)});var Dv=class Dv extends ne{_parse(e){if(this._getType(e)!==Z.undefined){let o=this._getOrReturnCtx(e);return z(o,{code:M.invalid_type,expected:Z.undefined,received:o.parsedType}),K}return lt(e.data)}};a(Dv,"ZodUndefined");var _i=Dv;_i.create=t=>new _i({typeName:U.ZodUndefined,...Q(t)});var Ov=class Ov extends ne{_parse(e){if(this._getType(e)!==Z.null){let o=this._getOrReturnCtx(e);return z(o,{code:M.invalid_type,expected:Z.null,received:o.parsedType}),K}return lt(e.data)}};a(Ov,"ZodNull");var xi=Ov;xi.create=t=>new xi({typeName:U.ZodNull,...Q(t)});var Lv=class Lv extends ne{constructor(){super(...arguments),this._any=!0}_parse(e){return lt(e.data)}};a(Lv,"ZodAny");var va=Lv;va.create=t=>new va({typeName:U.ZodAny,...Q(t)});var Mv=class Mv extends ne{constructor(){super(...arguments),this._unknown=!0}_parse(e){return lt(e.data)}};a(Mv,"ZodUnknown");var gr=Mv;gr.create=t=>new gr({typeName:U.ZodUnknown,...Q(t)});var Uv=class Uv extends ne{_parse(e){let n=this._getOrReturnCtx(e);return z(n,{code:M.invalid_type,expected:Z.never,received:n.parsedType}),K}};a(Uv,"ZodNever");var hn=Uv;hn.create=t=>new hn({typeName:U.ZodNever,...Q(t)});var Fv=class Fv extends ne{_parse(e){if(this._getType(e)!==Z.undefined){let o=this._getOrReturnCtx(e);return z(o,{code:M.invalid_type,expected:Z.void,received:o.parsedType}),K}return lt(e.data)}};a(Fv,"ZodVoid");var ya=Fv;ya.create=t=>new ya({typeName:U.ZodVoid,...Q(t)});var hi=class hi extends ne{_parse(e){let{ctx:n,status:o}=this._processInputParams(e),r=this._def;if(n.parsedType!==Z.array)return z(n,{code:M.invalid_type,expected:Z.array,received:n.parsedType}),K;if(r.exactLength!==null){let s=n.data.length>r.exactLength.value,u=n.data.length<r.exactLength.value;(s||u)&&(z(n,{code:s?M.too_big:M.too_small,minimum:u?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),o.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(z(n,{code:M.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),o.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(z(n,{code:M.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((s,u)=>r.type._parseAsync(new Vt(n,s,n.path,u)))).then(s=>Qe.mergeArray(o,s));let i=[...n.data].map((s,u)=>r.type._parseSync(new Vt(n,s,n.path,u)));return Qe.mergeArray(o,i)}get element(){return this._def.type}min(e,n){return new hi({...this._def,minLength:{value:e,message:H.toString(n)}})}max(e,n){return new hi({...this._def,maxLength:{value:e,message:H.toString(n)}})}length(e,n){return new hi({...this._def,exactLength:{value:e,message:H.toString(n)}})}nonempty(e){return this.min(1,e)}};a(hi,"ZodArray");var hr=hi;hr.create=(t,e)=>new hr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:U.ZodArray,...Q(e)});function gi(t){if(t instanceof Pt){let e={};for(let n in t.shape){let o=t.shape[n];e[n]=nn.create(gi(o))}return new Pt({...t._def,shape:a(()=>e,"shape")})}else return t instanceof hr?new hr({...t._def,type:gi(t.element)}):t instanceof nn?nn.create(gi(t.unwrap())):t instanceof Zn?Zn.create(gi(t.unwrap())):t instanceof Vn?Vn.create(t.items.map(e=>gi(e))):t}a(gi,"deepPartialify");var kt=class kt extends ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=oe.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Z.object){let l=this._getOrReturnCtx(e);return z(l,{code:M.invalid_type,expected:Z.object,received:l.parsedType}),K}let{status:o,ctx:r}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),u=[];if(!(this._def.catchall instanceof hn&&this._def.unknownKeys==="strip"))for(let l in r.data)s.includes(l)||u.push(l);let c=[];for(let l of s){let p=i[l],d=r.data[l];c.push({key:{status:"valid",value:l},value:p._parse(new Vt(r,d,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof hn){let l=this._def.unknownKeys;if(l==="passthrough")for(let p of u)c.push({key:{status:"valid",value:p},value:{status:"valid",value:r.data[p]}});else if(l==="strict")u.length>0&&(z(r,{code:M.unrecognized_keys,keys:u}),o.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let p of u){let d=r.data[p];c.push({key:{status:"valid",value:p},value:l._parse(new Vt(r,d,r.path,p)),alwaysSet:p in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let l=[];for(let p of c){let d=await p.key,g=await p.value;l.push({key:d,value:g,alwaysSet:p.alwaysSet})}return l}).then(l=>Qe.mergeObjectSync(o,l)):Qe.mergeObjectSync(o,c)}get shape(){return this._def.shape()}strict(e){return H.errToObj,new kt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:a((n,o)=>{var i,s,u,c;let r=(u=(s=(i=this._def).errorMap)==null?void 0:s.call(i,n,o).message)!=null?u:o.defaultError;return n.code==="unrecognized_keys"?{message:(c=H.errToObj(e).message)!=null?c:r}:{message:r}},"errorMap")}:{}})}strip(){return new kt({...this._def,unknownKeys:"strip"})}passthrough(){return new kt({...this._def,unknownKeys:"passthrough"})}extend(e){return new kt({...this._def,shape:a(()=>({...this._def.shape(),...e}),"shape")})}merge(e){return new kt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:a(()=>({...this._def.shape(),...e._def.shape()}),"shape"),typeName:U.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new kt({...this._def,catchall:e})}pick(e){let n={};for(let o of oe.objectKeys(e))e[o]&&this.shape[o]&&(n[o]=this.shape[o]);return new kt({...this._def,shape:a(()=>n,"shape")})}omit(e){let n={};for(let o of oe.objectKeys(this.shape))e[o]||(n[o]=this.shape[o]);return new kt({...this._def,shape:a(()=>n,"shape")})}deepPartial(){return gi(this)}partial(e){let n={};for(let o of oe.objectKeys(this.shape)){let r=this.shape[o];e&&!e[o]?n[o]=r:n[o]=r.optional()}return new kt({...this._def,shape:a(()=>n,"shape")})}required(e){let n={};for(let o of oe.objectKeys(this.shape))if(e&&!e[o])n[o]=this.shape[o];else{let i=this.shape[o];for(;i instanceof nn;)i=i._def.innerType;n[o]=i}return new kt({...this._def,shape:a(()=>n,"shape")})}keyof(){return w0(oe.objectKeys(this.shape))}};a(kt,"ZodObject");var Pt=kt;Pt.create=(t,e)=>new Pt({shape:a(()=>t,"shape"),unknownKeys:"strip",catchall:hn.create(),typeName:U.ZodObject,...Q(e)});Pt.strictCreate=(t,e)=>new Pt({shape:a(()=>t,"shape"),unknownKeys:"strict",catchall:hn.create(),typeName:U.ZodObject,...Q(e)});Pt.lazycreate=(t,e)=>new Pt({shape:t,unknownKeys:"strip",catchall:hn.create(),typeName:U.ZodObject,...Q(e)});var zv=class zv extends ne{_parse(e){let{ctx:n}=this._processInputParams(e),o=this._def.options;function r(i){for(let u of i)if(u.result.status==="valid")return u.result;for(let u of i)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;let s=i.map(u=>new Rt(u.ctx.common.issues));return z(n,{code:M.invalid_union,unionErrors:s}),K}if(a(r,"handleResults"),n.common.async)return Promise.all(o.map(async i=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(r);{let i,s=[];for(let c of o){let l={...n,common:{...n.common,issues:[]},parent:null},p=c._parseSync({data:n.data,path:n.path,parent:l});if(p.status==="valid")return p;p.status==="dirty"&&!i&&(i={result:p,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let u=s.map(c=>new Rt(c));return z(n,{code:M.invalid_union,unionErrors:u}),K}}get options(){return this._def.options}};a(zv,"ZodUnion");var Ei=zv;Ei.create=(t,e)=>new Ei({options:t,typeName:U.ZodUnion,...Q(e)});var qn=a(t=>t instanceof Ti?qn(t.schema):t instanceof rn?qn(t.innerType()):t instanceof Ci?[t.value]:t instanceof Ii?t.options:t instanceof Ai?oe.objectValues(t.enum):t instanceof wi?qn(t._def.innerType):t instanceof _i?[void 0]:t instanceof xi?[null]:t instanceof nn?[void 0,...qn(t.unwrap())]:t instanceof Zn?[null,...qn(t.unwrap())]:t instanceof hc||t instanceof Ri?qn(t.unwrap()):t instanceof bi?qn(t._def.innerType):[],"getDiscriminator"),_c=class _c extends ne{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Z.object)return z(n,{code:M.invalid_type,expected:Z.object,received:n.parsedType}),K;let o=this.discriminator,r=n.data[o],i=this.optionsMap.get(r);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(z(n,{code:M.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),K)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){let r=new Map;for(let i of n){let s=qn(i.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let u of s){if(r.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);r.set(u,i)}}return new _c({typeName:U.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...Q(o)})}};a(_c,"ZodDiscriminatedUnion");var Av=_c;function wv(t,e){let n=Bn(t),o=Bn(e);if(t===e)return{valid:!0,data:t};if(n===Z.object&&o===Z.object){let r=oe.objectKeys(e),i=oe.objectKeys(t).filter(u=>r.indexOf(u)!==-1),s={...t,...e};for(let u of i){let c=wv(t[u],e[u]);if(!c.valid)return{valid:!1};s[u]=c.data}return{valid:!0,data:s}}else if(n===Z.array&&o===Z.array){if(t.length!==e.length)return{valid:!1};let r=[];for(let i=0;i<t.length;i++){let s=t[i],u=e[i],c=wv(s,u);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return n===Z.date&&o===Z.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}a(wv,"mergeValues");var Gv=class Gv extends ne{_parse(e){let{status:n,ctx:o}=this._processInputParams(e),r=a((i,s)=>{if(Tv(i)||Tv(s))return K;let u=wv(i.value,s.value);return u.valid?((Cv(i)||Cv(s))&&n.dirty(),{status:n.value,value:u.data}):(z(o,{code:M.invalid_intersection_types}),K)},"handleParsed");return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([i,s])=>r(i,s)):r(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};a(Gv,"ZodIntersection");var Si=Gv;Si.create=(t,e,n)=>new Si({left:t,right:e,typeName:U.ZodIntersection,...Q(n)});var xc=class xc extends ne{_parse(e){let{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==Z.array)return z(o,{code:M.invalid_type,expected:Z.array,received:o.parsedType}),K;if(o.data.length<this._def.items.length)return z(o,{code:M.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),K;!this._def.rest&&o.data.length>this._def.items.length&&(z(o,{code:M.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...o.data].map((s,u)=>{let c=this._def.items[u]||this._def.rest;return c?c._parse(new Vt(o,s,o.path,u)):null}).filter(s=>!!s);return o.common.async?Promise.all(i).then(s=>Qe.mergeArray(n,s)):Qe.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new xc({...this._def,rest:e})}};a(xc,"ZodTuple");var Vn=xc;Vn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Vn({items:t,typeName:U.ZodTuple,rest:null,...Q(e)})};var la=class la extends ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==Z.object)return z(o,{code:M.invalid_type,expected:Z.object,received:o.parsedType}),K;let r=[],i=this._def.keyType,s=this._def.valueType;for(let u in o.data)r.push({key:i._parse(new Vt(o,u,o.path,u)),value:s._parse(new Vt(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?Qe.mergeObjectAsync(n,r):Qe.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof ne?new la({keyType:e,valueType:n,typeName:U.ZodRecord,...Q(o)}):new la({keyType:yi.create(),valueType:e,typeName:U.ZodRecord,...Q(n)})}};a(la,"ZodRecord");var bv=la,Bv=class Bv extends ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==Z.map)return z(o,{code:M.invalid_type,expected:Z.map,received:o.parsedType}),K;let r=this._def.keyType,i=this._def.valueType,s=[...o.data.entries()].map(([u,c],l)=>({key:r._parse(new Vt(o,u,o.path,[l,"key"])),value:i._parse(new Vt(o,c,o.path,[l,"value"]))}));if(o.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let c of s){let l=await c.key,p=await c.value;if(l.status==="aborted"||p.status==="aborted")return K;(l.status==="dirty"||p.status==="dirty")&&n.dirty(),u.set(l.value,p.value)}return{status:n.value,value:u}})}else{let u=new Map;for(let c of s){let l=c.key,p=c.value;if(l.status==="aborted"||p.status==="aborted")return K;(l.status==="dirty"||p.status==="dirty")&&n.dirty(),u.set(l.value,p.value)}return{status:n.value,value:u}}}};a(Bv,"ZodMap");var _a=Bv;_a.create=(t,e,n)=>new _a({valueType:e,keyType:t,typeName:U.ZodMap,...Q(n)});var ca=class ca extends ne{_parse(e){let{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==Z.set)return z(o,{code:M.invalid_type,expected:Z.set,received:o.parsedType}),K;let r=this._def;r.minSize!==null&&o.data.size<r.minSize.value&&(z(o,{code:M.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&o.data.size>r.maxSize.value&&(z(o,{code:M.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let i=this._def.valueType;function s(c){let l=new Set;for(let p of c){if(p.status==="aborted")return K;p.status==="dirty"&&n.dirty(),l.add(p.value)}return{status:n.value,value:l}}a(s,"finalizeSet");let u=[...o.data.values()].map((c,l)=>i._parse(new Vt(o,c,o.path,l)));return o.common.async?Promise.all(u).then(c=>s(c)):s(u)}min(e,n){return new ca({...this._def,minSize:{value:e,message:H.toString(n)}})}max(e,n){return new ca({...this._def,maxSize:{value:e,message:H.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};a(ca,"ZodSet");var xa=ca;xa.create=(t,e)=>new xa({valueType:t,minSize:null,maxSize:null,typeName:U.ZodSet,...Q(e)});var vi=class vi extends ne{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Z.function)return z(n,{code:M.invalid_type,expected:Z.function,received:n.parsedType}),K;function o(u,c){return gc({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ia(),mr].filter(l=>!!l),issueData:{code:M.invalid_arguments,argumentsError:c}})}a(o,"makeArgsIssue");function r(u,c){return gc({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ia(),mr].filter(l=>!!l),issueData:{code:M.invalid_return_type,returnTypeError:c}})}a(r,"makeReturnsIssue");let i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof Hr){let u=this;return lt(async function(...c){let l=new Rt([]),p=await u._def.args.parseAsync(c,i).catch(h=>{throw l.addIssue(o(c,h)),l}),d=await Reflect.apply(s,this,p);return await u._def.returns._def.type.parseAsync(d,i).catch(h=>{throw l.addIssue(r(d,h)),l})})}else{let u=this;return lt(function(...c){let l=u._def.args.safeParse(c,i);if(!l.success)throw new Rt([o(c,l.error)]);let p=Reflect.apply(s,this,l.data),d=u._def.returns.safeParse(p,i);if(!d.success)throw new Rt([r(p,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new vi({...this._def,args:Vn.create(e).rest(gr.create())})}returns(e){return new vi({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new vi({args:e||Vn.create([]).rest(gr.create()),returns:n||gr.create(),typeName:U.ZodFunction,...Q(o)})}};a(vi,"ZodFunction");var Rv=vi,qv=class qv extends ne{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};a(qv,"ZodLazy");var Ti=qv;Ti.create=(t,e)=>new Ti({getter:t,typeName:U.ZodLazy,...Q(e)});var Vv=class Vv extends ne{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return z(n,{received:n.data,code:M.invalid_literal,expected:this._def.value}),K}return{status:"valid",value:e.data}}get value(){return this._def.value}};a(Vv,"ZodLiteral");var Ci=Vv;Ci.create=(t,e)=>new Ci({value:t,typeName:U.ZodLiteral,...Q(e)});function w0(t,e){return new Ii({values:t,typeName:U.ZodEnum,...Q(e)})}a(w0,"createZodEnum");var da=class da extends ne{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),o=this._def.values;return z(n,{expected:oe.joinValues(o),received:n.parsedType,code:M.invalid_type}),K}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),o=this._def.values;return z(n,{received:n.data,code:M.invalid_enum_value,options:o}),K}return lt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return da.create(e,{...this._def,...n})}exclude(e,n=this._def){return da.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}};a(da,"ZodEnum");var Ii=da;Ii.create=w0;var Zv=class Zv extends ne{_parse(e){let n=oe.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==Z.string&&o.parsedType!==Z.number){let r=oe.objectValues(n);return z(o,{expected:oe.joinValues(r),received:o.parsedType,code:M.invalid_type}),K}if(this._cache||(this._cache=new Set(oe.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=oe.objectValues(n);return z(o,{received:o.data,code:M.invalid_enum_value,options:r}),K}return lt(e.data)}get enum(){return this._def.values}};a(Zv,"ZodNativeEnum");var Ai=Zv;Ai.create=(t,e)=>new Ai({values:t,typeName:U.ZodNativeEnum,...Q(e)});var Hv=class Hv extends ne{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Z.promise&&n.common.async===!1)return z(n,{code:M.invalid_type,expected:Z.promise,received:n.parsedType}),K;let o=n.parsedType===Z.promise?n.data:Promise.resolve(n.data);return lt(o.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};a(Hv,"ZodPromise");var Hr=Hv;Hr.create=(t,e)=>new Hr({type:t,typeName:U.ZodPromise,...Q(e)});var Jv=class Jv extends ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===U.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:o}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:a(s=>{z(o,s),s.fatal?n.abort():n.dirty()},"addIssue"),get path(){return o.path}};if(i.addIssue=i.addIssue.bind(i),r.type==="preprocess"){let s=r.transform(o.data,i);if(o.common.async)return Promise.resolve(s).then(async u=>{if(n.value==="aborted")return K;let c=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return c.status==="aborted"?K:c.status==="dirty"?mi(c.value):n.value==="dirty"?mi(c.value):c});{if(n.value==="aborted")return K;let u=this._def.schema._parseSync({data:s,path:o.path,parent:o});return u.status==="aborted"?K:u.status==="dirty"?mi(u.value):n.value==="dirty"?mi(u.value):u}}if(r.type==="refinement"){let s=a(u=>{let c=r.refinement(u,i);if(o.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u},"executeRefinement");if(o.common.async===!1){let u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?K:(u.status==="dirty"&&n.dirty(),s(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?K:(u.status==="dirty"&&n.dirty(),s(u.value).then(()=>({status:n.value,value:u.value}))))}if(r.type==="transform")if(o.common.async===!1){let s=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Vr(s))return K;let u=r.transform(s.value,i);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(s=>Vr(s)?Promise.resolve(r.transform(s.value,i)).then(u=>({status:n.value,value:u})):K);oe.assertNever(r)}};a(Jv,"ZodEffects");var rn=Jv;rn.create=(t,e,n)=>new rn({schema:t,typeName:U.ZodEffects,effect:e,...Q(n)});rn.createWithPreprocess=(t,e,n)=>new rn({schema:e,effect:{type:"preprocess",transform:t},typeName:U.ZodEffects,...Q(n)});var Kv=class Kv extends ne{_parse(e){return this._getType(e)===Z.undefined?lt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a(Kv,"ZodOptional");var nn=Kv;nn.create=(t,e)=>new nn({innerType:t,typeName:U.ZodOptional,...Q(e)});var Wv=class Wv extends ne{_parse(e){return this._getType(e)===Z.null?lt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a(Wv,"ZodNullable");var Zn=Wv;Zn.create=(t,e)=>new Zn({innerType:t,typeName:U.ZodNullable,...Q(e)});var jv=class jv extends ne{_parse(e){let{ctx:n}=this._processInputParams(e),o=n.data;return n.parsedType===Z.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};a(jv,"ZodDefault");var wi=jv;wi.create=(t,e)=>new wi({innerType:t,typeName:U.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Q(e)});var Yv=class Yv extends ne{_parse(e){let{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return sa(r)?r.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Rt(o.common.issues)},input:o.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Rt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};a(Yv,"ZodCatch");var bi=Yv;bi.create=(t,e)=>new bi({innerType:t,typeName:U.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Q(e)});var Xv=class Xv extends ne{_parse(e){if(this._getType(e)!==Z.nan){let o=this._getOrReturnCtx(e);return z(o,{code:M.invalid_type,expected:Z.nan,received:o.parsedType}),K}return{status:"valid",value:e.data}}};a(Xv,"ZodNaN");var Ea=Xv;Ea.create=t=>new Ea({typeName:U.ZodNaN,...Q(t)});var Qv=class Qv extends ne{_parse(e){let{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}};a(Qv,"ZodBranded");var hc=Qv,Ec=class Ec extends ne{_parse(e){let{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return a(async()=>{let i=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?K:i.status==="dirty"?(n.dirty(),mi(i.value)):this._def.out._parseAsync({data:i.value,path:o.path,parent:o})},"handleAsync")();{let r=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return r.status==="aborted"?K:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:o.path,parent:o})}}static create(e,n){return new Ec({in:e,out:n,typeName:U.ZodPipeline})}};a(Ec,"ZodPipeline");var vc=Ec,ey=class ey extends ne{_parse(e){let n=this._def.innerType._parse(e),o=a(r=>(Vr(r)&&(r.value=Object.freeze(r.value)),r),"freeze");return sa(n)?n.then(r=>o(r)):o(n)}unwrap(){return this._def.innerType}};a(ey,"ZodReadonly");var Ri=ey;Ri.create=(t,e)=>new Ri({innerType:t,typeName:U.ZodReadonly,...Q(e)});var ele={object:Pt.lazycreate},U;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(U||(U={}));var tle=yi.create,nle=fa.create,rle=Ea.create,ole=pa.create,ile=ma.create,sle=ga.create,ale=ha.create,ule=_i.create,lle=xi.create,cle=va.create,dle=gr.create,fle=hn.create,ple=ya.create,mle=hr.create,gle=Pt.create,hle=Pt.strictCreate,vle=Ei.create,yle=Av.create,_le=Si.create,xle=Vn.create,Ele=bv.create,Sle=_a.create,Tle=xa.create,Cle=Rv.create,Ile=Ti.create,Ale=Ci.create,wle=Ii.create,ble=Ai.create,Rle=Hr.create,kle=rn.create,Ple=nn.create,Nle=Zn.create,$le=rn.createWithPreprocess,Dle=vc.create;function be(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?fc(e,t.currentPath):e.join("/")}}a(be,"parseAnyDef");function b0(t,e){var o,r,i;let n={type:"array"};return(o=t.type)!=null&&o._def&&((i=(r=t.type)==null?void 0:r._def)==null?void 0:i.typeName)!==U.ZodAny&&(n.items=W(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&ie(n,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&ie(n,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(ie(n,"minItems",t.exactLength.value,t.exactLength.message,e),ie(n,"maxItems",t.exactLength.value,t.exactLength.message,e)),n}a(b0,"parseArrayDef");function R0(t,e){let n={type:"integer",format:"int64"};if(!t.checks)return n;for(let o of t.checks)switch(o.kind){case"min":e.target==="jsonSchema7"?o.inclusive?ie(n,"minimum",o.value,o.message,e):ie(n,"exclusiveMinimum",o.value,o.message,e):(o.inclusive||(n.exclusiveMinimum=!0),ie(n,"minimum",o.value,o.message,e));break;case"max":e.target==="jsonSchema7"?o.inclusive?ie(n,"maximum",o.value,o.message,e):ie(n,"exclusiveMaximum",o.value,o.message,e):(o.inclusive||(n.exclusiveMaximum=!0),ie(n,"maximum",o.value,o.message,e));break;case"multipleOf":ie(n,"multipleOf",o.value,o.message,e);break}return n}a(R0,"parseBigintDef");function k0(){return{type:"boolean"}}a(k0,"parseBooleanDef");function Sc(t,e){return W(t.type._def,e)}a(Sc,"parseBrandedDef");var P0=a((t,e)=>W(t.innerType._def,e),"parseCatchDef");function ty(t,e,n){let o=n!=null?n:e.dateStrategy;if(Array.isArray(o))return{anyOf:o.map((r,i)=>ty(t,e,r))};switch(o){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return kW(t,e)}}a(ty,"parseDateDef");var kW=a((t,e)=>{let n={type:"integer",format:"unix-time"};if(e.target==="openApi3")return n;for(let o of t.checks)switch(o.kind){case"min":ie(n,"minimum",o.value,o.message,e);break;case"max":ie(n,"maximum",o.value,o.message,e);break}return n},"integerDateParser");function N0(t,e){return{...W(t.innerType._def,e),default:t.defaultValue()}}a(N0,"parseDefaultDef");function $0(t,e){return e.effectStrategy==="input"?W(t.schema._def,e):be(e)}a($0,"parseEffectsDef");function D0(t){return{type:"string",enum:Array.from(t.values)}}a(D0,"parseEnumDef");var PW=a(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"isJsonSchema7AllOfType");function O0(t,e){let n=[W(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),W(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i),o=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,r=[];return n.forEach(i=>{if(PW(i))r.push(...i.allOf),i.unevaluatedProperties===void 0&&(o=void 0);else{let s=i;if("additionalProperties"in i&&i.additionalProperties===!1){let{additionalProperties:u,...c}=i;s=c}else o=void 0;r.push(s)}}),r.length?{allOf:r,...o}:void 0}a(O0,"parseIntersectionDef");function L0(t,e){let n=typeof t.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[t.value]}:{type:n==="bigint"?"integer":n,const:t.value}}a(L0,"parseLiteralDef");var ny,on={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:a(()=>(ny===void 0&&(ny=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ny),"emoji"),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Tc(t,e){let n={type:"string"};if(t.checks)for(let o of t.checks)switch(o.kind){case"min":ie(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value,o.message,e);break;case"max":ie(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value,o.message,e);break;case"email":switch(e.emailStrategy){case"format:email":sn(n,"email",o.message,e);break;case"format:idn-email":sn(n,"idn-email",o.message,e);break;case"pattern:zod":ct(n,on.email,o.message,e);break}break;case"url":sn(n,"uri",o.message,e);break;case"uuid":sn(n,"uuid",o.message,e);break;case"regex":ct(n,o.regex,o.message,e);break;case"cuid":ct(n,on.cuid,o.message,e);break;case"cuid2":ct(n,on.cuid2,o.message,e);break;case"startsWith":ct(n,RegExp(`^${ry(o.value,e)}`),o.message,e);break;case"endsWith":ct(n,RegExp(`${ry(o.value,e)}$`),o.message,e);break;case"datetime":sn(n,"date-time",o.message,e);break;case"date":sn(n,"date",o.message,e);break;case"time":sn(n,"time",o.message,e);break;case"duration":sn(n,"duration",o.message,e);break;case"length":ie(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value,o.message,e),ie(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value,o.message,e);break;case"includes":{ct(n,RegExp(ry(o.value,e)),o.message,e);break}case"ip":{o.version!=="v6"&&sn(n,"ipv4",o.message,e),o.version!=="v4"&&sn(n,"ipv6",o.message,e);break}case"base64url":ct(n,on.base64url,o.message,e);break;case"jwt":ct(n,on.jwt,o.message,e);break;case"cidr":{o.version!=="v6"&&ct(n,on.ipv4Cidr,o.message,e),o.version!=="v4"&&ct(n,on.ipv6Cidr,o.message,e);break}case"emoji":ct(n,on.emoji(),o.message,e);break;case"ulid":{ct(n,on.ulid,o.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{sn(n,"binary",o.message,e);break}case"contentEncoding:base64":{ie(n,"contentEncoding","base64",o.message,e);break}case"pattern:zod":{ct(n,on.base64,o.message,e);break}}break}case"nanoid":ct(n,on.nanoid,o.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}a(Tc,"parseStringDef");function ry(t,e){return e.patternStrategy==="escape"?$W(t):t}a(ry,"escapeLiteralCheckValue");var NW=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function $W(t){let e="";for(let n=0;n<t.length;n++)NW.has(t[n])||(e+="\\"),e+=t[n];return e}a($W,"escapeNonAlphaNumeric");function sn(t,e,n,o){var r;t.format||(r=t.anyOf)!=null&&r.some(i=>i.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&o.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...n&&o.errorMessages&&{errorMessage:{format:n}}})):ie(t,"format",e,n,o)}a(sn,"addFormat");function ct(t,e,n,o){var r;t.pattern||(r=t.allOf)!=null&&r.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&o.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:M0(e,o),...n&&o.errorMessages&&{errorMessage:{pattern:n}}})):ie(t,"pattern",M0(e,o),n,o)}a(ct,"addPattern");function M0(t,e){var c;if(!e.applyRegexFlags||!t.flags)return t.source;let n={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},o=n.i?t.source.toLowerCase():t.source,r="",i=!1,s=!1,u=!1;for(let l=0;l<o.length;l++){if(i){r+=o[l],i=!1;continue}if(n.i){if(s){if(o[l].match(/[a-z]/)){u?(r+=o[l],r+=`${o[l-2]}-${o[l]}`.toUpperCase(),u=!1):o[l+1]==="-"&&((c=o[l+2])!=null&&c.match(/[a-z]/))?(r+=o[l],u=!0):r+=`${o[l]}${o[l].toUpperCase()}`;continue}}else if(o[l].match(/[a-z]/)){r+=`[${o[l]}${o[l].toUpperCase()}]`;continue}}if(n.m){if(o[l]==="^"){r+=`(^|(?<=[\r
14
+ ]))`;continue}else if(o[l]==="$"){r+=`($|(?=[\r
15
+ ]))`;continue}}if(n.s&&o[l]==="."){r+=s?`${o[l]}\r
16
+ `:`[${o[l]}\r
17
+ ]`;continue}r+=o[l],o[l]==="\\"?i=!0:s&&o[l]==="]"?s=!1:!s&&o[l]==="["&&(s=!0)}try{new RegExp(r)}catch(l){return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return r}a(M0,"stringifyRegExpWithFlags");function Cc(t,e){var o,r,i,s,u,c,l;if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&((o=t.keyType)==null?void 0:o._def.typeName)===U.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((p,d)=>{var g;return{...p,[d]:(g=W(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",d]}))!=null?g:be(e)}},{}),additionalProperties:e.rejectedAdditionalProperties};let n={type:"object",additionalProperties:(r=W(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?r:e.allowedAdditionalProperties};if(e.target==="openApi3")return n;if(((i=t.keyType)==null?void 0:i._def.typeName)===U.ZodString&&((s=t.keyType._def.checks)!=null&&s.length)){let{type:p,...d}=Tc(t.keyType._def,e);return{...n,propertyNames:d}}else{if(((u=t.keyType)==null?void 0:u._def.typeName)===U.ZodEnum)return{...n,propertyNames:{enum:t.keyType._def.values}};if(((c=t.keyType)==null?void 0:c._def.typeName)===U.ZodBranded&&t.keyType._def.type._def.typeName===U.ZodString&&((l=t.keyType._def.type._def.checks)!=null&&l.length)){let{type:p,...d}=Sc(t.keyType._def,e);return{...n,propertyNames:d}}}return n}a(Cc,"parseRecordDef");function U0(t,e){if(e.mapStrategy==="record")return Cc(t,e);let n=W(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||be(e),o=W(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||be(e);return{type:"array",maxItems:125,items:{type:"array",items:[n,o],minItems:2,maxItems:2}}}a(U0,"parseMapDef");function F0(t){let e=t.values,o=Object.keys(t.values).filter(i=>typeof e[e[i]]!="number").map(i=>e[i]),r=Array.from(new Set(o.map(i=>typeof i)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:o}}a(F0,"parseNativeEnumDef");function z0(t){return t.target==="openAi"?void 0:{not:be({...t,currentPath:[...t.currentPath,"not"]})}}a(z0,"parseNeverDef");function G0(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}a(G0,"parseNullDef");var Sa={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function q0(t,e){if(e.target==="openApi3")return B0(t,e);let n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(o=>o._def.typeName in Sa&&(!o._def.checks||!o._def.checks.length))){let o=n.reduce((r,i)=>{let s=Sa[i._def.typeName];return s&&!r.includes(s)?[...r,s]:r},[]);return{type:o.length>1?o:o[0]}}else if(n.every(o=>o._def.typeName==="ZodLiteral"&&!o.description)){let o=n.reduce((r,i)=>{let s=typeof i._def.value;switch(s){case"string":case"number":case"boolean":return[...r,s];case"bigint":return[...r,"integer"];case"object":if(i._def.value===null)return[...r,"null"];default:return r}},[]);if(o.length===n.length){let r=o.filter((i,s,u)=>u.indexOf(i)===s);return{type:r.length>1?r:r[0],enum:n.reduce((i,s)=>i.includes(s._def.value)?i:[...i,s._def.value],[])}}}else if(n.every(o=>o._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((o,r)=>[...o,...r._def.values.filter(i=>!o.includes(i))],[])};return B0(t,e)}a(q0,"parseUnionDef");var B0=a((t,e)=>{let n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((o,r)=>W(o._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(o=>!!o&&(!e.strictUnions||typeof o=="object"&&Object.keys(o).length>0));return n.length?{anyOf:n}:void 0},"asAnyOf");function V0(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Sa[t.innerType._def.typeName],nullable:!0}:{type:[Sa[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let o=W(t.innerType._def,{...e,currentPath:[...e.currentPath]});return o&&"$ref"in o?{allOf:[o],nullable:!0}:o&&{...o,nullable:!0}}let n=W(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}a(V0,"parseNullableDef");function Z0(t,e){let n={type:"number"};if(!t.checks)return n;for(let o of t.checks)switch(o.kind){case"int":n.type="integer",Sv(n,"type",o.message,e);break;case"min":e.target==="jsonSchema7"?o.inclusive?ie(n,"minimum",o.value,o.message,e):ie(n,"exclusiveMinimum",o.value,o.message,e):(o.inclusive||(n.exclusiveMinimum=!0),ie(n,"minimum",o.value,o.message,e));break;case"max":e.target==="jsonSchema7"?o.inclusive?ie(n,"maximum",o.value,o.message,e):ie(n,"exclusiveMaximum",o.value,o.message,e):(o.inclusive||(n.exclusiveMaximum=!0),ie(n,"maximum",o.value,o.message,e));break;case"multipleOf":ie(n,"multipleOf",o.value,o.message,e);break}return n}a(Z0,"parseNumberDef");function H0(t,e){let n=e.target==="openAi",o={type:"object",properties:{}},r=[],i=t.shape();for(let u in i){let c=i[u];if(c===void 0||c._def===void 0)continue;let l=OW(c);l&&n&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),l=!1);let p=W(c._def,{...e,currentPath:[...e.currentPath,"properties",u],propertyPath:[...e.currentPath,"properties",u]});p!==void 0&&(o.properties[u]=p,l||r.push(u))}r.length&&(o.required=r);let s=DW(t,e);return s!==void 0&&(o.additionalProperties=s),o}a(H0,"parseObjectDef");function DW(t,e){if(t.catchall._def.typeName!=="ZodNever")return W(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}a(DW,"decideAdditionalProperties");function OW(t){try{return t.isOptional()}catch(e){return!0}}a(OW,"safeIsOptional");var J0=a((t,e)=>{var o;if(e.currentPath.toString()===((o=e.propertyPath)==null?void 0:o.toString()))return W(t.innerType._def,e);let n=W(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return n?{anyOf:[{not:be(e)},n]}:be(e)},"parseOptionalDef");var K0=a((t,e)=>{if(e.pipeStrategy==="input")return W(t.in._def,e);if(e.pipeStrategy==="output")return W(t.out._def,e);let n=W(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),o=W(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,o].filter(r=>r!==void 0)}},"parsePipelineDef");function W0(t,e){return W(t.type._def,e)}a(W0,"parsePromiseDef");function j0(t,e){let o={type:"array",uniqueItems:!0,items:W(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&ie(o,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&ie(o,"maxItems",t.maxSize.value,t.maxSize.message,e),o}a(j0,"parseSetDef");function Y0(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,o)=>W(n._def,{...e,currentPath:[...e.currentPath,"items",`${o}`]})).reduce((n,o)=>o===void 0?n:[...n,o],[]),additionalItems:W(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,o)=>W(n._def,{...e,currentPath:[...e.currentPath,"items",`${o}`]})).reduce((n,o)=>o===void 0?n:[...n,o],[])}}a(Y0,"parseTupleDef");function X0(t){return{not:be(t)}}a(X0,"parseUndefinedDef");function Q0(t){return be(t)}a(Q0,"parseUnknownDef");var eD=a((t,e)=>W(t.innerType._def,e),"parseReadonlyDef");var tD=a((t,e,n)=>{switch(e){case U.ZodString:return Tc(t,n);case U.ZodNumber:return Z0(t,n);case U.ZodObject:return H0(t,n);case U.ZodBigInt:return R0(t,n);case U.ZodBoolean:return k0();case U.ZodDate:return ty(t,n);case U.ZodUndefined:return X0(n);case U.ZodNull:return G0(n);case U.ZodArray:return b0(t,n);case U.ZodUnion:case U.ZodDiscriminatedUnion:return q0(t,n);case U.ZodIntersection:return O0(t,n);case U.ZodTuple:return Y0(t,n);case U.ZodRecord:return Cc(t,n);case U.ZodLiteral:return L0(t,n);case U.ZodEnum:return D0(t);case U.ZodNativeEnum:return F0(t);case U.ZodNullable:return V0(t,n);case U.ZodOptional:return J0(t,n);case U.ZodMap:return U0(t,n);case U.ZodSet:return j0(t,n);case U.ZodLazy:return()=>t.getter()._def;case U.ZodPromise:return W0(t,n);case U.ZodNaN:case U.ZodNever:return z0(n);case U.ZodEffects:return $0(t,n);case U.ZodAny:return be(n);case U.ZodUnknown:return Q0(n);case U.ZodDefault:return N0(t,n);case U.ZodBranded:return Sc(t,n);case U.ZodReadonly:return eD(t,n);case U.ZodCatch:return P0(t,n);case U.ZodPipeline:return K0(t,n);case U.ZodFunction:case U.ZodVoid:case U.ZodSymbol:return;default:return(o=>{})(e)}},"selectParser");function W(t,e,n=!1){var u;let o=e.seen.get(t);if(e.override){let c=(u=e.override)==null?void 0:u.call(e,t,e,o,n);if(c!==x0)return c}if(o&&!n){let c=LW(o,e);if(c!==void 0)return c}let r={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,r);let i=tD(t,t.typeName,e),s=typeof i=="function"?W(i(),e):i;if(s&&MW(t,e,s),e.postProcess){let c=e.postProcess(s,t,e);return r.jsonSchema=s,c}return r.jsonSchema=s,s}a(W,"parseDef");var LW=a((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:fc(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,o)=>e.currentPath[o]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),be(e)):e.$refStrategy==="seen"?be(e):void 0}},"get$ref"),MW=a((t,e,n)=>(t.description&&(n.description=t.description,e.markdownDescription&&(n.markdownDescription=t.description)),n),"addMeta");var Ta=a((t,e)=>{var c;let n=S0(e),o=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[p,d])=>{var g;return{...l,[p]:(g=W(d._def,{...n,currentPath:[...n.basePath,n.definitionPath,p]},!0))!=null?g:be(n)}},{}):void 0,r=typeof e=="string"?e:(e==null?void 0:e.nameStrategy)==="title"||e==null?void 0:e.name,i=(c=W(t._def,r===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,r]},!1))!=null?c:be(n),s=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;s!==void 0&&(i.title=s),n.flags.hasReferencedOpenAiAnyType&&(o||(o={}),o[n.openAiAnyTypeName]||(o[n.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:n.$refStrategy==="relative"?"1":[...n.basePath,n.definitionPath,n.openAiAnyTypeName].join("/")}}));let u=r===void 0?o?{...i,[n.definitionPath]:o}:i:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,r].join("/"),[n.definitionPath]:{...o,[r]:i}};return n.target==="jsonSchema7"?u.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(u.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in u||"oneOf"in u||"allOf"in u||"type"in u&&Array.isArray(u.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),u},"zodToJsonSchema");var pe={};Rn(pe,{$brand:()=>iy,$input:()=>IE,$output:()=>CE,NEVER:()=>oy,TimePrecision:()=>kE,ZodAny:()=>ET,ZodArray:()=>IT,ZodBase64:()=>Jd,ZodBase64URL:()=>Kd,ZodBigInt:()=>is,ZodBigIntFormat:()=>Yd,ZodBoolean:()=>os,ZodCIDRv4:()=>Zd,ZodCIDRv6:()=>Hd,ZodCUID:()=>Ud,ZodCUID2:()=>Fd,ZodCatch:()=>JT,ZodCodec:()=>ru,ZodCustom:()=>ou,ZodCustomStringFormat:()=>ns,ZodDate:()=>Xa,ZodDefault:()=>GT,ZodDiscriminatedUnion:()=>wT,ZodE164:()=>Wd,ZodEmail:()=>Od,ZodEmoji:()=>Ld,ZodEnum:()=>es,ZodError:()=>mY,ZodExactOptional:()=>UT,ZodFile:()=>LT,ZodFirstPartyTypeKind:()=>sC,ZodFunction:()=>rC,ZodGUID:()=>Ja,ZodIPv4:()=>qd,ZodIPv6:()=>Vd,ZodISODate:()=>Rd,ZodISODateTime:()=>bd,ZodISODuration:()=>Pd,ZodISOTime:()=>kd,ZodIntersection:()=>bT,ZodIssueCode:()=>hY,ZodJWT:()=>jd,ZodKSUID:()=>Bd,ZodLazy:()=>eC,ZodLiteral:()=>OT,ZodMAC:()=>mT,ZodMap:()=>$T,ZodNaN:()=>WT,ZodNanoID:()=>Md,ZodNever:()=>TT,ZodNonOptional:()=>rf,ZodNull:()=>_T,ZodNullable:()=>zT,ZodNumber:()=>rs,ZodNumberFormat:()=>ro,ZodObject:()=>eu,ZodOptional:()=>nf,ZodPipe:()=>nu,ZodPrefault:()=>qT,ZodPreprocess:()=>jT,ZodPromise:()=>nC,ZodReadonly:()=>YT,ZodRealError:()=>Ct,ZodRecord:()=>Qi,ZodSet:()=>DT,ZodString:()=>ts,ZodStringFormat:()=>ye,ZodSuccess:()=>HT,ZodSymbol:()=>vT,ZodTemplateLiteral:()=>QT,ZodTransform:()=>MT,ZodTuple:()=>kT,ZodType:()=>ee,ZodULID:()=>zd,ZodURL:()=>Ya,ZodUUID:()=>En,ZodUndefined:()=>yT,ZodUnion:()=>tu,ZodUnknown:()=>ST,ZodVoid:()=>CT,ZodXID:()=>Gd,ZodXor:()=>AT,_ZodString:()=>Dd,_default:()=>BT,_function:()=>WO,any:()=>AO,array:()=>Qa,base64:()=>lO,base64url:()=>cO,bigint:()=>EO,boolean:()=>hT,catch:()=>KT,check:()=>jO,cidrv4:()=>aO,cidrv6:()=>uO,clone:()=>dt,codec:()=>ZO,coerce:()=>of,config:()=>Pe,core:()=>xn,cuid:()=>QD,cuid2:()=>eO,custom:()=>YO,date:()=>bO,decode:()=>aT,decodeAsync:()=>lT,describe:()=>XO,discriminatedUnion:()=>DO,e164:()=>dO,email:()=>qD,emoji:()=>YD,encode:()=>sT,encodeAsync:()=>uT,endsWith:()=>Vi,enum:()=>ef,exactOptional:()=>FT,file:()=>GO,flattenError:()=>Pa,float32:()=>vO,float64:()=>yO,formatError:()=>Na,fromJSONSchema:()=>iL,function:()=>WO,getErrorMap:()=>yY,globalRegistry:()=>Ke,gt:()=>yn,gte:()=>pt,guid:()=>VD,hash:()=>hO,hex:()=>gO,hostname:()=>mO,httpUrl:()=>jD,includes:()=>Bi,instanceof:()=>eL,int:()=>Nd,int32:()=>_O,int64:()=>SO,intersection:()=>RT,invertCodec:()=>HO,ipv4:()=>oO,ipv6:()=>sO,iso:()=>to,json:()=>nL,jwt:()=>fO,keyof:()=>RO,ksuid:()=>rO,lazy:()=>tC,length:()=>eo,literal:()=>zO,locales:()=>Yr,looseObject:()=>NO,looseRecord:()=>LO,lowercase:()=>zi,lt:()=>vn,lte:()=>Nt,mac:()=>iO,map:()=>MO,maxLength:()=>Qr,maxSize:()=>Tr,meta:()=>QO,mime:()=>Zi,minLength:()=>Jn,minSize:()=>_n,multipleOf:()=>Sr,nan:()=>VO,nanoid:()=>XD,nativeEnum:()=>FO,negative:()=>_d,never:()=>Xd,nonnegative:()=>Ed,nonoptional:()=>ZT,nonpositive:()=>xd,normalize:()=>Hi,null:()=>xT,nullable:()=>Wa,nullish:()=>BO,number:()=>gT,object:()=>kO,optional:()=>Ka,overwrite:()=>un,parse:()=>nT,parseAsync:()=>rT,partialRecord:()=>OO,pipe:()=>$d,positive:()=>yd,prefault:()=>VT,preprocess:()=>rL,prettifyError:()=>Ey,promise:()=>KO,property:()=>Sd,readonly:()=>XT,record:()=>NT,refine:()=>oC,regex:()=>Fi,regexes:()=>Tt,registry:()=>Yc,safeDecode:()=>dT,safeDecodeAsync:()=>pT,safeEncode:()=>cT,safeEncodeAsync:()=>fT,safeParse:()=>oT,safeParseAsync:()=>iT,set:()=>UO,setErrorMap:()=>vY,size:()=>Xr,slugify:()=>ji,startsWith:()=>qi,strictObject:()=>PO,string:()=>Ha,stringFormat:()=>pO,stringbool:()=>tL,success:()=>qO,superRefine:()=>iC,symbol:()=>CO,templateLiteral:()=>JO,toJSONSchema:()=>wr,toLowerCase:()=>Ki,toUpperCase:()=>Wi,transform:()=>tf,treeifyError:()=>xy,trim:()=>Ji,tuple:()=>PT,uint32:()=>xO,uint64:()=>TO,ulid:()=>tO,undefined:()=>IO,union:()=>Qd,unknown:()=>no,uppercase:()=>Gi,url:()=>WD,util:()=>L,uuid:()=>ZD,uuidv4:()=>HD,uuidv6:()=>JD,uuidv7:()=>KD,void:()=>wO,xid:()=>nO,xor:()=>$O});var xn={};Rn(xn,{$ZodAny:()=>Y_,$ZodArray:()=>nx,$ZodAsyncError:()=>an,$ZodBase64:()=>G_,$ZodBase64URL:()=>B_,$ZodBigInt:()=>Hc,$ZodBigIntFormat:()=>J_,$ZodBoolean:()=>La,$ZodCIDRv4:()=>U_,$ZodCIDRv6:()=>F_,$ZodCUID:()=>A_,$ZodCUID2:()=>w_,$ZodCatch:()=>xx,$ZodCheck:()=>_e,$ZodCheckBigIntFormat:()=>t_,$ZodCheckEndsWith:()=>p_,$ZodCheckGreaterThan:()=>zc,$ZodCheckIncludes:()=>d_,$ZodCheckLengthEquals:()=>a_,$ZodCheckLessThan:()=>Fc,$ZodCheckLowerCase:()=>l_,$ZodCheckMaxLength:()=>i_,$ZodCheckMaxSize:()=>n_,$ZodCheckMimeType:()=>g_,$ZodCheckMinLength:()=>s_,$ZodCheckMinSize:()=>r_,$ZodCheckMultipleOf:()=>Qy,$ZodCheckNumberFormat:()=>e_,$ZodCheckOverwrite:()=>h_,$ZodCheckProperty:()=>m_,$ZodCheckRegex:()=>u_,$ZodCheckSizeEquals:()=>o_,$ZodCheckStartsWith:()=>f_,$ZodCheckStringFormat:()=>Mi,$ZodCheckUpperCase:()=>c_,$ZodCodec:()=>Ua,$ZodCustom:()=>bx,$ZodCustomStringFormat:()=>Z_,$ZodDate:()=>tx,$ZodDefault:()=>hx,$ZodDiscriminatedUnion:()=>ix,$ZodE164:()=>q_,$ZodEmail:()=>S_,$ZodEmoji:()=>C_,$ZodEncodeError:()=>vr,$ZodEnum:()=>cx,$ZodError:()=>ka,$ZodExactOptional:()=>mx,$ZodFile:()=>fx,$ZodFunction:()=>Ix,$ZodGUID:()=>x_,$ZodIPv4:()=>O_,$ZodIPv6:()=>L_,$ZodISODate:()=>N_,$ZodISODateTime:()=>P_,$ZodISODuration:()=>D_,$ZodISOTime:()=>$_,$ZodIntersection:()=>sx,$ZodJWT:()=>V_,$ZodKSUID:()=>k_,$ZodLazy:()=>wx,$ZodLiteral:()=>dx,$ZodMAC:()=>M_,$ZodMap:()=>ux,$ZodNaN:()=>Ex,$ZodNanoID:()=>I_,$ZodNever:()=>Q_,$ZodNonOptional:()=>yx,$ZodNull:()=>j_,$ZodNullable:()=>gx,$ZodNumber:()=>Zc,$ZodNumberFormat:()=>H_,$ZodObject:()=>$D,$ZodObjectJIT:()=>rx,$ZodOptional:()=>Kc,$ZodPipe:()=>Wc,$ZodPrefault:()=>vx,$ZodPreprocess:()=>Sx,$ZodPromise:()=>Ax,$ZodReadonly:()=>Tx,$ZodRealError:()=>St,$ZodRecord:()=>ax,$ZodRegistry:()=>jc,$ZodSet:()=>lx,$ZodString:()=>jr,$ZodStringFormat:()=>ve,$ZodSuccess:()=>_x,$ZodSymbol:()=>K_,$ZodTemplateLiteral:()=>Cx,$ZodTransform:()=>px,$ZodTuple:()=>Jc,$ZodType:()=>Y,$ZodULID:()=>b_,$ZodURL:()=>T_,$ZodUUID:()=>E_,$ZodUndefined:()=>W_,$ZodUnion:()=>Ma,$ZodUnknown:()=>X_,$ZodVoid:()=>ex,$ZodXID:()=>R_,$ZodXor:()=>ox,$brand:()=>iy,$constructor:()=>C,$input:()=>IE,$output:()=>CE,Doc:()=>Oa,JSONSchema:()=>YS,JSONSchemaGenerator:()=>Ad,NEVER:()=>oy,TimePrecision:()=>kE,_any:()=>YE,_array:()=>oS,_base64:()=>md,_base64url:()=>gd,_bigint:()=>VE,_boolean:()=>BE,_catch:()=>sY,_check:()=>zD,_cidrv4:()=>fd,_cidrv6:()=>pd,_coercedBigint:()=>ZE,_coercedBoolean:()=>qE,_coercedDate:()=>nS,_coercedNumber:()=>LE,_coercedString:()=>bE,_cuid:()=>id,_cuid2:()=>sd,_custom:()=>sS,_date:()=>tS,_decode:()=>kc,_decodeAsync:()=>Nc,_default:()=>rY,_discriminatedUnion:()=>Z9,_e164:()=>hd,_email:()=>Xc,_emoji:()=>rd,_encode:()=>Rc,_encodeAsync:()=>Pc,_endsWith:()=>Vi,_enum:()=>Y9,_file:()=>iS,_float32:()=>UE,_float64:()=>FE,_gt:()=>yn,_gte:()=>pt,_guid:()=>qa,_includes:()=>Bi,_int:()=>ME,_int32:()=>zE,_int64:()=>HE,_intersection:()=>H9,_ipv4:()=>cd,_ipv6:()=>dd,_isoDate:()=>NE,_isoDateTime:()=>PE,_isoDuration:()=>DE,_isoTime:()=>$E,_jwt:()=>vd,_ksuid:()=>ld,_lazy:()=>cY,_length:()=>eo,_literal:()=>Q9,_lowercase:()=>zi,_lt:()=>vn,_lte:()=>Nt,_mac:()=>RE,_map:()=>W9,_max:()=>Nt,_maxLength:()=>Qr,_maxSize:()=>Tr,_mime:()=>Zi,_min:()=>pt,_minLength:()=>Jn,_minSize:()=>_n,_multipleOf:()=>Sr,_nan:()=>rS,_nanoid:()=>od,_nativeEnum:()=>X9,_negative:()=>_d,_never:()=>QE,_nonnegative:()=>Ed,_nonoptional:()=>oY,_nonpositive:()=>xd,_normalize:()=>Hi,_null:()=>jE,_nullable:()=>nY,_number:()=>OE,_optional:()=>tY,_overwrite:()=>un,_parse:()=>$i,_parseAsync:()=>Di,_pipe:()=>aY,_positive:()=>yd,_promise:()=>dY,_property:()=>Sd,_readonly:()=>uY,_record:()=>K9,_refine:()=>aS,_regex:()=>Fi,_safeDecode:()=>Dc,_safeDecodeAsync:()=>Lc,_safeEncode:()=>$c,_safeEncodeAsync:()=>Oc,_safeParse:()=>Oi,_safeParseAsync:()=>Li,_set:()=>j9,_size:()=>Xr,_slugify:()=>ji,_startsWith:()=>qi,_string:()=>wE,_stringFormat:()=>Yi,_stringbool:()=>dS,_success:()=>iY,_superRefine:()=>uS,_symbol:()=>KE,_templateLiteral:()=>lY,_toLowerCase:()=>Ki,_toUpperCase:()=>Wi,_transform:()=>eY,_trim:()=>Ji,_tuple:()=>J9,_uint32:()=>GE,_uint64:()=>JE,_ulid:()=>ad,_undefined:()=>WE,_union:()=>q9,_unknown:()=>XE,_uppercase:()=>Gi,_url:()=>Va,_uuid:()=>Qc,_uuidv4:()=>ed,_uuidv6:()=>td,_uuidv7:()=>nd,_void:()=>eS,_xid:()=>ud,_xor:()=>V9,clone:()=>dt,config:()=>Pe,createStandardJSONSchemaMethod:()=>Xi,createToJSONSchemaMethod:()=>fS,decode:()=>dj,decodeAsync:()=>pj,describe:()=>lS,encode:()=>cj,encodeAsync:()=>fj,extractDefs:()=>Ir,finalize:()=>Ar,flattenError:()=>Pa,formatError:()=>Na,globalConfig:()=>Jr,globalRegistry:()=>Ke,initializeContext:()=>Cr,isValidBase64:()=>z_,isValidBase64URL:()=>RD,isValidJWT:()=>kD,locales:()=>Yr,meta:()=>cS,parse:()=>wc,parseAsync:()=>bc,prettifyError:()=>Ey,process:()=>ge,regexes:()=>Tt,registry:()=>Yc,safeDecode:()=>gj,safeDecodeAsync:()=>vj,safeEncode:()=>mj,safeEncodeAsync:()=>hj,safeParse:()=>Sy,safeParseAsync:()=>Ty,toDotPath:()=>uD,toJSONSchema:()=>wr,treeifyError:()=>xy,util:()=>L,version:()=>y_});var nD,oy=Object.freeze({status:"aborted"});function C(t,e,n){var u;function o(l,p){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:p,constr:s,traits:new Set},enumerable:!1}),l._zod.traits.has(t))return;l._zod.traits.add(t),e(l,p);let d=s.prototype,g=Object.keys(d);for(let h=0;h<g.length;h++){let v=g[h];v in l||(l[v]=d[v].bind(l))}}a(o,"init");let r=(u=n==null?void 0:n.Parent)!=null?u:Object,c=class c extends r{};a(c,"Definition");let i=c;Object.defineProperty(i,"name",{value:t});function s(l){var g;var p;let d=n!=null&&n.Parent?new i:this;o(d,l),(g=(p=d._zod).deferred)!=null||(p.deferred=[]);for(let h of d._zod.deferred)h();return d}return a(s,"_"),Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:a(l=>{var p,d;return n!=null&&n.Parent&&l instanceof n.Parent?!0:(d=(p=l==null?void 0:l._zod)==null?void 0:p.traits)==null?void 0:d.has(t)},"value")}),Object.defineProperty(s,"name",{value:t}),s}a(C,"$constructor");var iy=Symbol("zod_brand"),ay=class ay extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};a(ay,"$ZodAsyncError");var an=ay,uy=class uy extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};a(uy,"$ZodEncodeError");var vr=uy,rD;(rD=(nD=globalThis).__zod_globalConfig)!=null||(nD.__zod_globalConfig={});var Jr=globalThis.__zod_globalConfig;function Pe(t){return t&&Object.assign(Jr,t),Jr}a(Pe,"config");var L={};Rn(L,{BIGINT_FORMAT_RANGES:()=>vy,Class:()=>ly,NUMBER_FORMAT_RANGES:()=>hy,aborted:()=>Er,allowsEval:()=>fy,assert:()=>BW,assertEqual:()=>UW,assertIs:()=>zW,assertNever:()=>GW,assertNotEqual:()=>FW,assignProp:()=>_r,base64ToUint8Array:()=>iD,base64urlToUint8Array:()=>ij,cached:()=>Pi,captureStackTrace:()=>Ac,cleanEnum:()=>oj,cleanRegex:()=>Aa,clone:()=>dt,cloneDef:()=>VW,createTransparentProxy:()=>jW,defineLazy:()=>re,esc:()=>Ic,escapeRegex:()=>Zt,explicitlyAborted:()=>yy,extend:()=>QW,finalizeIssue:()=>ft,floatSafeRemainder:()=>cy,getElementAtPath:()=>ZW,getEnumValues:()=>Ia,getLengthableOrigin:()=>Ra,getParsedType:()=>WW,getSizableOrigin:()=>ba,hexToUint8Array:()=>aj,isObject:()=>Kr,isPlainObject:()=>xr,issue:()=>Ni,joinValues:()=>A,jsonStringifyReplacer:()=>ki,merge:()=>tj,mergeDefs:()=>Hn,normalizeParams:()=>F,nullish:()=>yr,numKeys:()=>KW,objectClone:()=>qW,omit:()=>XW,optionalKeys:()=>gy,parsedType:()=>D,partial:()=>nj,pick:()=>YW,prefixIssues:()=>Et,primitiveTypes:()=>my,promiseAllObject:()=>HW,propertyKeyTypes:()=>wa,randomString:()=>JW,required:()=>rj,safeExtend:()=>ej,shallowClone:()=>py,slugify:()=>dy,stringifyPrimitive:()=>$,uint8ArrayToBase64:()=>sD,uint8ArrayToBase64url:()=>sj,uint8ArrayToHex:()=>uj,unwrapMessage:()=>Ca});function UW(t){return t}a(UW,"assertEqual");function FW(t){return t}a(FW,"assertNotEqual");function zW(t){}a(zW,"assertIs");function GW(t){throw new Error("Unexpected value in exhaustive check")}a(GW,"assertNever");function BW(t){}a(BW,"assert");function Ia(t){let e=Object.values(t).filter(o=>typeof o=="number");return Object.entries(t).filter(([o,r])=>e.indexOf(+o)===-1).map(([o,r])=>r)}a(Ia,"getEnumValues");function A(t,e="|"){return t.map(n=>$(n)).join(e)}a(A,"joinValues");function ki(t,e){return typeof e=="bigint"?e.toString():e}a(ki,"jsonStringifyReplacer");function Pi(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}a(Pi,"cached");function yr(t){return t==null}a(yr,"nullish");function Aa(t){let e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}a(Aa,"cleanRegex");function cy(t,e){let n=t/e,o=Math.round(n),r=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-o)<r?0:n-o}a(cy,"floatSafeRemainder");var oD=Symbol("evaluating");function re(t,e,n){let o;Object.defineProperty(t,e,{get(){if(o!==oD)return o===void 0&&(o=oD,o=n()),o},set(r){Object.defineProperty(t,e,{value:r})},configurable:!0})}a(re,"defineLazy");function qW(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}a(qW,"objectClone");function _r(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}a(_r,"assignProp");function Hn(...t){let e={};for(let n of t){let o=Object.getOwnPropertyDescriptors(n);Object.assign(e,o)}return Object.defineProperties({},e)}a(Hn,"mergeDefs");function VW(t){return Hn(t._zod.def)}a(VW,"cloneDef");function ZW(t,e){return e?e.reduce((n,o)=>n==null?void 0:n[o],t):t}a(ZW,"getElementAtPath");function HW(t){let e=Object.keys(t),n=e.map(o=>t[o]);return Promise.all(n).then(o=>{let r={};for(let i=0;i<e.length;i++)r[e[i]]=o[i];return r})}a(HW,"promiseAllObject");function JW(t=10){let e="abcdefghijklmnopqrstuvwxyz",n="";for(let o=0;o<t;o++)n+=e[Math.floor(Math.random()*e.length)];return n}a(JW,"randomString");function Ic(t){return JSON.stringify(t)}a(Ic,"esc");function dy(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}a(dy,"slugify");var Ac="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Kr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(Kr,"isObject");var fy=Pi(()=>{var t;if(Jr.jitless||typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)!=null&&t.includes("Cloudflare")))return!1;try{let e=Function;return new e(""),!0}catch(e){return!1}});function xr(t){if(Kr(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let n=e.prototype;return!(Kr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}a(xr,"isPlainObject");function py(t){return xr(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}a(py,"shallowClone");function KW(t){let e=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}a(KW,"numKeys");var WW=a(t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},"getParsedType"),wa=new Set(["string","number","symbol"]),my=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Zt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Zt,"escapeRegex");function dt(t,e,n){let o=new t._zod.constr(e!=null?e:t._zod.def);return(!e||n!=null&&n.parent)&&(o._zod.parent=t),o}a(dt,"clone");function F(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:a(()=>e,"error")};if((e==null?void 0:e.message)!==void 0){if((e==null?void 0:e.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:a(()=>e.error,"error")}:e}a(F,"normalizeParams");function jW(t){let e;return new Proxy({},{get(n,o,r){return e!=null||(e=t()),Reflect.get(e,o,r)},set(n,o,r,i){return e!=null||(e=t()),Reflect.set(e,o,r,i)},has(n,o){return e!=null||(e=t()),Reflect.has(e,o)},deleteProperty(n,o){return e!=null||(e=t()),Reflect.deleteProperty(e,o)},ownKeys(n){return e!=null||(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(n,o){return e!=null||(e=t()),Reflect.getOwnPropertyDescriptor(e,o)},defineProperty(n,o,r){return e!=null||(e=t()),Reflect.defineProperty(e,o,r)}})}a(jW,"createTransparentProxy");function $(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}a($,"stringifyPrimitive");function gy(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}a(gy,"optionalKeys");var hy={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},vy={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function YW(t,e){let n=t._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=Hn(t._zod.def,{get shape(){let s={};for(let u in e){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);e[u]&&(s[u]=n.shape[u])}return _r(this,"shape",s),s},checks:[]});return dt(t,i)}a(YW,"pick");function XW(t,e){let n=t._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=Hn(t._zod.def,{get shape(){let s={...t._zod.def.shape};for(let u in e){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);e[u]&&delete s[u]}return _r(this,"shape",s),s},checks:[]});return dt(t,i)}a(XW,"omit");function QW(t,e){if(!xr(e))throw new Error("Invalid input to extend: expected a plain object");let n=t._zod.def.checks;if(n&&n.length>0){let i=t._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=Hn(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return _r(this,"shape",i),i}});return dt(t,r)}a(QW,"extend");function ej(t,e){if(!xr(e))throw new Error("Invalid input to safeExtend: expected a plain object");let n=Hn(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return _r(this,"shape",o),o}});return dt(t,n)}a(ej,"safeExtend");function tj(t,e){var o,r;if((o=t._zod.def.checks)!=null&&o.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=Hn(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return _r(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:(r=e._zod.def.checks)!=null?r:[]});return dt(t,n)}a(tj,"merge");function nj(t,e,n){let r=e._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=Hn(e._zod.def,{get shape(){let u=e._zod.def.shape,c={...u};if(n)for(let l in n){if(!(l in u))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=t?new t({type:"optional",innerType:u[l]}):u[l])}else for(let l in u)c[l]=t?new t({type:"optional",innerType:u[l]}):u[l];return _r(this,"shape",c),c},checks:[]});return dt(e,s)}a(nj,"partial");function rj(t,e,n){let o=Hn(e._zod.def,{get shape(){let r=e._zod.def.shape,i={...r};if(n)for(let s in n){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(i[s]=new t({type:"nonoptional",innerType:r[s]}))}else for(let s in r)i[s]=new t({type:"nonoptional",innerType:r[s]});return _r(this,"shape",i),i}});return dt(e,o)}a(rj,"required");function Er(t,e=0){var n;if(t.aborted===!0)return!0;for(let o=e;o<t.issues.length;o++)if(((n=t.issues[o])==null?void 0:n.continue)!==!0)return!0;return!1}a(Er,"aborted");function yy(t,e=0){var n;if(t.aborted===!0)return!0;for(let o=e;o<t.issues.length;o++)if(((n=t.issues[o])==null?void 0:n.continue)===!1)return!0;return!1}a(yy,"explicitlyAborted");function Et(t,e){return e.map(n=>{var r;var o;return(r=(o=n).path)!=null||(o.path=[]),n.path.unshift(t),n})}a(Et,"prefixIssues");function Ca(t){return typeof t=="string"?t:t==null?void 0:t.message}a(Ca,"unwrapMessage");function ft(t,e,n){var c,l,p,d,g,h,v,y,_,x,E;let o=t.message?t.message:(x=(_=(v=(g=Ca((p=(l=(c=t.inst)==null?void 0:c._zod.def)==null?void 0:l.error)==null?void 0:p.call(l,t)))!=null?g:Ca((d=e==null?void 0:e.error)==null?void 0:d.call(e,t)))!=null?v:Ca((h=n.customError)==null?void 0:h.call(n,t)))!=null?_:Ca((y=n.localeError)==null?void 0:y.call(n,t)))!=null?x:"Invalid input",{inst:r,continue:i,input:s,...u}=t;return(E=u.path)!=null||(u.path=[]),u.message=o,e!=null&&e.reportInput&&(u.input=s),u}a(ft,"finalizeIssue");function ba(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}a(ba,"getSizableOrigin");function Ra(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}a(Ra,"getLengthableOrigin");function D(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let n=t;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return e}a(D,"parsedType");function Ni(...t){let[e,n,o]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:o}:{...e}}a(Ni,"issue");function oj(t){return Object.entries(t).filter(([e,n])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a(oj,"cleanEnum");function iD(t){let e=atob(t),n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return n}a(iD,"base64ToUint8Array");function sD(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}a(sD,"uint8ArrayToBase64");function ij(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-e.length%4)%4);return iD(e+n)}a(ij,"base64urlToUint8Array");function sj(t){return sD(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}a(sj,"uint8ArrayToBase64url");function aj(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(e.length/2);for(let o=0;o<e.length;o+=2)n[o/2]=Number.parseInt(e.slice(o,o+2),16);return n}a(aj,"hexToUint8Array");function uj(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}a(uj,"uint8ArrayToHex");var _y=class _y{constructor(...e){}};a(_y,"Class");var ly=_y;var aD=a((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,ki,2),Object.defineProperty(t,"toString",{value:a(()=>t.message,"value"),enumerable:!1})},"initializer"),ka=C("$ZodError",aD),St=C("$ZodError",aD,{Parent:Error});function Pa(t,e=n=>n.message){let n={},o=[];for(let r of t.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(e(r))):o.push(e(r));return{formErrors:o,fieldErrors:n}}a(Pa,"flattenError");function Na(t,e=n=>n.message){let n={_errors:[]},o=a((r,i=[])=>{for(let s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(u=>o({issues:u},[...i,...s.path]));else if(s.code==="invalid_key")o({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")o({issues:s.issues},[...i,...s.path]);else{let u=[...i,...s.path];if(u.length===0)n._errors.push(e(s));else{let c=n,l=0;for(;l<u.length;){let p=u[l];l===u.length-1?(c[p]=c[p]||{_errors:[]},c[p]._errors.push(e(s))):c[p]=c[p]||{_errors:[]},c=c[p],l++}}}},"processError");return o(t),n}a(Na,"formatError");function xy(t,e=n=>n.message){let n={errors:[]},o=a((r,i=[])=>{var c,l,p,d;var s,u;for(let g of r.issues)if(g.code==="invalid_union"&&g.errors.length)g.errors.map(h=>o({issues:h},[...i,...g.path]));else if(g.code==="invalid_key")o({issues:g.issues},[...i,...g.path]);else if(g.code==="invalid_element")o({issues:g.issues},[...i,...g.path]);else{let h=[...i,...g.path];if(h.length===0){n.errors.push(e(g));continue}let v=n,y=0;for(;y<h.length;){let _=h[y],x=y===h.length-1;typeof _=="string"?((c=v.properties)!=null||(v.properties={}),(l=(s=v.properties)[_])!=null||(s[_]={errors:[]}),v=v.properties[_]):((p=v.items)!=null||(v.items=[]),(d=(u=v.items)[_])!=null||(u[_]={errors:[]}),v=v.items[_]),x&&v.errors.push(e(g)),y++}}},"processError");return o(t),n}a(xy,"treeifyError");function uD(t){let e=[],n=t.map(o=>typeof o=="object"?o.key:o);for(let o of n)typeof o=="number"?e.push(`[${o}]`):typeof o=="symbol"?e.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?e.push(`[${JSON.stringify(o)}]`):(e.length&&e.push("."),e.push(o));return e.join("")}a(uD,"toDotPath");function Ey(t){var o;let e=[],n=[...t.issues].sort((r,i)=>{var s,u;return((s=r.path)!=null?s:[]).length-((u=i.path)!=null?u:[]).length});for(let r of n)e.push(`\u2716 ${r.message}`),(o=r.path)!=null&&o.length&&e.push(` \u2192 at ${uD(r.path)}`);return e.join(`
18
+ `)}a(Ey,"prettifyError");var $i=a(t=>(e,n,o,r)=>{var u;let i=o?{...o,async:!1}:{async:!1},s=e._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new an;if(s.issues.length){let c=new((u=r==null?void 0:r.Err)!=null?u:t)(s.issues.map(l=>ft(l,i,Pe())));throw Ac(c,r==null?void 0:r.callee),c}return s.value},"_parse"),wc=$i(St),Di=a(t=>async(e,n,o,r)=>{var u;let i=o?{...o,async:!0}:{async:!0},s=e._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new((u=r==null?void 0:r.Err)!=null?u:t)(s.issues.map(l=>ft(l,i,Pe())));throw Ac(c,r==null?void 0:r.callee),c}return s.value},"_parseAsync"),bc=Di(St),Oi=a(t=>(e,n,o)=>{let r=o?{...o,async:!1}:{async:!1},i=e._zod.run({value:n,issues:[]},r);if(i instanceof Promise)throw new an;return i.issues.length?{success:!1,error:new(t!=null?t:ka)(i.issues.map(s=>ft(s,r,Pe())))}:{success:!0,data:i.value}},"_safeParse"),Sy=Oi(St),Li=a(t=>async(e,n,o)=>{let r=o?{...o,async:!0}:{async:!0},i=e._zod.run({value:n,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new t(i.issues.map(s=>ft(s,r,Pe())))}:{success:!0,data:i.value}},"_safeParseAsync"),Ty=Li(St),Rc=a(t=>(e,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return $i(t)(e,n,r)},"_encode"),cj=Rc(St),kc=a(t=>(e,n,o)=>$i(t)(e,n,o),"_decode"),dj=kc(St),Pc=a(t=>async(e,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return Di(t)(e,n,r)},"_encodeAsync"),fj=Pc(St),Nc=a(t=>async(e,n,o)=>Di(t)(e,n,o),"_decodeAsync"),pj=Nc(St),$c=a(t=>(e,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return Oi(t)(e,n,r)},"_safeEncode"),mj=$c(St),Dc=a(t=>(e,n,o)=>Oi(t)(e,n,o),"_safeDecode"),gj=Dc(St),Oc=a(t=>async(e,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return Li(t)(e,n,r)},"_safeEncodeAsync"),hj=Oc(St),Lc=a(t=>async(e,n,o)=>Li(t)(e,n,o),"_safeDecodeAsync"),vj=Lc(St);var Tt={};Rn(Tt,{base64:()=>Fy,base64url:()=>Mc,bigint:()=>Hy,boolean:()=>Ky,browserEmail:()=>Ij,cidrv4:()=>My,cidrv6:()=>Uy,cuid:()=>Cy,cuid2:()=>Iy,date:()=>By,datetime:()=>Vy,domain:()=>bj,duration:()=>ky,e164:()=>Gy,email:()=>Ny,emoji:()=>$y,extendedDuration:()=>yj,guid:()=>Py,hex:()=>Rj,hostname:()=>wj,html5Email:()=>Sj,httpProtocol:()=>zy,idnEmail:()=>Cj,integer:()=>Jy,ipv4:()=>Dy,ipv6:()=>Oy,ksuid:()=>by,lowercase:()=>Yy,mac:()=>Ly,md5_base64:()=>Pj,md5_base64url:()=>Nj,md5_hex:()=>kj,nanoid:()=>Ry,null:()=>Wy,number:()=>Uc,rfc5322Email:()=>Tj,sha1_base64:()=>Dj,sha1_base64url:()=>Oj,sha1_hex:()=>$j,sha256_base64:()=>Mj,sha256_base64url:()=>Uj,sha256_hex:()=>Lj,sha384_base64:()=>zj,sha384_base64url:()=>Gj,sha384_hex:()=>Fj,sha512_base64:()=>qj,sha512_base64url:()=>Vj,sha512_hex:()=>Bj,string:()=>Zy,time:()=>qy,ulid:()=>Ay,undefined:()=>jy,unicodeEmail:()=>lD,uppercase:()=>Xy,uuid:()=>Wr,uuid4:()=>_j,uuid6:()=>xj,uuid7:()=>Ej,xid:()=>wy});var Cy=/^[cC][0-9a-z]{6,}$/,Iy=/^[0-9a-z]+$/,Ay=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,wy=/^[0-9a-vA-V]{20}$/,by=/^[A-Za-z0-9]{27}$/,Ry=/^[a-zA-Z0-9_-]{21}$/,ky=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,yj=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Py=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Wr=a(t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,"uuid"),_j=Wr(4),xj=Wr(6),Ej=Wr(7),Ny=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Sj=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Tj=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,lD=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Cj=lD,Ij=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Aj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function $y(){return new RegExp(Aj,"u")}a($y,"emoji");var Dy=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Oy=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ly=a(t=>{let e=Zt(t!=null?t:":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},"mac"),My=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Uy=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Fy=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Mc=/^[A-Za-z0-9_-]*$/,wj=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,bj=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,zy=/^https?$/,Gy=/^\+[1-9]\d{6,14}$/,cD="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",By=new RegExp(`^${cD}$`);function dD(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}a(dD,"timeSource");function qy(t){return new RegExp(`^${dD(t)}$`)}a(qy,"time");function Vy(t){let e=dD({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${e}(?:${n.join("|")})`;return new RegExp(`^${cD}T(?:${o})$`)}a(Vy,"datetime");var Zy=a(t=>{var n,o;let e=t?`[\\s\\S]{${(n=t==null?void 0:t.minimum)!=null?n:0},${(o=t==null?void 0:t.maximum)!=null?o:""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),Hy=/^-?\d+n?$/,Jy=/^-?\d+$/,Uc=/^-?\d+(?:\.\d+)?$/,Ky=/^(?:true|false)$/i,Wy=/^null$/i;var jy=/^undefined$/i;var Yy=/^[^A-Z]*$/,Xy=/^[^a-z]*$/,Rj=/^[0-9a-fA-F]*$/;function $a(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}a($a,"fixedBase64");function Da(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}a(Da,"fixedBase64url");var kj=/^[0-9a-fA-F]{32}$/,Pj=$a(22,"=="),Nj=Da(22),$j=/^[0-9a-fA-F]{40}$/,Dj=$a(27,"="),Oj=Da(27),Lj=/^[0-9a-fA-F]{64}$/,Mj=$a(43,"="),Uj=Da(43),Fj=/^[0-9a-fA-F]{96}$/,zj=$a(64,""),Gj=Da(64),Bj=/^[0-9a-fA-F]{128}$/,qj=$a(86,"=="),Vj=Da(86);var _e=C("$ZodCheck",(t,e)=>{var o,r;var n;(o=t._zod)!=null||(t._zod={}),t._zod.def=e,(r=(n=t._zod).onattach)!=null||(n.onattach=[])}),pD={number:"number",bigint:"bigint",object:"date"},Fc=C("$ZodCheckLessThan",(t,e)=>{_e.init(t,e);let n=pD[typeof e.value];t._zod.onattach.push(o=>{var s;let r=o._zod.bag,i=(s=e.inclusive?r.maximum:r.exclusiveMaximum)!=null?s:Number.POSITIVE_INFINITY;e.value<i&&(e.inclusive?r.maximum=e.value:r.exclusiveMaximum=e.value)}),t._zod.check=o=>{(e.inclusive?o.value<=e.value:o.value<e.value)||o.issues.push({origin:n,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:o.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),zc=C("$ZodCheckGreaterThan",(t,e)=>{_e.init(t,e);let n=pD[typeof e.value];t._zod.onattach.push(o=>{var s;let r=o._zod.bag,i=(s=e.inclusive?r.minimum:r.exclusiveMinimum)!=null?s:Number.NEGATIVE_INFINITY;e.value>i&&(e.inclusive?r.minimum=e.value:r.exclusiveMinimum=e.value)}),t._zod.check=o=>{(e.inclusive?o.value>=e.value:o.value>e.value)||o.issues.push({origin:n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:o.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Qy=C("$ZodCheckMultipleOf",(t,e)=>{_e.init(t,e),t._zod.onattach.push(n=>{var r;var o;(r=(o=n._zod.bag).multipleOf)!=null||(o.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):cy(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),e_=C("$ZodCheckNumberFormat",(t,e)=>{var s;_e.init(t,e),e.format=e.format||"float64";let n=(s=e.format)==null?void 0:s.includes("int"),o=n?"int":"number",[r,i]=hy[e.format];t._zod.onattach.push(u=>{let c=u._zod.bag;c.format=e.format,c.minimum=r,c.maximum=i,n&&(c.pattern=Jy)}),t._zod.check=u=>{let c=u.value;if(n){if(!Number.isInteger(c)){u.issues.push({expected:o,format:e.format,code:"invalid_type",continue:!1,input:c,inst:t});return}if(!Number.isSafeInteger(c)){c>0?u.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:o,inclusive:!0,continue:!e.abort}):u.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:o,inclusive:!0,continue:!e.abort});return}}c<r&&u.issues.push({origin:"number",input:c,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),c>i&&u.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),t_=C("$ZodCheckBigIntFormat",(t,e)=>{_e.init(t,e);let[n,o]=vy[e.format];t._zod.onattach.push(r=>{let i=r._zod.bag;i.format=e.format,i.minimum=n,i.maximum=o}),t._zod.check=r=>{let i=r.value;i<n&&r.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),i>o&&r.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),n_=C("$ZodCheckMaxSize",(t,e)=>{var o;var n;_e.init(t,e),(o=(n=t._zod.def).when)!=null||(n.when=r=>{let i=r.value;return!yr(i)&&i.size!==void 0}),t._zod.onattach.push(r=>{var s;let i=(s=r._zod.bag.maximum)!=null?s:Number.POSITIVE_INFINITY;e.maximum<i&&(r._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{let i=r.value;i.size<=e.maximum||r.issues.push({origin:ba(i),code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),r_=C("$ZodCheckMinSize",(t,e)=>{var o;var n;_e.init(t,e),(o=(n=t._zod.def).when)!=null||(n.when=r=>{let i=r.value;return!yr(i)&&i.size!==void 0}),t._zod.onattach.push(r=>{var s;let i=(s=r._zod.bag.minimum)!=null?s:Number.NEGATIVE_INFINITY;e.minimum>i&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let i=r.value;i.size>=e.minimum||r.issues.push({origin:ba(i),code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),o_=C("$ZodCheckSizeEquals",(t,e)=>{var o;var n;_e.init(t,e),(o=(n=t._zod.def).when)!=null||(n.when=r=>{let i=r.value;return!yr(i)&&i.size!==void 0}),t._zod.onattach.push(r=>{let i=r._zod.bag;i.minimum=e.size,i.maximum=e.size,i.size=e.size}),t._zod.check=r=>{let i=r.value,s=i.size;if(s===e.size)return;let u=s>e.size;r.issues.push({origin:ba(i),...u?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),i_=C("$ZodCheckMaxLength",(t,e)=>{var o;var n;_e.init(t,e),(o=(n=t._zod.def).when)!=null||(n.when=r=>{let i=r.value;return!yr(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{var s;let i=(s=r._zod.bag.maximum)!=null?s:Number.POSITIVE_INFINITY;e.maximum<i&&(r._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{let i=r.value;if(i.length<=e.maximum)return;let u=Ra(i);r.issues.push({origin:u,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),s_=C("$ZodCheckMinLength",(t,e)=>{var o;var n;_e.init(t,e),(o=(n=t._zod.def).when)!=null||(n.when=r=>{let i=r.value;return!yr(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{var s;let i=(s=r._zod.bag.minimum)!=null?s:Number.NEGATIVE_INFINITY;e.minimum>i&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let i=r.value;if(i.length>=e.minimum)return;let u=Ra(i);r.issues.push({origin:u,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),a_=C("$ZodCheckLengthEquals",(t,e)=>{var o;var n;_e.init(t,e),(o=(n=t._zod.def).when)!=null||(n.when=r=>{let i=r.value;return!yr(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{let i=r._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=r=>{let i=r.value,s=i.length;if(s===e.length)return;let u=Ra(i),c=s>e.length;r.issues.push({origin:u,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),Mi=C("$ZodCheckStringFormat",(t,e)=>{var r,i;var n,o;_e.init(t,e),t._zod.onattach.push(s=>{var c;let u=s._zod.bag;u.format=e.format,e.pattern&&((c=u.patterns)!=null||(u.patterns=new Set),u.patterns.add(e.pattern))}),e.pattern?(r=(n=t._zod).check)!=null||(n.check=s=>{e.pattern.lastIndex=0,!e.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:e.format,input:s.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(i=(o=t._zod).check)!=null||(o.check=()=>{})}),u_=C("$ZodCheckRegex",(t,e)=>{Mi.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),l_=C("$ZodCheckLowerCase",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Yy),Mi.init(t,e)}),c_=C("$ZodCheckUpperCase",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Xy),Mi.init(t,e)}),d_=C("$ZodCheckIncludes",(t,e)=>{_e.init(t,e);let n=Zt(e.includes),o=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=o,t._zod.onattach.push(r=>{var s;let i=r._zod.bag;(s=i.patterns)!=null||(i.patterns=new Set),i.patterns.add(o)}),t._zod.check=r=>{r.value.includes(e.includes,e.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:r.value,inst:t,continue:!e.abort})}}),f_=C("$ZodCheckStartsWith",(t,e)=>{var o;_e.init(t,e);let n=new RegExp(`^${Zt(e.prefix)}.*`);(o=e.pattern)!=null||(e.pattern=n),t._zod.onattach.push(r=>{var s;let i=r._zod.bag;(s=i.patterns)!=null||(i.patterns=new Set),i.patterns.add(n)}),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),p_=C("$ZodCheckEndsWith",(t,e)=>{var o;_e.init(t,e);let n=new RegExp(`.*${Zt(e.suffix)}$`);(o=e.pattern)!=null||(e.pattern=n),t._zod.onattach.push(r=>{var s;let i=r._zod.bag;(s=i.patterns)!=null||(i.patterns=new Set),i.patterns.add(n)}),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}});function fD(t,e,n){t.issues.length&&e.issues.push(...Et(n,t.issues))}a(fD,"handleCheckPropertyResult");var m_=C("$ZodCheckProperty",(t,e)=>{_e.init(t,e),t._zod.check=n=>{let o=e.schema._zod.run({value:n.value[e.property],issues:[]},{});if(o instanceof Promise)return o.then(r=>fD(r,n,e.property));fD(o,n,e.property)}}),g_=C("$ZodCheckMimeType",(t,e)=>{_e.init(t,e);let n=new Set(e.mime);t._zod.onattach.push(o=>{o._zod.bag.mime=e.mime}),t._zod.check=o=>{n.has(o.value.type)||o.issues.push({code:"invalid_value",values:e.mime,input:o.value.type,inst:t,continue:!e.abort})}}),h_=C("$ZodCheckOverwrite",(t,e)=>{_e.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});var v_=class v_{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let o=e.split(`
19
+ `).filter(s=>s),r=Math.min(...o.map(s=>s.length-s.trimStart().length)),i=o.map(s=>s.slice(r)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){var i;let e=Function,n=this==null?void 0:this.args,r=[...((i=this==null?void 0:this.content)!=null?i:[""]).map(s=>` ${s}`)];return new e(...n,r.join(`
20
+ `))}};a(v_,"Doc");var Oa=v_;var y_={major:4,minor:4,patch:3};var Y=C("$ZodType",(t,e)=>{var r,i,s;var n;t!=null||(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=y_;let o=[...(r=t._zod.def.checks)!=null?r:[]];t._zod.traits.has("$ZodCheck")&&o.unshift(t);for(let u of o)for(let c of u._zod.onattach)c(t);if(o.length===0)(i=(n=t._zod).deferred)!=null||(n.deferred=[]),(s=t._zod.deferred)==null||s.push(()=>{t._zod.run=t._zod.parse});else{let u=a((l,p,d)=>{let g=Er(l),h;for(let v of p){if(v._zod.def.when){if(yy(l)||!v._zod.def.when(l))continue}else if(g)continue;let y=l.issues.length,_=v._zod.check(l);if(_ instanceof Promise&&(d==null?void 0:d.async)===!1)throw new an;if(h||_ instanceof Promise)h=(h!=null?h:Promise.resolve()).then(async()=>{await _,l.issues.length!==y&&(g||(g=Er(l,y)))});else{if(l.issues.length===y)continue;g||(g=Er(l,y))}}return h?h.then(()=>l):l},"runChecks"),c=a((l,p,d)=>{if(Er(l))return l.aborted=!0,l;let g=u(p,o,d);if(g instanceof Promise){if(d.async===!1)throw new an;return g.then(h=>t._zod.parse(h,d))}return t._zod.parse(g,d)},"handleCanaryResult");t._zod.run=(l,p)=>{if(p.skipChecks)return t._zod.parse(l,p);if(p.direction==="backward"){let g=t._zod.parse({value:l.value,issues:[]},{...p,skipChecks:!0});return g instanceof Promise?g.then(h=>c(h,l,p)):c(g,l,p)}let d=t._zod.parse(l,p);if(d instanceof Promise){if(p.async===!1)throw new an;return d.then(g=>u(g,o,p))}return u(d,o,p)}}re(t,"~standard",()=>({validate:a(u=>{var c;try{let l=Sy(t,u);return l.success?{value:l.data}:{issues:(c=l.error)==null?void 0:c.issues}}catch(l){return Ty(t,u).then(p=>{var d;return p.success?{value:p.data}:{issues:(d=p.error)==null?void 0:d.issues}})}},"validate"),vendor:"zod",version:1}))}),jr=C("$ZodString",(t,e)=>{var n,o,r;Y.init(t,e),t._zod.pattern=(r=[...(o=(n=t==null?void 0:t._zod.bag)==null?void 0:n.patterns)!=null?o:[]].pop())!=null?r:Zy(t._zod.bag),t._zod.parse=(i,s)=>{if(e.coerce)try{i.value=String(i.value)}catch(u){}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:t}),i}}),ve=C("$ZodStringFormat",(t,e)=>{Mi.init(t,e),jr.init(t,e)}),x_=C("$ZodGUID",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Py),ve.init(t,e)}),E_=C("$ZodUUID",(t,e)=>{var n,o;if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);(n=e.pattern)!=null||(e.pattern=Wr(i))}else(o=e.pattern)!=null||(e.pattern=Wr());ve.init(t,e)}),S_=C("$ZodEmail",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Ny),ve.init(t,e)}),T_=C("$ZodURL",(t,e)=>{ve.init(t,e),t._zod.check=n=>{var o;try{let r=n.value.trim();if(!e.normalize&&((o=e.protocol)==null?void 0:o.source)===zy.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!e.abort});return}let i=new URL(r);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:n.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort})),e.normalize?n.value=i.href:n.value=r;return}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),C_=C("$ZodEmoji",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=$y()),ve.init(t,e)}),I_=C("$ZodNanoID",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Ry),ve.init(t,e)}),A_=C("$ZodCUID",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Cy),ve.init(t,e)}),w_=C("$ZodCUID2",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Iy),ve.init(t,e)}),b_=C("$ZodULID",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Ay),ve.init(t,e)}),R_=C("$ZodXID",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=wy),ve.init(t,e)}),k_=C("$ZodKSUID",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=by),ve.init(t,e)}),P_=C("$ZodISODateTime",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Vy(e)),ve.init(t,e)}),N_=C("$ZodISODate",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=By),ve.init(t,e)}),$_=C("$ZodISOTime",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=qy(e)),ve.init(t,e)}),D_=C("$ZodISODuration",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=ky),ve.init(t,e)}),O_=C("$ZodIPv4",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Dy),ve.init(t,e),t._zod.bag.format="ipv4"}),L_=C("$ZodIPv6",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Oy),ve.init(t,e),t._zod.bag.format="ipv6",t._zod.check=o=>{try{new URL(`http://[${o.value}]`)}catch(r){o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:t,continue:!e.abort})}}}),M_=C("$ZodMAC",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Ly(e.delimiter)),ve.init(t,e),t._zod.bag.format="mac"}),U_=C("$ZodCIDRv4",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=My),ve.init(t,e)}),F_=C("$ZodCIDRv6",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Uy),ve.init(t,e),t._zod.check=o=>{let r=o.value.split("/");try{if(r.length!==2)throw new Error;let[i,s]=r;if(!s)throw new Error;let u=Number(s);if(`${u}`!==s)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${i}]`)}catch(i){o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:t,continue:!e.abort})}}});function z_(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch(e){return!1}}a(z_,"isValidBase64");var G_=C("$ZodBase64",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Fy),ve.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=o=>{z_(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:t,continue:!e.abort})}});function RD(t){if(!Mc.test(t))return!1;let e=t.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return z_(n)}a(RD,"isValidBase64URL");var B_=C("$ZodBase64URL",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Mc),ve.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=o=>{RD(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:t,continue:!e.abort})}}),q_=C("$ZodE164",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Gy),ve.init(t,e)});function kD(t,e=null){try{let n=t.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let r=JSON.parse(atob(o));return!("typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||e&&(!("alg"in r)||r.alg!==e))}catch(n){return!1}}a(kD,"isValidJWT");var V_=C("$ZodJWT",(t,e)=>{ve.init(t,e),t._zod.check=n=>{kD(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),Z_=C("$ZodCustomStringFormat",(t,e)=>{ve.init(t,e),t._zod.check=n=>{e.fn(n.value)||n.issues.push({code:"invalid_format",format:e.format,input:n.value,inst:t,continue:!e.abort})}}),Zc=C("$ZodNumber",(t,e)=>{var n;Y.init(t,e),t._zod.pattern=(n=t._zod.bag.pattern)!=null?n:Uc,t._zod.parse=(o,r)=>{if(e.coerce)try{o.value=Number(o.value)}catch(u){}let i=o.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return o;let s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return o.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),o}}),H_=C("$ZodNumberFormat",(t,e)=>{e_.init(t,e),Zc.init(t,e)}),La=C("$ZodBoolean",(t,e)=>{Y.init(t,e),t._zod.pattern=Ky,t._zod.parse=(n,o)=>{if(e.coerce)try{n.value=!!n.value}catch(i){}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:t}),n}}),Hc=C("$ZodBigInt",(t,e)=>{Y.init(t,e),t._zod.pattern=Hy,t._zod.parse=(n,o)=>{if(e.coerce)try{n.value=BigInt(n.value)}catch(r){}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:t}),n}}),J_=C("$ZodBigIntFormat",(t,e)=>{t_.init(t,e),Hc.init(t,e)}),K_=C("$ZodSymbol",(t,e)=>{Y.init(t,e),t._zod.parse=(n,o)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:t}),n}}),W_=C("$ZodUndefined",(t,e)=>{Y.init(t,e),t._zod.pattern=jy,t._zod.values=new Set([void 0]),t._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:t}),n}}),j_=C("$ZodNull",(t,e)=>{Y.init(t,e),t._zod.pattern=Wy,t._zod.values=new Set([null]),t._zod.parse=(n,o)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:t}),n}}),Y_=C("$ZodAny",(t,e)=>{Y.init(t,e),t._zod.parse=n=>n}),X_=C("$ZodUnknown",(t,e)=>{Y.init(t,e),t._zod.parse=n=>n}),Q_=C("$ZodNever",(t,e)=>{Y.init(t,e),t._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),ex=C("$ZodVoid",(t,e)=>{Y.init(t,e),t._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:t}),n}}),tx=C("$ZodDate",(t,e)=>{Y.init(t,e),t._zod.parse=(n,o)=>{if(e.coerce)try{n.value=new Date(n.value)}catch(u){}let r=n.value,i=r instanceof Date;return i&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...i?{received:"Invalid Date"}:{},inst:t}),n}});function gD(t,e,n){t.issues.length&&e.issues.push(...Et(n,t.issues)),e.value[n]=t.value}a(gD,"handleArrayResult");var nx=C("$ZodArray",(t,e)=>{Y.init(t,e),t._zod.parse=(n,o)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:t}),n;n.value=Array(r.length);let i=[];for(let s=0;s<r.length;s++){let u=r[s],c=e.element._zod.run({value:u,issues:[]},o);c instanceof Promise?i.push(c.then(l=>gD(l,n,s))):gD(c,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function Vc(t,e,n,o,r,i){let s=n in o;if(t.issues.length){if(r&&i&&!s)return;e.issues.push(...Et(n,t.issues))}if(!s&&!r){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}t.value===void 0?s&&(e.value[n]=void 0):e.value[n]=t.value}a(Vc,"handlePropertyResult");function PD(t){var o,r,i,s;let e=Object.keys(t.shape);for(let u of e)if(!((s=(i=(r=(o=t.shape)==null?void 0:o[u])==null?void 0:r._zod)==null?void 0:i.traits)!=null&&s.has("$ZodType")))throw new Error(`Invalid element at key "${u}": expected a Zod schema`);let n=gy(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}a(PD,"normalizeDef");function ND(t,e,n,o,r,i){let s=[],u=r.keySet,c=r.catchall._zod,l=c.def.type,p=c.optin==="optional",d=c.optout==="optional";for(let g in e){if(g==="__proto__"||u.has(g))continue;if(l==="never"){s.push(g);continue}let h=c.run({value:e[g],issues:[]},o);h instanceof Promise?t.push(h.then(v=>Vc(v,n,g,e,p,d))):Vc(h,n,g,e,p,d)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:i}),t.length?Promise.all(t).then(()=>n):n}a(ND,"handleCatchall");var $D=C("$ZodObject",(t,e)=>{Y.init(t,e);let n=Object.getOwnPropertyDescriptor(e,"shape");if(!(n!=null&&n.get)){let u=e.shape;Object.defineProperty(e,"shape",{get:a(()=>{let c={...u};return Object.defineProperty(e,"shape",{value:c}),c},"get")})}let o=Pi(()=>PD(e));re(t._zod,"propValues",()=>{var l;let u=e.shape,c={};for(let p in u){let d=u[p]._zod;if(d.values){(l=c[p])!=null||(c[p]=new Set);for(let g of d.values)c[p].add(g)}}return c});let r=Kr,i=e.catchall,s;t._zod.parse=(u,c)=>{s!=null||(s=o.value);let l=u.value;if(!r(l))return u.issues.push({expected:"object",code:"invalid_type",input:l,inst:t}),u;u.value={};let p=[],d=s.shape;for(let g of s.keys){let h=d[g],v=h._zod.optin==="optional",y=h._zod.optout==="optional",_=h._zod.run({value:l[g],issues:[]},c);_ instanceof Promise?p.push(_.then(x=>Vc(x,u,g,l,v,y))):Vc(_,u,g,l,v,y)}return i?ND(p,l,u,c,o.value,t):p.length?Promise.all(p).then(()=>u):u}}),rx=C("$ZodObjectJIT",(t,e)=>{$D.init(t,e);let n=t._zod.parse,o=Pi(()=>PD(e)),r=a(g=>{var T,S;let h=new Oa(["shape","payload","ctx"]),v=o.value,y=a(I=>{let w=Ic(I);return`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`},"parseStr");h.write("const input = payload.value;");let _=Object.create(null),x=0;for(let I of v.keys)_[I]=`key_${x++}`;h.write("const newResult = {};");for(let I of v.keys){let w=_[I],b=Ic(I),B=g[I],k=((T=B==null?void 0:B._zod)==null?void 0:T.optin)==="optional",V=((S=B==null?void 0:B._zod)==null?void 0:S.optout)==="optional";h.write(`const ${w} = ${y(I)};`),k&&V?h.write(`
21
+ if (${w}.issues.length) {
22
+ if (${b} in input) {
23
+ payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
24
+ ...iss,
25
+ path: iss.path ? [${b}, ...iss.path] : [${b}]
26
+ })));
27
+ }
28
+ }
29
+
30
+ if (${w}.value === undefined) {
31
+ if (${b} in input) {
32
+ newResult[${b}] = undefined;
33
+ }
34
+ } else {
35
+ newResult[${b}] = ${w}.value;
36
+ }
37
+
38
+ `):k?h.write(`
39
+ if (${w}.issues.length) {
40
+ payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
41
+ ...iss,
42
+ path: iss.path ? [${b}, ...iss.path] : [${b}]
43
+ })));
44
+ }
45
+
46
+ if (${w}.value === undefined) {
47
+ if (${b} in input) {
48
+ newResult[${b}] = undefined;
49
+ }
50
+ } else {
51
+ newResult[${b}] = ${w}.value;
52
+ }
53
+
54
+ `):h.write(`
55
+ const ${w}_present = ${b} in input;
56
+ if (${w}.issues.length) {
57
+ payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
58
+ ...iss,
59
+ path: iss.path ? [${b}, ...iss.path] : [${b}]
60
+ })));
61
+ }
62
+ if (!${w}_present && !${w}.issues.length) {
63
+ payload.issues.push({
64
+ code: "invalid_type",
65
+ expected: "nonoptional",
66
+ input: undefined,
67
+ path: [${b}]
68
+ });
69
+ }
70
+
71
+ if (${w}_present) {
72
+ if (${w}.value === undefined) {
73
+ newResult[${b}] = undefined;
74
+ } else {
75
+ newResult[${b}] = ${w}.value;
76
+ }
77
+ }
78
+
79
+ `)}h.write("payload.value = newResult;"),h.write("return payload;");let E=h.compile();return(I,w)=>E(g,I,w)},"generateFastpass"),i,s=Kr,u=!Jr.jitless,l=u&&fy.value,p=e.catchall,d;t._zod.parse=(g,h)=>{d!=null||(d=o.value);let v=g.value;return s(v)?u&&l&&(h==null?void 0:h.async)===!1&&h.jitless!==!0?(i||(i=r(e.shape)),g=i(g,h),p?ND([],v,g,h,d,t):g):n(g,h):(g.issues.push({expected:"object",code:"invalid_type",input:v,inst:t}),g)}});function hD(t,e,n,o){for(let i of t)if(i.issues.length===0)return e.value=i.value,e;let r=t.filter(i=>!Er(i));return r.length===1?(e.value=r[0].value,r[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(i=>i.issues.map(s=>ft(s,o,Pe())))}),e)}a(hD,"handleUnionResults");var Ma=C("$ZodUnion",(t,e)=>{Y.init(t,e),re(t._zod,"optin",()=>e.options.some(o=>o._zod.optin==="optional")?"optional":void 0),re(t._zod,"optout",()=>e.options.some(o=>o._zod.optout==="optional")?"optional":void 0),re(t._zod,"values",()=>{if(e.options.every(o=>o._zod.values))return new Set(e.options.flatMap(o=>Array.from(o._zod.values)))}),re(t._zod,"pattern",()=>{if(e.options.every(o=>o._zod.pattern)){let o=e.options.map(r=>r._zod.pattern);return new RegExp(`^(${o.map(r=>Aa(r.source)).join("|")})$`)}});let n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(o,r)=>{if(n)return n(o,r);let i=!1,s=[];for(let u of e.options){let c=u._zod.run({value:o.value,issues:[]},r);if(c instanceof Promise)s.push(c),i=!0;else{if(c.issues.length===0)return c;s.push(c)}}return i?Promise.all(s).then(u=>hD(u,o,t,r)):hD(s,o,t,r)}});function vD(t,e,n,o){let r=t.filter(i=>i.issues.length===0);return r.length===1?(e.value=r[0].value,e):(r.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(i=>i.issues.map(s=>ft(s,o,Pe())))}):e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:[],inclusive:!1}),e)}a(vD,"handleExclusiveUnionResults");var ox=C("$ZodXor",(t,e)=>{Ma.init(t,e),e.inclusive=!1;let n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(o,r)=>{if(n)return n(o,r);let i=!1,s=[];for(let u of e.options){let c=u._zod.run({value:o.value,issues:[]},r);c instanceof Promise?(s.push(c),i=!0):s.push(c)}return i?Promise.all(s).then(u=>vD(u,o,t,r)):vD(s,o,t,r)}}),ix=C("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Ma.init(t,e);let n=t._zod.parse;re(t._zod,"propValues",()=>{let r={};for(let i of e.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let[u,c]of Object.entries(s)){r[u]||(r[u]=new Set);for(let l of c)r[u].add(l)}}return r});let o=Pi(()=>{var s;let r=e.options,i=new Map;for(let u of r){let c=(s=u._zod.propValues)==null?void 0:s[e.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(u)}"`);for(let l of c){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,u)}}return i});t._zod.parse=(r,i)=>{let s=r.value;if(!Kr(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),r;let u=o.value.get(s==null?void 0:s[e.discriminator]);return u?u._zod.run(r,i):e.unionFallback||i.direction==="backward"?n(r,i):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(o.value.keys()),input:s,path:[e.discriminator],inst:t}),r)}}),sx=C("$ZodIntersection",(t,e)=>{Y.init(t,e),t._zod.parse=(n,o)=>{let r=n.value,i=e.left._zod.run({value:r,issues:[]},o),s=e.right._zod.run({value:r,issues:[]},o);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,l])=>yD(n,c,l)):yD(n,i,s)}});function __(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(xr(t)&&xr(e)){let n=Object.keys(e),o=Object.keys(t).filter(i=>n.indexOf(i)!==-1),r={...t,...e};for(let i of o){let s=__(t[i],e[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r[i]=s.data}return{valid:!0,data:r}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o<t.length;o++){let r=t[o],i=e[o],s=__(r,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}a(__,"mergeValues");function yD(t,e,n){let o=new Map,r;for(let u of e.issues)if(u.code==="unrecognized_keys"){r!=null||(r=u);for(let c of u.keys)o.has(c)||o.set(c,{}),o.get(c).l=!0}else t.issues.push(u);for(let u of n.issues)if(u.code==="unrecognized_keys")for(let c of u.keys)o.has(c)||o.set(c,{}),o.get(c).r=!0;else t.issues.push(u);let i=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(i.length&&r&&t.issues.push({...r,keys:i}),Er(t))return t;let s=__(e.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return t.value=s.data,t}a(yD,"handleIntersectionResults");var Jc=C("$ZodTuple",(t,e)=>{Y.init(t,e);let n=e.items;t._zod.parse=(o,r)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:t,expected:"tuple",code:"invalid_type"}),o;o.value=[];let s=[],u=_D(n,"optin"),c=_D(n,"optout");if(!e.rest){if(i.length<u)return o.issues.push({code:"too_small",minimum:u,inclusive:!0,input:i,inst:t,origin:"array"}),o;i.length>n.length&&o.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:i,inst:t,origin:"array"})}let l=new Array(n.length);for(let p=0;p<n.length;p++){let d=n[p]._zod.run({value:i[p],issues:[]},r);d instanceof Promise?s.push(d.then(g=>{l[p]=g})):l[p]=d}if(e.rest){let p=n.length-1,d=i.slice(n.length);for(let g of d){p++;let h=e.rest._zod.run({value:g,issues:[]},r);h instanceof Promise?s.push(h.then(v=>xD(v,o,p))):xD(h,o,p)}}return s.length?Promise.all(s).then(()=>ED(l,o,n,i,c)):ED(l,o,n,i,c)}});function _D(t,e){for(let n=t.length-1;n>=0;n--)if(t[n]._zod[e]!=="optional")return n+1;return 0}a(_D,"getTupleOptStart");function xD(t,e,n){t.issues.length&&e.issues.push(...Et(n,t.issues)),e.value[n]=t.value}a(xD,"handleTupleResult");function ED(t,e,n,o,r){for(let i=0;i<n.length;i++){let s=t[i],u=i<o.length;if(s.issues.length){if(!u&&i>=r){e.value.length=i;break}e.issues.push(...Et(i,s.issues))}e.value[i]=s.value}for(let i=e.value.length-1;i>=o.length&&(n[i]._zod.optout==="optional"&&e.value[i]===void 0);i--)e.value.length=i;return e}a(ED,"handleTupleResults");var ax=C("$ZodRecord",(t,e)=>{Y.init(t,e),t._zod.parse=(n,o)=>{let r=n.value;if(!xr(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:t}),n;let i=[],s=e.keyType._zod.values;if(s){n.value={};let u=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){u.add(typeof l=="number"?l.toString():l);let p=e.keyType._zod.run({value:l,issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(h=>ft(h,o,Pe())),input:l,path:[l],inst:t});continue}let d=p.value,g=e.valueType._zod.run({value:r[l],issues:[]},o);g instanceof Promise?i.push(g.then(h=>{h.issues.length&&n.issues.push(...Et(l,h.issues)),n.value[d]=h.value})):(g.issues.length&&n.issues.push(...Et(l,g.issues)),n.value[d]=g.value)}let c;for(let l in r)u.has(l)||(c=c!=null?c:[],c.push(l));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:t,keys:c})}else{n.value={};for(let u of Reflect.ownKeys(r)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(r,u))continue;let c=e.keyType._zod.run({value:u,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Uc.test(u)&&c.issues.length){let d=e.keyType._zod.run({value:Number(u),issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){e.mode==="loose"?n.value[u]=r[u]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>ft(d,o,Pe())),input:u,path:[u],inst:t});continue}let p=e.valueType._zod.run({value:r[u],issues:[]},o);p instanceof Promise?i.push(p.then(d=>{d.issues.length&&n.issues.push(...Et(u,d.issues)),n.value[c.value]=d.value})):(p.issues.length&&n.issues.push(...Et(u,p.issues)),n.value[c.value]=p.value)}}return i.length?Promise.all(i).then(()=>n):n}}),ux=C("$ZodMap",(t,e)=>{Y.init(t,e),t._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:t}),n;let i=[];n.value=new Map;for(let[s,u]of r){let c=e.keyType._zod.run({value:s,issues:[]},o),l=e.valueType._zod.run({value:u,issues:[]},o);c instanceof Promise||l instanceof Promise?i.push(Promise.all([c,l]).then(([p,d])=>{SD(p,d,n,s,r,t,o)})):SD(c,l,n,s,r,t,o)}return i.length?Promise.all(i).then(()=>n):n}});function SD(t,e,n,o,r,i,s){t.issues.length&&(wa.has(typeof o)?n.issues.push(...Et(o,t.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:i,issues:t.issues.map(u=>ft(u,s,Pe()))})),e.issues.length&&(wa.has(typeof o)?n.issues.push(...Et(o,e.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:i,key:o,issues:e.issues.map(u=>ft(u,s,Pe()))})),n.value.set(t.value,e.value)}a(SD,"handleMapResult");var lx=C("$ZodSet",(t,e)=>{Y.init(t,e),t._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:t,expected:"set",code:"invalid_type"}),n;let i=[];n.value=new Set;for(let s of r){let u=e.valueType._zod.run({value:s,issues:[]},o);u instanceof Promise?i.push(u.then(c=>TD(c,n))):TD(u,n)}return i.length?Promise.all(i).then(()=>n):n}});function TD(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}a(TD,"handleSetResult");var cx=C("$ZodEnum",(t,e)=>{Y.init(t,e);let n=Ia(e.entries),o=new Set(n);t._zod.values=o,t._zod.pattern=new RegExp(`^(${n.filter(r=>wa.has(typeof r)).map(r=>typeof r=="string"?Zt(r):r.toString()).join("|")})$`),t._zod.parse=(r,i)=>{let s=r.value;return o.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:t}),r}}),dx=C("$ZodLiteral",(t,e)=>{if(Y.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let n=new Set(e.values);t._zod.values=n,t._zod.pattern=new RegExp(`^(${e.values.map(o=>typeof o=="string"?Zt(o):o?Zt(o.toString()):String(o)).join("|")})$`),t._zod.parse=(o,r)=>{let i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:e.values,input:i,inst:t}),o}}),fx=C("$ZodFile",(t,e)=>{Y.init(t,e),t._zod.parse=(n,o)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:t}),n}}),px=C("$ZodTransform",(t,e)=>{Y.init(t,e),t._zod.optin="optional",t._zod.parse=(n,o)=>{if(o.direction==="backward")throw new vr(t.constructor.name);let r=e.transform(n.value,n);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then(s=>(n.value=s,n.fallback=!0,n));if(r instanceof Promise)throw new an;return n.value=r,n.fallback=!0,n}});function CD(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}a(CD,"handleOptionalResult");var Kc=C("$ZodOptional",(t,e)=>{Y.init(t,e),t._zod.optin="optional",t._zod.optout="optional",re(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),re(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Aa(n.source)})?$`):void 0}),t._zod.parse=(n,o)=>{if(e.innerType._zod.optin==="optional"){let r=n.value,i=e.innerType._zod.run(n,o);return i instanceof Promise?i.then(s=>CD(s,r)):CD(i,r)}return n.value===void 0?n:e.innerType._zod.run(n,o)}}),mx=C("$ZodExactOptional",(t,e)=>{Kc.init(t,e),re(t._zod,"values",()=>e.innerType._zod.values),re(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(n,o)=>e.innerType._zod.run(n,o)}),gx=C("$ZodNullable",(t,e)=>{Y.init(t,e),re(t._zod,"optin",()=>e.innerType._zod.optin),re(t._zod,"optout",()=>e.innerType._zod.optout),re(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Aa(n.source)}|null)$`):void 0}),re(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,o)=>n.value===null?n:e.innerType._zod.run(n,o)}),hx=C("$ZodDefault",(t,e)=>{Y.init(t,e),t._zod.optin="optional",re(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,o)=>{if(o.direction==="backward")return e.innerType._zod.run(n,o);if(n.value===void 0)return n.value=e.defaultValue,n;let r=e.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>ID(i,e)):ID(r,e)}});function ID(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}a(ID,"handleDefaultResult");var vx=C("$ZodPrefault",(t,e)=>{Y.init(t,e),t._zod.optin="optional",re(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,o)=>(o.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,o))}),yx=C("$ZodNonOptional",(t,e)=>{Y.init(t,e),re(t._zod,"values",()=>{let n=e.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),t._zod.parse=(n,o)=>{let r=e.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>AD(i,t)):AD(r,t)}});function AD(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}a(AD,"handleNonOptionalResult");var _x=C("$ZodSuccess",(t,e)=>{Y.init(t,e),t._zod.parse=(n,o)=>{if(o.direction==="backward")throw new vr("ZodSuccess");let r=e.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),xx=C("$ZodCatch",(t,e)=>{Y.init(t,e),t._zod.optin="optional",re(t._zod,"optout",()=>e.innerType._zod.optout),re(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,o)=>{if(o.direction==="backward")return e.innerType._zod.run(n,o);let r=e.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.value,i.issues.length&&(n.value=e.catchValue({...n,error:{issues:i.issues.map(s=>ft(s,o,Pe()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=r.value,r.issues.length&&(n.value=e.catchValue({...n,error:{issues:r.issues.map(i=>ft(i,o,Pe()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),Ex=C("$ZodNaN",(t,e)=>{Y.init(t,e),t._zod.parse=(n,o)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:t,expected:"nan",code:"invalid_type"}),n)}),Wc=C("$ZodPipe",(t,e)=>{Y.init(t,e),re(t._zod,"values",()=>e.in._zod.values),re(t._zod,"optin",()=>e.in._zod.optin),re(t._zod,"optout",()=>e.out._zod.optout),re(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,o)=>{if(o.direction==="backward"){let i=e.out._zod.run(n,o);return i instanceof Promise?i.then(s=>Gc(s,e.in,o)):Gc(i,e.in,o)}let r=e.in._zod.run(n,o);return r instanceof Promise?r.then(i=>Gc(i,e.out,o)):Gc(r,e.out,o)}});function Gc(t,e,n){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},n)}a(Gc,"handlePipeResult");var Ua=C("$ZodCodec",(t,e)=>{Y.init(t,e),re(t._zod,"values",()=>e.in._zod.values),re(t._zod,"optin",()=>e.in._zod.optin),re(t._zod,"optout",()=>e.out._zod.optout),re(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,o)=>{if((o.direction||"forward")==="forward"){let i=e.in._zod.run(n,o);return i instanceof Promise?i.then(s=>Bc(s,e,o)):Bc(i,e,o)}else{let i=e.out._zod.run(n,o);return i instanceof Promise?i.then(s=>Bc(s,e,o)):Bc(i,e,o)}}});function Bc(t,e,n){if(t.issues.length)return t.aborted=!0,t;if((n.direction||"forward")==="forward"){let r=e.transform(t.value,t);return r instanceof Promise?r.then(i=>qc(t,i,e.out,n)):qc(t,r,e.out,n)}else{let r=e.reverseTransform(t.value,t);return r instanceof Promise?r.then(i=>qc(t,i,e.in,n)):qc(t,r,e.in,n)}}a(Bc,"handleCodecAResult");function qc(t,e,n,o){return t.issues.length?(t.aborted=!0,t):n._zod.run({value:e,issues:t.issues},o)}a(qc,"handleCodecTxResult");var Sx=C("$ZodPreprocess",(t,e)=>{Wc.init(t,e)}),Tx=C("$ZodReadonly",(t,e)=>{Y.init(t,e),re(t._zod,"propValues",()=>e.innerType._zod.propValues),re(t._zod,"values",()=>e.innerType._zod.values),re(t._zod,"optin",()=>{var n,o;return(o=(n=e.innerType)==null?void 0:n._zod)==null?void 0:o.optin}),re(t._zod,"optout",()=>{var n,o;return(o=(n=e.innerType)==null?void 0:n._zod)==null?void 0:o.optout}),t._zod.parse=(n,o)=>{if(o.direction==="backward")return e.innerType._zod.run(n,o);let r=e.innerType._zod.run(n,o);return r instanceof Promise?r.then(wD):wD(r)}});function wD(t){return t.value=Object.freeze(t.value),t}a(wD,"handleReadonlyResult");var Cx=C("$ZodTemplateLiteral",(t,e)=>{Y.init(t,e);let n=[];for(let o of e.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let r=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=r.startsWith("^")?1:0,s=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(i,s))}else if(o===null||my.has(typeof o))n.push(Zt(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);t._zod.pattern=new RegExp(`^${n.join("")}$`),t._zod.parse=(o,r)=>{var i;return typeof o.value!="string"?(o.issues.push({input:o.value,inst:t,expected:"string",code:"invalid_type"}),o):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:t,code:"invalid_format",format:(i=e.format)!=null?i:"template_literal",pattern:t._zod.pattern.source}),o)}}),Ix=C("$ZodFunction",(t,e)=>(Y.init(t,e),t._def=e,t._zod.def=e,t.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...o){let r=t._def.input?wc(t._def.input,o):o,i=Reflect.apply(n,this,r);return t._def.output?wc(t._def.output,i):i}},t.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let r=t._def.input?await bc(t._def.input,o):o,i=await Reflect.apply(n,this,r);return t._def.output?await bc(t._def.output,i):i}},t._zod.parse=(n,o)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:t}),n):(t._def.output&&t._def.output._zod.def.type==="promise"?n.value=t.implementAsync(n.value):n.value=t.implement(n.value),n),t.input=(...n)=>{let o=t.constructor;return Array.isArray(n[0])?new o({type:"function",input:new Jc({type:"tuple",items:n[0],rest:n[1]}),output:t._def.output}):new o({type:"function",input:n[0],output:t._def.output})},t.output=n=>{let o=t.constructor;return new o({type:"function",input:t._def.input,output:n})},t)),Ax=C("$ZodPromise",(t,e)=>{Y.init(t,e),t._zod.parse=(n,o)=>Promise.resolve(n.value).then(r=>e.innerType._zod.run({value:r,issues:[]},o))}),wx=C("$ZodLazy",(t,e)=>{Y.init(t,e),re(t._zod,"innerType",()=>{let n=e;return n._cachedInner||(n._cachedInner=e.getter()),n._cachedInner}),re(t._zod,"pattern",()=>{var n,o;return(o=(n=t._zod.innerType)==null?void 0:n._zod)==null?void 0:o.pattern}),re(t._zod,"propValues",()=>{var n,o;return(o=(n=t._zod.innerType)==null?void 0:n._zod)==null?void 0:o.propValues}),re(t._zod,"optin",()=>{var n,o,r;return(r=(o=(n=t._zod.innerType)==null?void 0:n._zod)==null?void 0:o.optin)!=null?r:void 0}),re(t._zod,"optout",()=>{var n,o,r;return(r=(o=(n=t._zod.innerType)==null?void 0:n._zod)==null?void 0:o.optout)!=null?r:void 0}),t._zod.parse=(n,o)=>t._zod.innerType._zod.run(n,o)}),bx=C("$ZodCustom",(t,e)=>{_e.init(t,e),Y.init(t,e),t._zod.parse=(n,o)=>n,t._zod.check=n=>{let o=n.value,r=e.fn(o);if(r instanceof Promise)return r.then(i=>bD(i,n,o,t));bD(r,n,o,t)}});function bD(t,e,n,o){var r;if(!t){let i={code:"custom",input:n,inst:o,path:[...(r=o._zod.def.path)!=null?r:[]],continue:!o._zod.def.abort};o._zod.def.params&&(i.params=o._zod.def.params),e.issues.push(Ni(i))}}a(bD,"handleRefineResult");var Yr={};Rn(Yr,{ar:()=>Rx,az:()=>kx,be:()=>Px,bg:()=>Nx,ca:()=>$x,cs:()=>Dx,da:()=>Ox,de:()=>Lx,el:()=>Mx,en:()=>Fa,eo:()=>Ux,es:()=>Fx,fa:()=>zx,fi:()=>Gx,fr:()=>Bx,frCA:()=>qx,he:()=>Vx,hr:()=>Zx,hu:()=>Hx,hy:()=>Jx,id:()=>Kx,is:()=>Wx,it:()=>jx,ja:()=>Yx,ka:()=>Xx,kh:()=>Qx,km:()=>za,ko:()=>eE,lt:()=>tE,mk:()=>nE,ms:()=>rE,nl:()=>oE,no:()=>iE,ota:()=>sE,pl:()=>uE,ps:()=>aE,pt:()=>lE,ro:()=>cE,ru:()=>dE,sl:()=>fE,sv:()=>pE,ta:()=>mE,th:()=>gE,tr:()=>hE,ua:()=>vE,uk:()=>Ba,ur:()=>yE,uz:()=>_E,vi:()=>xE,yo:()=>TE,zhCN:()=>EE,zhTW:()=>SE});var Hj=a(()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${h}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${d}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${h}`}case"invalid_value":return r.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${$(r.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${(u=r.origin)!=null?u:"\u0627\u0644\u0642\u064A\u0645\u0629"} ${d} ${r.maximum.toString()} ${(c=g.unit)!=null?c:"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${(l=r.origin)!=null?l:"\u0627\u0644\u0642\u064A\u0645\u0629"} ${d} ${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${d} ${r.minimum.toString()} ${g.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${d} ${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:d.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${d.suffix}"`:d.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${d.includes}"`:d.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${d.pattern}`:`${(p=n[d.format])!=null?p:r.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${A(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"error");function Rx(){return{localeError:Hj()}}a(Rx,"default");var Jj=a(()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");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"},o={nan:"NaN"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${r.expected}, daxil olan ${h}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${d}, daxil olan ${h}`}case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${$(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${(u=r.origin)!=null?u:"d\u0259y\u0259r"} ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${(l=r.origin)!=null?l:"d\u0259y\u0259r"} ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${d}${r.minimum.toString()} ${g.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${d.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:d.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${d.suffix}" il\u0259 bitm\u0259lidir`:d.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${d.includes}" daxil olmal\u0131d\u0131r`:d.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${d.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${A(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"error");function kx(){return{localeError:Jj()}}a(kx,"default");function DD(t,e,n,o){let r=Math.abs(t),i=r%10,s=r%100;return s>=11&&s<=19?o:i===1?e:i>=2&&i<=4?n:o}a(DD,"getBelarusianPlural");var Kj=a(()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return r=>{var i,s,u,c,l;switch(r.code){case"invalid_type":{let p=(i=o[r.expected])!=null?i:r.expected,d=D(r.input),g=(s=o[d])!=null?s:d;return/^[A-Z]/.test(r.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${g}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${p}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${g}`}case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${$(r.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${A(r.values,"|")}`;case"too_big":{let p=r.inclusive?"<=":"<",d=e(r.origin);if(d){let g=Number(r.maximum),h=DD(g,d.unit.one,d.unit.few,d.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${(u=r.origin)!=null?u:"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${d.verb} ${p}${r.maximum.toString()} ${h}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${(c=r.origin)!=null?c:"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${p}${r.maximum.toString()}`}case"too_small":{let p=r.inclusive?">=":">",d=e(r.origin);if(d){let g=Number(r.minimum),h=DD(g,d.unit.one,d.unit.few,d.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${d.verb} ${p}${r.minimum.toString()} ${h}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${p}${r.minimum.toString()}`}case"invalid_format":{let p=r;return p.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${p.prefix}"`:p.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${p.suffix}"`:p.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${p.includes}"`:p.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${p.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${(l=n[p.format])!=null?l:r.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${A(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"error");function Px(){return{localeError:Kj()}}a(Px,"default");var Wj=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${h}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${d}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${h}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${$(r.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${(u=r.origin)!=null?u:"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${(l=r.origin)!=null?l:"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${d}${r.minimum.toString()} ${g.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;if(d.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${d.prefix}"`;if(d.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${d.suffix}"`;if(d.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${d.includes}"`;if(d.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${d.pattern}`;let g="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return d.format==="emoji"&&(g="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),d.format==="datetime"&&(g="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),d.format==="date"&&(g="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),d.format==="time"&&(g="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),d.format==="duration"&&(g="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${g} ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${r.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u043E\u0432\u0435":""}: ${A(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}},"error");function Nx(){return{localeError:Wj()}}a(Nx,"default");var jj=a(()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"entrada",email:"adre\xE7a electr\xF2nica",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\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${h}`:`Tipus inv\xE0lid: s'esperava ${d}, s'ha rebut ${h}`}case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${$(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${A(r.values," o ")}`;case"too_big":{let d=r.inclusive?"com a m\xE0xim":"menys de",g=e(r.origin);return g?`Massa gran: s'esperava que ${(u=r.origin)!=null?u:"el valor"} contingu\xE9s ${d} ${r.maximum.toString()} ${(c=g.unit)!=null?c:"elements"}`:`Massa gran: s'esperava que ${(l=r.origin)!=null?l:"el valor"} fos ${d} ${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?"com a m\xEDnim":"m\xE9s de",g=e(r.origin);return g?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${d} ${r.minimum.toString()} ${g.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${d} ${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${d.prefix}"`:d.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${d.suffix}"`:d.format==="includes"?`Format inv\xE0lid: ha d'incloure "${d.includes}"`:d.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${d.pattern}`:`Format inv\xE0lid per a ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${A(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}},"error");function $x(){return{localeError:jj()}}a($x,"default");var Yj=a(()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 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 \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return r=>{var i,s,u,c,l,p,d,g,h;switch(r.code){case"invalid_type":{let v=(i=o[r.expected])!=null?i:r.expected,y=D(r.input),_=(s=o[y])!=null?s:y;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${r.expected}, obdr\u017Eeno ${_}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${v}, obdr\u017Eeno ${_}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${$(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${A(r.values,"|")}`;case"too_big":{let v=r.inclusive?"<=":"<",y=e(r.origin);return y?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${(u=r.origin)!=null?u:"hodnota"} mus\xED m\xEDt ${v}${r.maximum.toString()} ${(c=y.unit)!=null?c:"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${(l=r.origin)!=null?l:"hodnota"} mus\xED b\xFDt ${v}${r.maximum.toString()}`}case"too_small":{let v=r.inclusive?">=":">",y=e(r.origin);return y?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${(p=r.origin)!=null?p:"hodnota"} mus\xED m\xEDt ${v}${r.minimum.toString()} ${(d=y.unit)!=null?d:"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${(g=r.origin)!=null?g:"hodnota"} mus\xED b\xFDt ${v}${r.minimum.toString()}`}case"invalid_format":{let v=r;return v.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${v.prefix}"`:v.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${v.suffix}"`:v.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${v.includes}"`:v.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${v.pattern}`:`Neplatn\xFD form\xE1t ${(h=n[v.format])!=null?h:r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${A(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}},"error");function Dx(){return{localeError:Yj()}}a(Dx,"default");var Xj=a(()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");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\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",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"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`Ugyldigt input: forventede instanceof ${r.expected}, fik ${h}`:`Ugyldigt input: forventede ${d}, fik ${h}`}case"invalid_value":return r.values.length===1?`Ugyldig v\xE6rdi: forventede ${$(r.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin),h=(u=o[r.origin])!=null?u:r.origin;return g?`For stor: forventede ${h!=null?h:"value"} ${g.verb} ${d} ${r.maximum.toString()} ${(c=g.unit)!=null?c:"elementer"}`:`For stor: forventede ${h!=null?h:"value"} havde ${d} ${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin),h=(l=o[r.origin])!=null?l:r.origin;return g?`For lille: forventede ${h} ${g.verb} ${d} ${r.minimum.toString()} ${g.unit}`:`For lille: forventede ${h} havde ${d} ${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`Ugyldig streng: skal starte med "${d.prefix}"`:d.format==="ends_with"?`Ugyldig streng: skal ende med "${d.suffix}"`:d.format==="includes"?`Ugyldig streng: skal indeholde "${d.includes}"`:d.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${d.pattern}`:`Ugyldig ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${A(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${r.origin}`;default:return"Ugyldigt input"}}},"error");function Ox(){return{localeError:Xj()}}a(Ox,"default");var Qj=a(()=>{let t={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 e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");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"},o={nan:"NaN",number:"Zahl",array:"Array"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${h}`:`Ung\xFCltige Eingabe: erwartet ${d}, erhalten ${h}`}case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${$(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`Zu gro\xDF: erwartet, dass ${(u=r.origin)!=null?u:"Wert"} ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${(l=r.origin)!=null?l:"Wert"} ${d}${r.maximum.toString()} ist`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`Zu klein: erwartet, dass ${r.origin} ${d}${r.minimum.toString()} ${g.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${d}${r.minimum.toString()} ist`}case"invalid_format":{let d=r;return d.format==="starts_with"?`Ung\xFCltiger String: muss mit "${d.prefix}" beginnen`:d.format==="ends_with"?`Ung\xFCltiger String: muss mit "${d.suffix}" enden`:d.format==="includes"?`Ung\xFCltiger String: muss "${d.includes}" enthalten`:d.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${d.pattern} entsprechen`:`Ung\xFCltig: ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${A(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}},"error");function Lx(){return{localeError:Qj()}}a(Lx,"default");var e9=a(()=>{let t={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 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 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return typeof r.expected=="string"&&/^[A-Z]/.test(r.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${r.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${h}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${d}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${h}`}case"invalid_value":return r.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${$(r.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${(u=r.origin)!=null?u:"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${(l=r.origin)!=null?l:"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${d}${r.minimum.toString()} ${g.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${d.prefix}"`:d.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${d.suffix}"`:d.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${d.includes}"`:d.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${d.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${r.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${r.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${r.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${A(r.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${r.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${r.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}},"error");function Mx(){return{localeError:e9()}}a(Mx,"default");var t9=a(()=>{let t={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 e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");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"},o={nan:"NaN"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return`Invalid input: expected ${d}, received ${h}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${$(r.values[0])}`:`Invalid option: expected one of ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`Too big: expected ${(u=r.origin)!=null?u:"value"} to have ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"elements"}`:`Too big: expected ${(l=r.origin)!=null?l:"value"} to be ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`Too small: expected ${r.origin} to have ${d}${r.minimum.toString()} ${g.unit}`:`Too small: expected ${r.origin} to be ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`Invalid string: must start with "${d.prefix}"`:d.format==="ends_with"?`Invalid string: must end with "${d.suffix}"`:d.format==="includes"?`Invalid string: must include "${d.includes}"`:d.format==="regex"?`Invalid string: must match pattern ${d.pattern}`:`Invalid ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${A(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`Invalid discriminator value. Expected ${r.options.map(g=>`'${g}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}},"error");function Fa(){return{localeError:t9()}}a(Fa,"default");var n9=a(()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",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\u016Dro",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"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${r.expected}, ricevi\u011Dis ${h}`:`Nevalida enigo: atendi\u011Dis ${d}, ricevi\u011Dis ${h}`}case"invalid_value":return r.values.length===1?`Nevalida enigo: atendi\u011Dis ${$(r.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`Tro granda: atendi\u011Dis ke ${(u=r.origin)!=null?u:"valoro"} havu ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"elementojn"}`:`Tro granda: atendi\u011Dis ke ${(l=r.origin)!=null?l:"valoro"} havu ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`Tro malgranda: atendi\u011Dis ke ${r.origin} havu ${d}${r.minimum.toString()} ${g.unit}`:`Tro malgranda: atendi\u011Dis ke ${r.origin} estu ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${d.prefix}"`:d.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${d.suffix}"`:d.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${d.includes}"`:d.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${d.pattern}`:`Nevalida ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} \u015Dlosilo${r.keys.length>1?"j":""}: ${A(r.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}},"error");function Ux(){return{localeError:n9()}}a(Ux,"default");var r9=a(()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",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\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return r=>{var i,s,u,c,l,p,d,g;switch(r.code){case"invalid_type":{let h=(i=o[r.expected])!=null?i:r.expected,v=D(r.input),y=(s=o[v])!=null?s:v;return/^[A-Z]/.test(r.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${y}`:`Entrada inv\xE1lida: se esperaba ${h}, recibido ${y}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${$(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${A(r.values,"|")}`;case"too_big":{let h=r.inclusive?"<=":"<",v=e(r.origin),y=(u=o[r.origin])!=null?u:r.origin;return v?`Demasiado grande: se esperaba que ${y!=null?y:"valor"} tuviera ${h}${r.maximum.toString()} ${(c=v.unit)!=null?c:"elementos"}`:`Demasiado grande: se esperaba que ${y!=null?y:"valor"} fuera ${h}${r.maximum.toString()}`}case"too_small":{let h=r.inclusive?">=":">",v=e(r.origin),y=(l=o[r.origin])!=null?l:r.origin;return v?`Demasiado peque\xF1o: se esperaba que ${y} tuviera ${h}${r.minimum.toString()} ${v.unit}`:`Demasiado peque\xF1o: se esperaba que ${y} fuera ${h}${r.minimum.toString()}`}case"invalid_format":{let h=r;return h.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${h.prefix}"`:h.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${h.suffix}"`:h.format==="includes"?`Cadena inv\xE1lida: debe incluir "${h.includes}"`:h.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${h.pattern}`:`Inv\xE1lido ${(p=n[h.format])!=null?p:r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${A(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${(d=o[r.origin])!=null?d:r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${(g=o[r.origin])!=null?g:r.origin}`;default:return"Entrada inv\xE1lida"}}},"error");function Fx(){return{localeError:r9()}}a(Fx,"default");var o9=a(()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${h} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${d} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${h} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${$(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${A(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${(u=r.origin)!=null?u:"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${(l=r.origin)!=null?l:"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${d}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${d}${r.minimum.toString()} ${g.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${d}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let d=r;return d.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${d.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:d.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${d.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:d.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${d.includes}" \u0628\u0627\u0634\u062F`:d.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${d.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${(p=n[d.format])!=null?p:r.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${A(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"error");function zx(){return{localeError:o9()}}a(zx,"default");var i9=a(()=>{let t={string:{unit:"merkki\xE4",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\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",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\xE4iv\xE4m\xE4\xE4r\xE4",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"},o={nan:"NaN"};return r=>{var i,s,u;switch(r.code){case"invalid_type":{let c=(i=o[r.expected])!=null?i:r.expected,l=D(r.input),p=(s=o[l])!=null?s:l;return/^[A-Z]/.test(r.expected)?`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${p}`:`Virheellinen tyyppi: odotettiin ${c}, oli ${p}`}case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${$(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${A(r.values,"|")}`;case"too_big":{let c=r.inclusive?"<=":"<",l=e(r.origin);return l?`Liian suuri: ${l.subject} t\xE4ytyy olla ${c}${r.maximum.toString()} ${l.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${c}${r.maximum.toString()}`}case"too_small":{let c=r.inclusive?">=":">",l=e(r.origin);return l?`Liian pieni: ${l.subject} t\xE4ytyy olla ${c}${r.minimum.toString()} ${l.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${c}${r.minimum.toString()}`}case"invalid_format":{let c=r;return c.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${c.prefix}"`:c.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${c.suffix}"`:c.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${c.includes}"`:c.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${c.pattern}`:`Virheellinen ${(u=n[c.format])!=null?u:r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${A(r.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\xF6te"}}},"error");function Gx(){return{localeError:i9()}}a(Gx,"default");var s9=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"entr\xE9e",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\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return r=>{var i,s,u,c,l,p,d,g;switch(r.code){case"invalid_type":{let h=(i=o[r.expected])!=null?i:r.expected,v=D(r.input),y=(s=o[v])!=null?s:v;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : instanceof ${r.expected} attendu, ${y} re\xE7u`:`Entr\xE9e invalide : ${h} attendu, ${y} re\xE7u`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${$(r.values[0])} attendu`:`Option invalide : une valeur parmi ${A(r.values,"|")} attendue`;case"too_big":{let h=r.inclusive?"<=":"<",v=e(r.origin);return v?`Trop grand : ${(u=o[r.origin])!=null?u:"valeur"} doit ${v.verb} ${h}${r.maximum.toString()} ${(c=v.unit)!=null?c:"\xE9l\xE9ment(s)"}`:`Trop grand : ${(l=o[r.origin])!=null?l:"valeur"} doit \xEAtre ${h}${r.maximum.toString()}`}case"too_small":{let h=r.inclusive?">=":">",v=e(r.origin);return v?`Trop petit : ${(p=o[r.origin])!=null?p:"valeur"} doit ${v.verb} ${h}${r.minimum.toString()} ${v.unit}`:`Trop petit : ${(d=o[r.origin])!=null?d:"valeur"} doit \xEAtre ${h}${r.minimum.toString()}`}case"invalid_format":{let h=r;return h.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${h.prefix}"`:h.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${h.suffix}"`:h.format==="includes"?`Cha\xEEne invalide : doit inclure "${h.includes}"`:h.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${h.pattern}`:`${(g=n[h.format])!=null?g:r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${A(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}},"error");function Bx(){return{localeError:s9()}}a(Bx,"default");var a9=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"entr\xE9e",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\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return r=>{var i,s,u,c,l;switch(r.code){case"invalid_type":{let p=(i=o[r.expected])!=null?i:r.expected,d=D(r.input),g=(s=o[d])!=null?s:d;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : attendu instanceof ${r.expected}, re\xE7u ${g}`:`Entr\xE9e invalide : attendu ${p}, re\xE7u ${g}`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${$(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${A(r.values,"|")}`;case"too_big":{let p=r.inclusive?"\u2264":"<",d=e(r.origin);return d?`Trop grand : attendu que ${(u=r.origin)!=null?u:"la valeur"} ait ${p}${r.maximum.toString()} ${d.unit}`:`Trop grand : attendu que ${(c=r.origin)!=null?c:"la valeur"} soit ${p}${r.maximum.toString()}`}case"too_small":{let p=r.inclusive?"\u2265":">",d=e(r.origin);return d?`Trop petit : attendu que ${r.origin} ait ${p}${r.minimum.toString()} ${d.unit}`:`Trop petit : attendu que ${r.origin} soit ${p}${r.minimum.toString()}`}case"invalid_format":{let p=r;return p.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${p.prefix}"`:p.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${p.suffix}"`:p.format==="includes"?`Cha\xEEne invalide : doit inclure "${p.includes}"`:p.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${p.pattern}`:`${(l=n[p.format])!=null?l:r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${A(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}},"error");function qx(){return{localeError:a9()}}a(qx,"default");var u9=a(()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},n=a(l=>l?t[l]:void 0,"typeEntry"),o=a(l=>{let p=n(l);return p?p.label:l!=null?l:t.unknown.label},"typeLabel"),r=a(l=>`\u05D4${o(l)}`,"withDefinite"),i=a(l=>{var g;let p=n(l);return((g=p==null?void 0:p.gender)!=null?g:"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA"},"verbFor"),s=a(l=>{var p;return l&&(p=e[l])!=null?p:null},"getSizing"),u={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",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:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{var p,d,g,h,v,y,_,x,E,T,S,I,w,b,B,k,V,ce,Ee,Ne,P;switch(l.code){case"invalid_type":{let O=l.expected,X=(p=c[O!=null?O:""])!=null?p:o(O),Ae=D(l.input),we=(h=(g=c[Ae])!=null?g:(d=t[Ae])==null?void 0:d.label)!=null?h:Ae;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${we}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${X}, \u05D4\u05EA\u05E7\u05D1\u05DC ${we}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${$(l.values[0])}`;let O=l.values.map(we=>$(we));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${O[0]} \u05D0\u05D5 ${O[1]}`;let X=O[O.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${O.slice(0,-1).join(", ")} \u05D0\u05D5 ${X}`}case"too_big":{let O=s(l.origin),X=r((v=l.origin)!=null?v:"value");if(l.origin==="string")return`${(y=O==null?void 0:O.longLabel)!=null?y:"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${X} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${(_=O==null?void 0:O.unit)!=null?_:""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let de=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${X} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${de}`}if(l.origin==="array"||l.origin==="set"){let de=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",Mt=l.inclusive?`${l.maximum} ${(x=O==null?void 0:O.unit)!=null?x:""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${(E=O==null?void 0:O.unit)!=null?E:""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${X} ${de} \u05DC\u05D4\u05DB\u05D9\u05DC ${Mt}`.trim()}let Ae=l.inclusive?"<=":"<",we=i((T=l.origin)!=null?T:"value");return O!=null&&O.unit?`${O.longLabel} \u05DE\u05D3\u05D9: ${X} ${we} ${Ae}${l.maximum.toString()} ${O.unit}`:`${(S=O==null?void 0:O.longLabel)!=null?S:"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${X} ${we} ${Ae}${l.maximum.toString()}`}case"too_small":{let O=s(l.origin),X=r((I=l.origin)!=null?I:"value");if(l.origin==="string")return`${(w=O==null?void 0:O.shortLabel)!=null?w:"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${X} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${(b=O==null?void 0:O.unit)!=null?b:""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let de=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${X} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${de}`}if(l.origin==="array"||l.origin==="set"){let de=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let Rp=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${X} ${de} \u05DC\u05D4\u05DB\u05D9\u05DC ${Rp}`}let Mt=l.inclusive?`${l.minimum} ${(B=O==null?void 0:O.unit)!=null?B:""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${(k=O==null?void 0:O.unit)!=null?k:""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${X} ${de} \u05DC\u05D4\u05DB\u05D9\u05DC ${Mt}`.trim()}let Ae=l.inclusive?">=":">",we=i((V=l.origin)!=null?V:"value");return O!=null&&O.unit?`${O.shortLabel} \u05DE\u05D3\u05D9: ${X} ${we} ${Ae}${l.minimum.toString()} ${O.unit}`:`${(ce=O==null?void 0:O.shortLabel)!=null?ce:"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${X} ${we} ${Ae}${l.minimum.toString()}`}case"invalid_format":{let O=l;if(O.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${O.prefix}"`;if(O.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${O.suffix}"`;if(O.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${O.includes}"`;if(O.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${O.pattern}`;let X=u[O.format],Ae=(Ee=X==null?void 0:X.label)!=null?Ee:O.format,de=((Ne=X==null?void 0:X.gender)!=null?Ne:"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${Ae} \u05DC\u05D0 ${de}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${A(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r((P=l.origin)!=null?P:"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function Vx(){return{localeError:u9()}}a(Vx,"default");var l9=a(()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"unos",email:"email 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:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return r=>{var i,s,u,c,l,p,d,g;switch(r.code){case"invalid_type":{let h=(i=o[r.expected])!=null?i:r.expected,v=D(r.input),y=(s=o[v])!=null?s:v;return/^[A-Z]/.test(r.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${r.expected}, a primljeno je ${y}`:`Neispravan unos: o\u010Dekuje se ${h}, a primljeno je ${y}`}case"invalid_value":return r.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${$(r.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${A(r.values,"|")}`;case"too_big":{let h=r.inclusive?"<=":"<",v=e(r.origin),y=(u=o[r.origin])!=null?u:r.origin;return v?`Preveliko: o\u010Dekivano da ${y!=null?y:"vrijednost"} ima ${h}${r.maximum.toString()} ${(c=v.unit)!=null?c:"elemenata"}`:`Preveliko: o\u010Dekivano da ${y!=null?y:"vrijednost"} bude ${h}${r.maximum.toString()}`}case"too_small":{let h=r.inclusive?">=":">",v=e(r.origin),y=(l=o[r.origin])!=null?l:r.origin;return v?`Premalo: o\u010Dekivano da ${y} ima ${h}${r.minimum.toString()} ${v.unit}`:`Premalo: o\u010Dekivano da ${y} bude ${h}${r.minimum.toString()}`}case"invalid_format":{let h=r;return h.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${h.prefix}"`:h.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${h.suffix}"`:h.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${h.includes}"`:h.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${h.pattern}`:`Neispravna ${(p=n[h.format])!=null?p:r.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${r.divisor}`;case"unrecognized_keys":return`Neprepoznat${r.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${A(r.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${(d=o[r.origin])!=null?d:r.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${(g=o[r.origin])!=null?g:r.origin}`;default:return"Neispravan unos"}}},"error");function Zx(){return{localeError:l9()}}a(Zx,"default");var c9=a(()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"bemenet",email:"email c\xEDm",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\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${r.expected}, a kapott \xE9rt\xE9k ${h}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${d}, a kapott \xE9rt\xE9k ${h}`}case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${$(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`T\xFAl nagy: ${(u=r.origin)!=null?u:"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${(l=r.origin)!=null?l:"\xE9rt\xE9k"} t\xFAl nagy: ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${d}${r.minimum.toString()} ${g.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`\xC9rv\xE9nytelen string: "${d.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:d.format==="ends_with"?`\xC9rv\xE9nytelen string: "${d.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:d.format==="includes"?`\xC9rv\xE9nytelen string: "${d.includes}" \xE9rt\xE9ket kell tartalmaznia`:d.format==="regex"?`\xC9rv\xE9nytelen string: ${d.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${A(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"error");function Hx(){return{localeError:c9()}}a(Hx,"default");function OD(t,e,n){return Math.abs(t)===1?e:n}a(OD,"getArmenianPlural");function Ui(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=t[t.length-1];return t+(e.includes(n)?"\u0576":"\u0568")}a(Ui,"withDefiniteArticle");var d9=a(()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return r=>{var i,s,u,c,l;switch(r.code){case"invalid_type":{let p=(i=o[r.expected])!=null?i:r.expected,d=D(r.input),g=(s=o[d])!=null?s:d;return/^[A-Z]/.test(r.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${r.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${g}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${p}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${g}`}case"invalid_value":return r.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${$(r.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${A(r.values,"|")}`;case"too_big":{let p=r.inclusive?"<=":"<",d=e(r.origin);if(d){let g=Number(r.maximum),h=OD(g,d.unit.one,d.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ui((u=r.origin)!=null?u:"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${p}${r.maximum.toString()} ${h}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ui((c=r.origin)!=null?c:"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${p}${r.maximum.toString()}`}case"too_small":{let p=r.inclusive?">=":">",d=e(r.origin);if(d){let g=Number(r.minimum),h=OD(g,d.unit.one,d.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ui(r.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${p}${r.minimum.toString()} ${h}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ui(r.origin)} \u056C\u056B\u0576\u056B ${p}${r.minimum.toString()}`}case"invalid_format":{let p=r;return p.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${p.prefix}"-\u0578\u057E`:p.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${p.suffix}"-\u0578\u057E`:p.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${p.includes}"`:p.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${p.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${(l=n[p.format])!=null?l:r.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${r.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${r.keys.length>1?"\u0576\u0565\u0580":""}. ${A(r.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Ui(r.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Ui(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}},"error");function Jx(){return{localeError:d9()}}a(Jx,"default");var f9=a(()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");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"},o={nan:"NaN"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${h}`:`Input tidak valid: diharapkan ${d}, diterima ${h}`}case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${$(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`Terlalu besar: diharapkan ${(u=r.origin)!=null?u:"value"} memiliki ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"elemen"}`:`Terlalu besar: diharapkan ${(l=r.origin)!=null?l:"value"} menjadi ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`Terlalu kecil: diharapkan ${r.origin} memiliki ${d}${r.minimum.toString()} ${g.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`String tidak valid: harus dimulai dengan "${d.prefix}"`:d.format==="ends_with"?`String tidak valid: harus berakhir dengan "${d.suffix}"`:d.format==="includes"?`String tidak valid: harus menyertakan "${d.includes}"`:d.format==="regex"?`String tidak valid: harus sesuai pola ${d.pattern}`:`${(p=n[d.format])!=null?p:r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${A(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}},"error");function Kx(){return{localeError:f9()}}a(Kx,"default");var p9=a(()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",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\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",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\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${h} \xFEar sem \xE1 a\xF0 vera instanceof ${r.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${h} \xFEar sem \xE1 a\xF0 vera ${d}`}case"invalid_value":return r.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${$(r.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${(u=r.origin)!=null?u:"gildi"} hafi ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${(l=r.origin)!=null?l:"gildi"} s\xE9 ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} hafi ${d}${r.minimum.toString()} ${g.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} s\xE9 ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${d.prefix}"`:d.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${d.suffix}"`:d.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${d.includes}"`:d.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${d.pattern}`:`Rangt ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${A(r.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${r.origin}`;default:return"Rangt gildi"}}},"error");function Wx(){return{localeError:p9()}}a(Wx,"default");var m9=a(()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");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"},o={nan:"NaN",number:"numero",array:"vettore"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`Input non valido: atteso instanceof ${r.expected}, ricevuto ${h}`:`Input non valido: atteso ${d}, ricevuto ${h}`}case"invalid_value":return r.values.length===1?`Input non valido: atteso ${$(r.values[0])}`:`Opzione non valida: atteso uno tra ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`Troppo grande: ${(u=r.origin)!=null?u:"valore"} deve avere ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"elementi"}`:`Troppo grande: ${(l=r.origin)!=null?l:"valore"} deve essere ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`Troppo piccolo: ${r.origin} deve avere ${d}${r.minimum.toString()} ${g.unit}`:`Troppo piccolo: ${r.origin} deve essere ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`Stringa non valida: deve iniziare con "${d.prefix}"`:d.format==="ends_with"?`Stringa non valida: deve terminare con "${d.suffix}"`:d.format==="includes"?`Stringa non valida: deve includere "${d.includes}"`:d.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${d.pattern}`:`Input non valido: ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${A(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}},"error");function jx(){return{localeError:m9()}}a(jx,"default");var g9=a(()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${h}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${d}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${h}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${$(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${A(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let d=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",g=e(r.origin);return g?`\u5927\u304D\u3059\u304E\u308B\u5024: ${(u=r.origin)!=null?u:"\u5024"}\u306F${r.maximum.toString()}${(c=g.unit)!=null?c:"\u8981\u7D20"}${d}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${(l=r.origin)!=null?l:"\u5024"}\u306F${r.maximum.toString()}${d}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let d=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",g=e(r.origin);return g?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${g.unit}${d}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${d}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let d=r;return d.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${d.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:d.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${d.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:d.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${d.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:d.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${d.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${r.keys.length>1?"\u7FA4":""}: ${A(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"error");function Yx(){return{localeError:g9()}}a(Yx,"default");var h9=a(()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return r=>{var i,s,u,c,l;switch(r.code){case"invalid_type":{let p=(i=o[r.expected])!=null?i:r.expected,d=D(r.input),g=(s=o[d])!=null?s:d;return/^[A-Z]/.test(r.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${r.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${g}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${p}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${g}`}case"invalid_value":return r.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${$(r.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${A(r.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let p=r.inclusive?"<=":"<",d=e(r.origin);return d?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${(u=r.origin)!=null?u:"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${d.verb} ${p}${r.maximum.toString()} ${d.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${(c=r.origin)!=null?c:"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${p}${r.maximum.toString()}`}case"too_small":{let p=r.inclusive?">=":">",d=e(r.origin);return d?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} ${d.verb} ${p}${r.minimum.toString()} ${d.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} \u10D8\u10E7\u10DD\u10E1 ${p}${r.minimum.toString()}`}case"invalid_format":{let p=r;return p.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${p.prefix}"-\u10D8\u10D7`:p.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${p.suffix}"-\u10D8\u10D7`:p.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${p.includes}"-\u10E1`:p.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${p.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${(l=n[p.format])!=null?l:r.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${r.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${r.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${A(r.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${r.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${r.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}},"error");function Xx(){return{localeError:h9()}}a(Xx,"default");var v9=a(()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${h}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${d} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${h}`}case"invalid_value":return r.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${$(r.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${(u=r.origin)!=null?u:"\u178F\u1798\u17D2\u179B\u17C3"} ${d} ${r.maximum.toString()} ${(c=g.unit)!=null?c:"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${(l=r.origin)!=null?l:"\u178F\u1798\u17D2\u179B\u17C3"} ${d} ${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${d} ${r.minimum.toString()} ${g.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${d} ${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${d.prefix}"`:d.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${d.suffix}"`:d.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${d.includes}"`:d.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${d.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${A(r.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"error");function za(){return{localeError:v9()}}a(za,"default");function Qx(){return za()}a(Qx,"default");var y9=a(()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return r=>{var i,s,u,c,l,p,d,g,h;switch(r.code){case"invalid_type":{let v=(i=o[r.expected])!=null?i:r.expected,y=D(r.input),_=(s=o[y])!=null?s:y;return/^[A-Z]/.test(r.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${_}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${v}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${_}\uC785\uB2C8\uB2E4`}case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${$(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${A(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let v=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",y=v==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",_=e(r.origin),x=(u=_==null?void 0:_.unit)!=null?u:"\uC694\uC18C";return _?`${(c=r.origin)!=null?c:"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${x} ${v}${y}`:`${(l=r.origin)!=null?l:"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${v}${y}`}case"too_small":{let v=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",y=v==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",_=e(r.origin),x=(p=_==null?void 0:_.unit)!=null?p:"\uC694\uC18C";return _?`${(d=r.origin)!=null?d:"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${x} ${v}${y}`:`${(g=r.origin)!=null?g:"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${v}${y}`}case"invalid_format":{let v=r;return v.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${v.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:v.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${v.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:v.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${v.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:v.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${v.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${(h=n[v.format])!=null?h:r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${A(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"error");function eE(){return{localeError:y9()}}a(eE,"default");var Ga=a(t=>t.charAt(0).toUpperCase()+t.slice(1),"capitalizeFirstCharacter");function LD(t){let e=Math.abs(t),n=e%10,o=e%100;return o>=11&&o<=19||n===0?"many":n===1?"one":"few"}a(LD,"getUnitTypeFromNumber");var _9=a(()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(r,i,s,u){var l;let c=(l=t[r])!=null?l:null;return c===null?c:{unit:c.unit[i],verb:c.verb[u][s?"inclusive":"notInclusive"]}}a(e,"getSizing");let n={regex:"\u012Fvestis",email:"el. pa\u0161to 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\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return r=>{var i,s,u,c,l,p,d,g,h,v,y,_,x,E,T;switch(r.code){case"invalid_type":{let S=(i=o[r.expected])!=null?i:r.expected,I=D(r.input),w=(s=o[I])!=null?s:I;return/^[A-Z]/.test(r.expected)?`Gautas tipas ${w}, o tik\u0117tasi - instanceof ${r.expected}`:`Gautas tipas ${w}, o tik\u0117tasi - ${S}`}case"invalid_value":return r.values.length===1?`Privalo b\u016Bti ${$(r.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${A(r.values,"|")} pasirinkim\u0173`;case"too_big":{let S=(u=o[r.origin])!=null?u:r.origin,I=e(r.origin,LD(Number(r.maximum)),(c=r.inclusive)!=null?c:!1,"smaller");if(I!=null&&I.verb)return`${Ga((l=S!=null?S:r.origin)!=null?l:"reik\u0161m\u0117")} ${I.verb} ${r.maximum.toString()} ${(p=I.unit)!=null?p:"element\u0173"}`;let w=r.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Ga((d=S!=null?S:r.origin)!=null?d:"reik\u0161m\u0117")} turi b\u016Bti ${w} ${r.maximum.toString()} ${I==null?void 0:I.unit}`}case"too_small":{let S=(g=o[r.origin])!=null?g:r.origin,I=e(r.origin,LD(Number(r.minimum)),(h=r.inclusive)!=null?h:!1,"bigger");if(I!=null&&I.verb)return`${Ga((v=S!=null?S:r.origin)!=null?v:"reik\u0161m\u0117")} ${I.verb} ${r.minimum.toString()} ${(y=I.unit)!=null?y:"element\u0173"}`;let w=r.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Ga((_=S!=null?S:r.origin)!=null?_:"reik\u0161m\u0117")} turi b\u016Bti ${w} ${r.minimum.toString()} ${I==null?void 0:I.unit}`}case"invalid_format":{let S=r;return S.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${S.prefix}"`:S.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${S.suffix}"`:S.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${S.includes}"`:S.format==="regex"?`Eilut\u0117 privalo atitikti ${S.pattern}`:`Neteisingas ${(x=n[S.format])!=null?x:r.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${A(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let S=(E=o[r.origin])!=null?E:r.origin;return`${Ga((T=S!=null?S:r.origin)!=null?T:"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}},"error");function tE(){return{localeError:_9()}}a(tE,"default");var x9=a(()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${h}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${d}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${h}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${$(r.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${(u=r.origin)!=null?u:"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${(l=r.origin)!=null?l:"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${d}${r.minimum.toString()} ${g.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${d.prefix}"`:d.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${d.suffix}"`:d.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${d.includes}"`:d.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${d.pattern}`:`Invalid ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${A(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"error");function nE(){return{localeError:x9()}}a(nE,"default");var E9=a(()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");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"},o={nan:"NaN",number:"nombor"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${h}`:`Input tidak sah: dijangka ${d}, diterima ${h}`}case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${$(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`Terlalu besar: dijangka ${(u=r.origin)!=null?u:"nilai"} ${g.verb} ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"elemen"}`:`Terlalu besar: dijangka ${(l=r.origin)!=null?l:"nilai"} adalah ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`Terlalu kecil: dijangka ${r.origin} ${g.verb} ${d}${r.minimum.toString()} ${g.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`String tidak sah: mesti bermula dengan "${d.prefix}"`:d.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${d.suffix}"`:d.format==="includes"?`String tidak sah: mesti mengandungi "${d.includes}"`:d.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${d.pattern}`:`${(p=n[d.format])!=null?p:r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${A(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}},"error");function rE(){return{localeError:E9()}}a(rE,"default");var S9=a(()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");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"},o={nan:"NaN",number:"getal"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${h}`:`Ongeldige invoer: verwacht ${d}, ontving ${h}`}case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${$(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin),h=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";return g?`Te ${h}: verwacht dat ${(u=r.origin)!=null?u:"waarde"} ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"elementen"} ${g.verb}`:`Te ${h}: verwacht dat ${(l=r.origin)!=null?l:"waarde"} ${d}${r.maximum.toString()} is`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin),h=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";return g?`Te ${h}: verwacht dat ${r.origin} ${d}${r.minimum.toString()} ${g.unit} ${g.verb}`:`Te ${h}: verwacht dat ${r.origin} ${d}${r.minimum.toString()} is`}case"invalid_format":{let d=r;return d.format==="starts_with"?`Ongeldige tekst: moet met "${d.prefix}" beginnen`:d.format==="ends_with"?`Ongeldige tekst: moet op "${d.suffix}" eindigen`:d.format==="includes"?`Ongeldige tekst: moet "${d.includes}" bevatten`:d.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${d.pattern}`:`Ongeldig: ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${A(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}},"error");function oE(){return{localeError:S9()}}a(oE,"default");var T9=a(()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");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\xE5de",ipv6:"IPv6-omr\xE5de",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"},o={nan:"NaN",number:"tall",array:"liste"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventet instanceof ${r.expected}, fikk ${h}`:`Ugyldig input: forventet ${d}, fikk ${h}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${$(r.values[0])}`:`Ugyldig valg: forventet en av ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`For stor(t): forventet ${(u=r.origin)!=null?u:"value"} til \xE5 ha ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"elementer"}`:`For stor(t): forventet ${(l=r.origin)!=null?l:"value"} til \xE5 ha ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`For lite(n): forventet ${r.origin} til \xE5 ha ${d}${r.minimum.toString()} ${g.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${d.prefix}"`:d.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${d.suffix}"`:d.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${d.includes}"`:d.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${d.pattern}`:`Ugyldig ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${A(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}},"error");function iE(){return{localeError:T9()}}a(iE,"default");var C9=a(()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"giren",email:"epostag\xE2h",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\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`F\xE2sit giren: umulan instanceof ${r.expected}, al\u0131nan ${h}`:`F\xE2sit giren: umulan ${d}, al\u0131nan ${h}`}case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${$(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`Fazla b\xFCy\xFCk: ${(u=r.origin)!=null?u:"value"}, ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${(l=r.origin)!=null?l:"value"}, ${d}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${d}${r.minimum.toString()} ${g.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${d}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let d=r;return d.format==="starts_with"?`F\xE2sit metin: "${d.prefix}" ile ba\u015Flamal\u0131.`:d.format==="ends_with"?`F\xE2sit metin: "${d.suffix}" ile bitmeli.`:d.format==="includes"?`F\xE2sit metin: "${d.includes}" ihtiv\xE2 etmeli.`:d.format==="regex"?`F\xE2sit metin: ${d.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${A(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"error");function sE(){return{localeError:C9()}}a(sE,"default");var I9=a(()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${h} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${d} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${h} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${$(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${A(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${(u=r.origin)!=null?u:"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${(l=r.origin)!=null?l:"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${d}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${d}${r.minimum.toString()} ${g.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${d}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let d=r;return d.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${d.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:d.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${d.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:d.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${d.includes}" \u0648\u0644\u0631\u064A`:d.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${d.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${(p=n[d.format])!=null?p:r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${A(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"error");function aE(){return{localeError:I9()}}a(aE,"default");var A9=a(()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"wyra\u017Cenie",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\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return r=>{var i,s,u,c,l,p,d,g,h;switch(r.code){case"invalid_type":{let v=(i=o[r.expected])!=null?i:r.expected,y=D(r.input),_=(s=o[y])!=null?s:y;return/^[A-Z]/.test(r.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${_}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${v}, otrzymano ${_}`}case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${$(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${A(r.values,"|")}`;case"too_big":{let v=r.inclusive?"<=":"<",y=e(r.origin);return y?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${(u=r.origin)!=null?u:"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${v}${r.maximum.toString()} ${(c=y.unit)!=null?c:"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${(l=r.origin)!=null?l:"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${v}${r.maximum.toString()}`}case"too_small":{let v=r.inclusive?">=":">",y=e(r.origin);return y?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${(p=r.origin)!=null?p:"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${v}${r.minimum.toString()} ${(d=y.unit)!=null?d:"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${(g=r.origin)!=null?g:"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${v}${r.minimum.toString()}`}case"invalid_format":{let v=r;return v.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${v.prefix}"`:v.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${v.suffix}"`:v.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${v.includes}"`:v.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${v.pattern}`:`Nieprawid\u0142ow(y/a/e) ${(h=n[v.format])!=null?h:r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${A(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"error");function uE(){return{localeError:A9()}}a(uE,"default");var w9=a(()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"padr\xE3o",email:"endere\xE7o 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\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o 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\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`Tipo inv\xE1lido: esperado instanceof ${r.expected}, recebido ${h}`:`Tipo inv\xE1lido: esperado ${d}, recebido ${h}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: esperado ${$(r.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`Muito grande: esperado que ${(u=r.origin)!=null?u:"valor"} tivesse ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"elementos"}`:`Muito grande: esperado que ${(l=r.origin)!=null?l:"valor"} fosse ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`Muito pequeno: esperado que ${r.origin} tivesse ${d}${r.minimum.toString()} ${g.unit}`:`Muito pequeno: esperado que ${r.origin} fosse ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${d.prefix}"`:d.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${d.suffix}"`:d.format==="includes"?`Texto inv\xE1lido: deve incluir "${d.includes}"`:d.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${d.pattern}`:`${(p=n[d.format])!=null?p:r.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${A(r.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${r.origin}`;default:return"Campo inv\xE1lido"}}},"error");function lE(){return{localeError:w9()}}a(lE,"default");var b9=a(()=>{let t={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"intrare",email:"adres\u0103 de 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:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return`Intrare invalid\u0103: a\u0219teptat ${d}, primit ${h}`}case"invalid_value":return r.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${$(r.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`Prea mare: a\u0219teptat ca ${(u=r.origin)!=null?u:"valoarea"} ${g.verb} ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"elemente"}`:`Prea mare: a\u0219teptat ca ${(l=r.origin)!=null?l:"valoarea"} s\u0103 fie ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`Prea mic: a\u0219teptat ca ${r.origin} ${g.verb} ${d}${r.minimum.toString()} ${g.unit}`:`Prea mic: a\u0219teptat ca ${r.origin} s\u0103 fie ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${d.prefix}"`:d.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${d.suffix}"`:d.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${d.includes}"`:d.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${d.pattern}`:`Format invalid: ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${r.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${A(r.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${r.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${r.origin}`;default:return"Intrare invalid\u0103"}}},"error");function cE(){return{localeError:b9()}}a(cE,"default");function MD(t,e,n,o){let r=Math.abs(t),i=r%10,s=r%100;return s>=11&&s<=19?o:i===1?e:i>=2&&i<=4?n:o}a(MD,"getRussianPlural");var R9=a(()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return r=>{var i,s,u,c,l;switch(r.code){case"invalid_type":{let p=(i=o[r.expected])!=null?i:r.expected,d=D(r.input),g=(s=o[d])!=null?s:d;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${g}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${p}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${g}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${$(r.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${A(r.values,"|")}`;case"too_big":{let p=r.inclusive?"<=":"<",d=e(r.origin);if(d){let g=Number(r.maximum),h=MD(g,d.unit.one,d.unit.few,d.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${(u=r.origin)!=null?u:"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${p}${r.maximum.toString()} ${h}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${(c=r.origin)!=null?c:"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${p}${r.maximum.toString()}`}case"too_small":{let p=r.inclusive?">=":">",d=e(r.origin);if(d){let g=Number(r.minimum),h=MD(g,d.unit.one,d.unit.few,d.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${p}${r.minimum.toString()} ${h}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${p}${r.minimum.toString()}`}case"invalid_format":{let p=r;return p.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${p.prefix}"`:p.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${p.suffix}"`:p.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${p.includes}"`:p.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${p.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${(l=n[p.format])!=null?l:r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${A(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"error");function dE(){return{localeError:R9()}}a(dE,"default");var k9=a(()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"vnos",email:"e-po\u0161tni 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 \u010Das",date:"ISO datum",time:"ISO \u010Das",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 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${r.expected}, prejeto ${h}`:`Neveljaven vnos: pri\u010Dakovano ${d}, prejeto ${h}`}case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${$(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`Preveliko: pri\u010Dakovano, da bo ${(u=r.origin)!=null?u:"vrednost"} imelo ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${(l=r.origin)!=null?l:"vrednost"} ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${d}${r.minimum.toString()} ${g.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${d.prefix}"`:d.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${d.suffix}"`:d.format==="includes"?`Neveljaven niz: mora vsebovati "${d.includes}"`:d.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${d.pattern}`:`Neveljaven ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${A(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}},"error");function fE(){return{localeError:k9()}}a(fE,"default");var P9=a(()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"regulj\xE4rt 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\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return r=>{var i,s,u,c,l,p,d,g,h,v;switch(r.code){case"invalid_type":{let y=(i=o[r.expected])!=null?i:r.expected,_=D(r.input),x=(s=o[_])!=null?s:_;return/^[A-Z]/.test(r.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${r.expected}, fick ${x}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${y}, fick ${x}`}case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${$(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${A(r.values,"|")}`;case"too_big":{let y=r.inclusive?"<=":"<",_=e(r.origin);return _?`F\xF6r stor(t): f\xF6rv\xE4ntade ${(u=r.origin)!=null?u:"v\xE4rdet"} att ha ${y}${r.maximum.toString()} ${(c=_.unit)!=null?c:"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${(l=r.origin)!=null?l:"v\xE4rdet"} att ha ${y}${r.maximum.toString()}`}case"too_small":{let y=r.inclusive?">=":">",_=e(r.origin);return _?`F\xF6r lite(t): f\xF6rv\xE4ntade ${(p=r.origin)!=null?p:"v\xE4rdet"} att ha ${y}${r.minimum.toString()} ${_.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${(d=r.origin)!=null?d:"v\xE4rdet"} att ha ${y}${r.minimum.toString()}`}case"invalid_format":{let y=r;return y.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${y.prefix}"`:y.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${y.suffix}"`:y.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${y.includes}"`:y.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${y.pattern}"`:`Ogiltig(t) ${(g=n[y.format])!=null?g:r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${A(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${(h=r.origin)!=null?h:"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${(v=r.origin)!=null?v:"v\xE4rdet"}`;default:return"Ogiltig input"}}},"error");function pE(){return{localeError:P9()}}a(pE,"default");var N9=a(()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",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 \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${h}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${d}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${h}`}case"invalid_value":return r.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${$(r.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${A(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${(u=r.origin)!=null?u:"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${(l=r.origin)!=null?l:"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${d}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${d}${r.minimum.toString()} ${g.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${d}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let d=r;return d.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${d.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:d.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${d.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:d.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${d.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:d.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${d.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${A(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"error");function mE(){return{localeError:N9()}}a(mE,"default");var $9=a(()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${h}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${d} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${h}`}case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${$(r.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",g=e(r.origin);return g?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${(u=r.origin)!=null?u:"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${d} ${r.maximum.toString()} ${(c=g.unit)!=null?c:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${(l=r.origin)!=null?l:"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${d} ${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",g=e(r.origin);return g?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${d} ${r.minimum.toString()} ${g.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${d} ${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${d.prefix}"`:d.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${d.suffix}"`:d.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${d.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:d.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${d.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${r.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${A(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"error");function gE(){return{localeError:$9()}}a(gE,"default");var D9=a(()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");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\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${r.expected}, al\u0131nan ${h}`:`Ge\xE7ersiz de\u011Fer: beklenen ${d}, al\u0131nan ${h}`}case"invalid_value":return r.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${$(r.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`\xC7ok b\xFCy\xFCk: beklenen ${(u=r.origin)!=null?u:"de\u011Fer"} ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${(l=r.origin)!=null?l:"de\u011Fer"} ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${d}${r.minimum.toString()} ${g.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`Ge\xE7ersiz metin: "${d.prefix}" ile ba\u015Flamal\u0131`:d.format==="ends_with"?`Ge\xE7ersiz metin: "${d.suffix}" ile bitmeli`:d.format==="includes"?`Ge\xE7ersiz metin: "${d.includes}" i\xE7ermeli`:d.format==="regex"?`Ge\xE7ersiz metin: ${d.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${r.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${r.keys.length>1?"lar":""}: ${A(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${r.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"error");function hE(){return{localeError:D9()}}a(hE,"default");var O9=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${h}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${d}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${h}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${$(r.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${(u=r.origin)!=null?u:"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${g.verb} ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${(l=r.origin)!=null?l:"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${g.verb} ${d}${r.minimum.toString()} ${g.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${d.prefix}"`:d.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${d.suffix}"`:d.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${d.includes}"`:d.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${d.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${A(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"error");function Ba(){return{localeError:O9()}}a(Ba,"default");function vE(){return Ba()}a(vE,"default");var L9=a(()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${h} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${d} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${h} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${$(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${A(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${(u=r.origin)!=null?u:"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${(l=r.origin)!=null?l:"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${d}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${d}${r.minimum.toString()} ${g.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${d}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let d=r;return d.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${d.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:d.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${d.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:d.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${d.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:d.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${d.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${r.keys.length>1?"\u0632":""}: ${A(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"error");function yE(){return{localeError:L9()}}a(yE,"default");var M9=a(()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");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"},o={nan:"NaN",number:"raqam",array:"massiv"};return r=>{var i,s,u,c,l;switch(r.code){case"invalid_type":{let p=(i=o[r.expected])!=null?i:r.expected,d=D(r.input),g=(s=o[d])!=null?s:d;return/^[A-Z]/.test(r.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${g}`:`Noto\u2018g\u2018ri kirish: kutilgan ${p}, qabul qilingan ${g}`}case"invalid_value":return r.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${$(r.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${A(r.values,"|")}`;case"too_big":{let p=r.inclusive?"<=":"<",d=e(r.origin);return d?`Juda katta: kutilgan ${(u=r.origin)!=null?u:"qiymat"} ${p}${r.maximum.toString()} ${d.unit} ${d.verb}`:`Juda katta: kutilgan ${(c=r.origin)!=null?c:"qiymat"} ${p}${r.maximum.toString()}`}case"too_small":{let p=r.inclusive?">=":">",d=e(r.origin);return d?`Juda kichik: kutilgan ${r.origin} ${p}${r.minimum.toString()} ${d.unit} ${d.verb}`:`Juda kichik: kutilgan ${r.origin} ${p}${r.minimum.toString()}`}case"invalid_format":{let p=r;return p.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${p.prefix}" bilan boshlanishi kerak`:p.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${p.suffix}" bilan tugashi kerak`:p.format==="includes"?`Noto\u2018g\u2018ri satr: "${p.includes}" ni o\u2018z ichiga olishi kerak`:p.format==="regex"?`Noto\u2018g\u2018ri satr: ${p.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${(l=n[p.format])!=null?l:r.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${r.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${r.keys.length>1?"lar":""}: ${A(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${r.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}},"error");function _E(){return{localeError:M9()}}a(_E,"default");var U9=a(()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 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\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${h}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${d}, nh\u1EADn \u0111\u01B0\u1EE3c ${h}`}case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${$(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${(u=r.origin)!=null?u:"gi\xE1 tr\u1ECB"} ${g.verb} ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${(l=r.origin)!=null?l:"gi\xE1 tr\u1ECB"} ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${g.verb} ${d}${r.minimum.toString()} ${g.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${d.prefix}"`:d.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${d.suffix}"`:d.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${d.includes}"`:d.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${d.pattern}`:`${(p=n[d.format])!=null?p:r.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${A(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"error");function xE(){return{localeError:U9()}}a(xE,"default");var F9=a(()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${h}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${d}\uFF0C\u5B9E\u9645\u63A5\u6536 ${h}`}case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${$(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${(u=r.origin)!=null?u:"\u503C"} ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${(l=r.origin)!=null?l:"\u503C"} ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${d}${r.minimum.toString()} ${g.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${d.prefix}" \u5F00\u5934`:d.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${d.suffix}" \u7ED3\u5C3E`:d.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${d.includes}"`:d.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${d.pattern}`:`\u65E0\u6548${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${A(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"error");function EE(){return{localeError:F9()}}a(EE,"default");var z9=a(()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",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 \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return r=>{var i,s,u,c,l,p;switch(r.code){case"invalid_type":{let d=(i=o[r.expected])!=null?i:r.expected,g=D(r.input),h=(s=o[g])!=null?s:g;return/^[A-Z]/.test(r.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${r.expected}\uFF0C\u4F46\u6536\u5230 ${h}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${d}\uFF0C\u4F46\u6536\u5230 ${h}`}case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${$(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${A(r.values,"|")}`;case"too_big":{let d=r.inclusive?"<=":"<",g=e(r.origin);return g?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${(u=r.origin)!=null?u:"\u503C"} \u61C9\u70BA ${d}${r.maximum.toString()} ${(c=g.unit)!=null?c:"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${(l=r.origin)!=null?l:"\u503C"} \u61C9\u70BA ${d}${r.maximum.toString()}`}case"too_small":{let d=r.inclusive?">=":">",g=e(r.origin);return g?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${d}${r.minimum.toString()} ${g.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${d}${r.minimum.toString()}`}case"invalid_format":{let d=r;return d.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${d.prefix}" \u958B\u982D`:d.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${d.suffix}" \u7D50\u5C3E`:d.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${d.includes}"`:d.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${d.pattern}`:`\u7121\u6548\u7684 ${(p=n[d.format])!=null?p:r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${A(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"error");function SE(){return{localeError:z9()}}a(SE,"default");var G9=a(()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(r){var i;return(i=t[r])!=null?i:null}a(e,"getSizing");let n={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",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:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return r=>{var i,s,u,c;switch(r.code){case"invalid_type":{let l=(i=o[r.expected])!=null?i:r.expected,p=D(r.input),d=(s=o[p])!=null?s:p;return/^[A-Z]/.test(r.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${d}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${l}, \xE0m\u1ECD\u0300 a r\xED ${d}`}case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${$(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${A(r.values,"|")}`;case"too_big":{let l=r.inclusive?"<=":"<",p=e(r.origin);return p?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${(u=r.origin)!=null?u:"iye"} ${p.verb} ${l}${r.maximum} ${p.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${l}${r.maximum}`}case"too_small":{let l=r.inclusive?">=":">",p=e(r.origin);return p?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${p.verb} ${l}${r.minimum} ${p.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${l}${r.minimum}`}case"invalid_format":{let l=r;return l.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${l.prefix}"`:l.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${l.suffix}"`:l.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${l.includes}"`:l.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${l.pattern}`:`A\u1E63\xEC\u1E63e: ${(c=n[l.format])!=null?c:r.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${A(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}},"error");function TE(){return{localeError:G9()}}a(TE,"default");var UD,CE=Symbol("ZodOutput"),IE=Symbol("ZodInput"),AE=class AE{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){let o=n[0];return this._map.set(e,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){var o;let n=e._zod.parent;if(n){let r={...(o=this.get(n))!=null?o:{}};delete r.id;let i={...r,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};a(AE,"$ZodRegistry");var jc=AE;function Yc(){return new jc}a(Yc,"registry");var FD;(FD=(UD=globalThis).__zod_globalRegistry)!=null||(UD.__zod_globalRegistry=Yc());var Ke=globalThis.__zod_globalRegistry;function wE(t,e){return new t({type:"string",...F(e)})}a(wE,"_string");function bE(t,e){return new t({type:"string",coerce:!0,...F(e)})}a(bE,"_coercedString");function Xc(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...F(e)})}a(Xc,"_email");function qa(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...F(e)})}a(qa,"_guid");function Qc(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...F(e)})}a(Qc,"_uuid");function ed(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...F(e)})}a(ed,"_uuidv4");function td(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...F(e)})}a(td,"_uuidv6");function nd(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...F(e)})}a(nd,"_uuidv7");function Va(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...F(e)})}a(Va,"_url");function rd(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...F(e)})}a(rd,"_emoji");function od(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...F(e)})}a(od,"_nanoid");function id(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...F(e)})}a(id,"_cuid");function sd(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...F(e)})}a(sd,"_cuid2");function ad(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...F(e)})}a(ad,"_ulid");function ud(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...F(e)})}a(ud,"_xid");function ld(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...F(e)})}a(ld,"_ksuid");function cd(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...F(e)})}a(cd,"_ipv4");function dd(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...F(e)})}a(dd,"_ipv6");function RE(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...F(e)})}a(RE,"_mac");function fd(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...F(e)})}a(fd,"_cidrv4");function pd(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...F(e)})}a(pd,"_cidrv6");function md(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...F(e)})}a(md,"_base64");function gd(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...F(e)})}a(gd,"_base64url");function hd(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...F(e)})}a(hd,"_e164");function vd(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...F(e)})}a(vd,"_jwt");var kE={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function PE(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...F(e)})}a(PE,"_isoDateTime");function NE(t,e){return new t({type:"string",format:"date",check:"string_format",...F(e)})}a(NE,"_isoDate");function $E(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...F(e)})}a($E,"_isoTime");function DE(t,e){return new t({type:"string",format:"duration",check:"string_format",...F(e)})}a(DE,"_isoDuration");function OE(t,e){return new t({type:"number",checks:[],...F(e)})}a(OE,"_number");function LE(t,e){return new t({type:"number",coerce:!0,checks:[],...F(e)})}a(LE,"_coercedNumber");function ME(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...F(e)})}a(ME,"_int");function UE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...F(e)})}a(UE,"_float32");function FE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...F(e)})}a(FE,"_float64");function zE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...F(e)})}a(zE,"_int32");function GE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...F(e)})}a(GE,"_uint32");function BE(t,e){return new t({type:"boolean",...F(e)})}a(BE,"_boolean");function qE(t,e){return new t({type:"boolean",coerce:!0,...F(e)})}a(qE,"_coercedBoolean");function VE(t,e){return new t({type:"bigint",...F(e)})}a(VE,"_bigint");function ZE(t,e){return new t({type:"bigint",coerce:!0,...F(e)})}a(ZE,"_coercedBigint");function HE(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...F(e)})}a(HE,"_int64");function JE(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...F(e)})}a(JE,"_uint64");function KE(t,e){return new t({type:"symbol",...F(e)})}a(KE,"_symbol");function WE(t,e){return new t({type:"undefined",...F(e)})}a(WE,"_undefined");function jE(t,e){return new t({type:"null",...F(e)})}a(jE,"_null");function YE(t){return new t({type:"any"})}a(YE,"_any");function XE(t){return new t({type:"unknown"})}a(XE,"_unknown");function QE(t,e){return new t({type:"never",...F(e)})}a(QE,"_never");function eS(t,e){return new t({type:"void",...F(e)})}a(eS,"_void");function tS(t,e){return new t({type:"date",...F(e)})}a(tS,"_date");function nS(t,e){return new t({type:"date",coerce:!0,...F(e)})}a(nS,"_coercedDate");function rS(t,e){return new t({type:"nan",...F(e)})}a(rS,"_nan");function vn(t,e){return new Fc({check:"less_than",...F(e),value:t,inclusive:!1})}a(vn,"_lt");function Nt(t,e){return new Fc({check:"less_than",...F(e),value:t,inclusive:!0})}a(Nt,"_lte");function yn(t,e){return new zc({check:"greater_than",...F(e),value:t,inclusive:!1})}a(yn,"_gt");function pt(t,e){return new zc({check:"greater_than",...F(e),value:t,inclusive:!0})}a(pt,"_gte");function yd(t){return yn(0,t)}a(yd,"_positive");function _d(t){return vn(0,t)}a(_d,"_negative");function xd(t){return Nt(0,t)}a(xd,"_nonpositive");function Ed(t){return pt(0,t)}a(Ed,"_nonnegative");function Sr(t,e){return new Qy({check:"multiple_of",...F(e),value:t})}a(Sr,"_multipleOf");function Tr(t,e){return new n_({check:"max_size",...F(e),maximum:t})}a(Tr,"_maxSize");function _n(t,e){return new r_({check:"min_size",...F(e),minimum:t})}a(_n,"_minSize");function Xr(t,e){return new o_({check:"size_equals",...F(e),size:t})}a(Xr,"_size");function Qr(t,e){return new i_({check:"max_length",...F(e),maximum:t})}a(Qr,"_maxLength");function Jn(t,e){return new s_({check:"min_length",...F(e),minimum:t})}a(Jn,"_minLength");function eo(t,e){return new a_({check:"length_equals",...F(e),length:t})}a(eo,"_length");function Fi(t,e){return new u_({check:"string_format",format:"regex",...F(e),pattern:t})}a(Fi,"_regex");function zi(t){return new l_({check:"string_format",format:"lowercase",...F(t)})}a(zi,"_lowercase");function Gi(t){return new c_({check:"string_format",format:"uppercase",...F(t)})}a(Gi,"_uppercase");function Bi(t,e){return new d_({check:"string_format",format:"includes",...F(e),includes:t})}a(Bi,"_includes");function qi(t,e){return new f_({check:"string_format",format:"starts_with",...F(e),prefix:t})}a(qi,"_startsWith");function Vi(t,e){return new p_({check:"string_format",format:"ends_with",...F(e),suffix:t})}a(Vi,"_endsWith");function Sd(t,e,n){return new m_({check:"property",property:t,schema:e,...F(n)})}a(Sd,"_property");function Zi(t,e){return new g_({check:"mime_type",mime:t,...F(e)})}a(Zi,"_mime");function un(t){return new h_({check:"overwrite",tx:t})}a(un,"_overwrite");function Hi(t){return un(e=>e.normalize(t))}a(Hi,"_normalize");function Ji(){return un(t=>t.trim())}a(Ji,"_trim");function Ki(){return un(t=>t.toLowerCase())}a(Ki,"_toLowerCase");function Wi(){return un(t=>t.toUpperCase())}a(Wi,"_toUpperCase");function ji(){return un(t=>dy(t))}a(ji,"_slugify");function oS(t,e,n){return new t({type:"array",element:e,...F(n)})}a(oS,"_array");function q9(t,e,n){return new t({type:"union",options:e,...F(n)})}a(q9,"_union");function V9(t,e,n){return new t({type:"union",options:e,inclusive:!1,...F(n)})}a(V9,"_xor");function Z9(t,e,n,o){return new t({type:"union",options:n,discriminator:e,...F(o)})}a(Z9,"_discriminatedUnion");function H9(t,e,n){return new t({type:"intersection",left:e,right:n})}a(H9,"_intersection");function J9(t,e,n,o){let r=n instanceof Y,i=r?o:n,s=r?n:null;return new t({type:"tuple",items:e,rest:s,...F(i)})}a(J9,"_tuple");function K9(t,e,n,o){return new t({type:"record",keyType:e,valueType:n,...F(o)})}a(K9,"_record");function W9(t,e,n,o){return new t({type:"map",keyType:e,valueType:n,...F(o)})}a(W9,"_map");function j9(t,e,n){return new t({type:"set",valueType:e,...F(n)})}a(j9,"_set");function Y9(t,e,n){let o=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new t({type:"enum",entries:o,...F(n)})}a(Y9,"_enum");function X9(t,e,n){return new t({type:"enum",entries:e,...F(n)})}a(X9,"_nativeEnum");function Q9(t,e,n){return new t({type:"literal",values:Array.isArray(e)?e:[e],...F(n)})}a(Q9,"_literal");function iS(t,e){return new t({type:"file",...F(e)})}a(iS,"_file");function eY(t,e){return new t({type:"transform",transform:e})}a(eY,"_transform");function tY(t,e){return new t({type:"optional",innerType:e})}a(tY,"_optional");function nY(t,e){return new t({type:"nullable",innerType:e})}a(nY,"_nullable");function rY(t,e,n){return new t({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():py(n)}})}a(rY,"_default");function oY(t,e,n){return new t({type:"nonoptional",innerType:e,...F(n)})}a(oY,"_nonoptional");function iY(t,e){return new t({type:"success",innerType:e})}a(iY,"_success");function sY(t,e,n){return new t({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}a(sY,"_catch");function aY(t,e,n){return new t({type:"pipe",in:e,out:n})}a(aY,"_pipe");function uY(t,e){return new t({type:"readonly",innerType:e})}a(uY,"_readonly");function lY(t,e,n){return new t({type:"template_literal",parts:e,...F(n)})}a(lY,"_templateLiteral");function cY(t,e){return new t({type:"lazy",getter:e})}a(cY,"_lazy");function dY(t,e){return new t({type:"promise",innerType:e})}a(dY,"_promise");function sS(t,e,n){var i;let o=F(n);return(i=o.abort)!=null||(o.abort=!0),new t({type:"custom",check:"custom",fn:e,...o})}a(sS,"_custom");function aS(t,e,n){return new t({type:"custom",check:"custom",fn:e,...F(n)})}a(aS,"_refine");function uS(t,e){let n=zD(o=>(o.addIssue=r=>{var i,s,u,c;if(typeof r=="string")o.issues.push(Ni(r,o.value,n._zod.def));else{let l=r;l.fatal&&(l.continue=!1),(i=l.code)!=null||(l.code="custom"),(s=l.input)!=null||(l.input=o.value),(u=l.inst)!=null||(l.inst=n),(c=l.continue)!=null||(l.continue=!n._zod.def.abort),o.issues.push(Ni(l))}},t(o.value,o)),e);return n}a(uS,"_superRefine");function zD(t,e){let n=new _e({check:"custom",...F(e)});return n._zod.check=t,n}a(zD,"_check");function lS(t){let e=new _e({check:"describe"});return e._zod.onattach=[n=>{var r;let o=(r=Ke.get(n))!=null?r:{};Ke.add(n,{...o,description:t})}],e._zod.check=()=>{},e}a(lS,"describe");function cS(t){let e=new _e({check:"meta"});return e._zod.onattach=[n=>{var r;let o=(r=Ke.get(n))!=null?r:{};Ke.add(n,{...o,...t})}],e._zod.check=()=>{},e}a(cS,"meta");function dS(t,e){var h,v,y,_,x;let n=F(e),o=(h=n.truthy)!=null?h:["true","1","yes","on","y","enabled"],r=(v=n.falsy)!=null?v:["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(o=o.map(E=>typeof E=="string"?E.toLowerCase():E),r=r.map(E=>typeof E=="string"?E.toLowerCase():E));let i=new Set(o),s=new Set(r),u=(y=t.Codec)!=null?y:Ua,c=(_=t.Boolean)!=null?_:La,l=(x=t.String)!=null?x:jr,p=new l({type:"string",error:n.error}),d=new c({type:"boolean",error:n.error}),g=new u({type:"pipe",in:p,out:d,transform:a(((E,T)=>{let S=E;return n.case!=="sensitive"&&(S=S.toLowerCase()),i.has(S)?!0:s.has(S)?!1:(T.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:T.value,inst:g,continue:!1}),{})}),"transform"),reverseTransform:a(((E,T)=>E===!0?o[0]||"true":r[0]||"false"),"reverseTransform"),error:n.error});return g}a(dS,"_stringbool");function Yi(t,e,n,o={}){let r=F(o),i={...F(o),check:"string_format",type:"string",format:e,fn:typeof n=="function"?n:u=>n.test(u),...r};return n instanceof RegExp&&(i.pattern=n),new t(i)}a(Yi,"_stringFormat");function Cr(t){var n,o,r,i,s,u,c,l,p;let e=(n=t==null?void 0:t.target)!=null?n:"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:(o=t.processors)!=null?o:{},metadataRegistry:(r=t==null?void 0:t.metadata)!=null?r:Ke,target:e,unrepresentable:(i=t==null?void 0:t.unrepresentable)!=null?i:"throw",override:(s=t==null?void 0:t.override)!=null?s:(()=>{}),io:(u=t==null?void 0:t.io)!=null?u:"output",counter:0,seen:new Map,cycles:(c=t==null?void 0:t.cycles)!=null?c:"ref",reused:(l=t==null?void 0:t.reused)!=null?l:"inline",external:(p=t==null?void 0:t.external)!=null?p:void 0}}a(Cr,"initializeContext");function ge(t,e,n={path:[],schemaPath:[]}){var p,d,g;var o;let r=t._zod.def,i=e.seen.get(t);if(i)return i.count++,n.schemaPath.includes(t)&&(i.cycle=n.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,s);let u=(d=(p=t._zod).toJSONSchema)==null?void 0:d.call(p);if(u)s.schema=u;else{let h={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,h);else{let y=s.schema,_=e.processors[r.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);_(t,e,y,h)}let v=t._zod.parent;v&&(s.ref||(s.ref=v),ge(v,e,h),e.seen.get(v).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Object.assign(s.schema,c),e.io==="input"&&mt(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&"_prefault"in s.schema&&((g=(o=s.schema).default)!=null||(o.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}a(ge,"process");function Ir(t,e){var s,u,c,l;let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let p of t.seen.entries()){let d=(s=t.metadataRegistry.get(p[0]))==null?void 0:s.id;if(d){let g=o.get(d);if(g&&g!==p[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(d,p[0])}}let r=a(p=>{var y,_,x,E,T;let d=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let S=(y=t.external.registry.get(p[0]))==null?void 0:y.id,I=(_=t.external.uri)!=null?_:(b=>b);if(S)return{ref:I(S)};let w=(E=(x=p[1].defId)!=null?x:p[1].schema.id)!=null?E:`schema${t.counter++}`;return p[1].defId=w,{defId:w,ref:`${I("__shared")}#/${d}/${w}`}}if(p[1]===n)return{ref:"#"};let h=`#/${d}/`,v=(T=p[1].schema.id)!=null?T:`__schema${t.counter++}`;return{defId:v,ref:h+v}},"makeURI"),i=a(p=>{if(p[1].schema.$ref)return;let d=p[1],{ref:g,defId:h}=r(p);d.def={...d.schema},h&&(d.defId=h);let v=d.schema;for(let y in v)delete v[y];v.$ref=g},"extractToDef");if(t.cycles==="throw")for(let p of t.seen.entries()){let d=p[1];if(d.cycle)throw new Error(`Cycle detected: #/${(u=d.cycle)==null?void 0:u.join("/")}/<root>
80
+
81
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let p of t.seen.entries()){let d=p[1];if(e===p[0]){i(p);continue}if(t.external){let h=(c=t.external.registry.get(p[0]))==null?void 0:c.id;if(e!==p[0]&&h){i(p);continue}}if((l=t.metadataRegistry.get(p[0]))==null?void 0:l.id){i(p);continue}if(d.cycle){i(p);continue}if(d.count>1&&t.reused==="ref"){i(p);continue}}}a(Ir,"extractDefs");function Ar(t,e){var u,c,l,p,d,g;let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=a(h=>{var T,S,I;let v=t.seen.get(h);if(v.ref===null)return;let y=(T=v.def)!=null?T:v.schema,_={...y},x=v.ref;if(v.ref=null,x){o(x);let w=t.seen.get(x),b=w.schema;if(b.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(y.allOf=(S=y.allOf)!=null?S:[],y.allOf.push(b)):Object.assign(y,b),Object.assign(y,_),h._zod.parent===x)for(let k in y)k==="$ref"||k==="allOf"||k in _||delete y[k];if(b.$ref&&w.def)for(let k in y)k==="$ref"||k==="allOf"||k in w.def&&JSON.stringify(y[k])===JSON.stringify(w.def[k])&&delete y[k]}let E=h._zod.parent;if(E&&E!==x){o(E);let w=t.seen.get(E);if(w!=null&&w.schema.$ref&&(y.$ref=w.schema.$ref,w.def))for(let b in y)b==="$ref"||b==="allOf"||b in w.def&&JSON.stringify(y[b])===JSON.stringify(w.def[b])&&delete y[b]}t.override({zodSchema:h,jsonSchema:y,path:(I=v.path)!=null?I:[]})},"flattenRef");for(let h of[...t.seen.entries()].reverse())o(h[0]);let r={};if(t.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":t.target,(u=t.external)!=null&&u.uri){let h=(c=t.external.registry.get(e))==null?void 0:c.id;if(!h)throw new Error("Schema is missing an `id` property");r.$id=t.external.uri(h)}Object.assign(r,(l=n.def)!=null?l:n.schema);let i=(p=t.metadataRegistry.get(e))==null?void 0:p.id;i!==void 0&&r.id===i&&delete r.id;let s=(g=(d=t.external)==null?void 0:d.defs)!=null?g:{};for(let h of t.seen.entries()){let v=h[1];v.def&&v.defId&&(v.def.id===v.defId&&delete v.def.id,s[v.defId]=v.def)}t.external||Object.keys(s).length>0&&(t.target==="draft-2020-12"?r.$defs=s:r.definitions=s);try{let h=JSON.parse(JSON.stringify(r));return Object.defineProperty(h,"~standard",{value:{...e["~standard"],jsonSchema:{input:Xi(e,"input",t.processors),output:Xi(e,"output",t.processors)}},enumerable:!1,writable:!1}),h}catch(h){throw new Error("Error converting schema to JSON.")}}a(Ar,"finalize");function mt(t,e){let n=e!=null?e:{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let o=t._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return mt(o.element,n);if(o.type==="set")return mt(o.valueType,n);if(o.type==="lazy")return mt(o.getter(),n);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return mt(o.innerType,n);if(o.type==="intersection")return mt(o.left,n)||mt(o.right,n);if(o.type==="record"||o.type==="map")return mt(o.keyType,n)||mt(o.valueType,n);if(o.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:mt(o.in,n)||mt(o.out,n);if(o.type==="object"){for(let r in o.shape)if(mt(o.shape[r],n))return!0;return!1}if(o.type==="union"){for(let r of o.options)if(mt(r,n))return!0;return!1}if(o.type==="tuple"){for(let r of o.items)if(mt(r,n))return!0;return!!(o.rest&&mt(o.rest,n))}return!1}a(mt,"isTransforming");var fS=a((t,e={})=>n=>{let o=Cr({...n,processors:e});return ge(t,o),Ir(o,t),Ar(o,t)},"createToJSONSchemaMethod"),Xi=a((t,e,n={})=>o=>{let{libraryOptions:r,target:i}=o!=null?o:{},s=Cr({...r!=null?r:{},target:i,io:e,processors:n});return ge(t,s),Ir(s,t),Ar(s,t)},"createStandardJSONSchemaMethod");var fY={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},pS=a((t,e,n,o)=>{var p;let r=n;r.type="string";let{minimum:i,maximum:s,format:u,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof i=="number"&&(r.minLength=i),typeof s=="number"&&(r.maxLength=s),u&&(r.format=(p=fY[u])!=null?p:u,r.format===""&&delete r.format,u==="time"&&delete r.format),l&&(r.contentEncoding=l),c&&c.size>0){let d=[...c];d.length===1?r.pattern=d[0].source:d.length>1&&(r.allOf=[...d.map(g=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},"stringProcessor"),mS=a((t,e,n,o)=>{let r=n,{minimum:i,maximum:s,format:u,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:p}=t._zod.bag;typeof u=="string"&&u.includes("int")?r.type="integer":r.type="number";let d=typeof p=="number"&&p>=(i!=null?i:Number.NEGATIVE_INFINITY),g=typeof l=="number"&&l<=(s!=null?s:Number.POSITIVE_INFINITY),h=e.target==="draft-04"||e.target==="openapi-3.0";d?h?(r.minimum=p,r.exclusiveMinimum=!0):r.exclusiveMinimum=p:typeof i=="number"&&(r.minimum=i),g?h?(r.maximum=l,r.exclusiveMaximum=!0):r.exclusiveMaximum=l:typeof s=="number"&&(r.maximum=s),typeof c=="number"&&(r.multipleOf=c)},"numberProcessor"),gS=a((t,e,n,o)=>{n.type="boolean"},"booleanProcessor"),hS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},"bigintProcessor"),vS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},"symbolProcessor"),yS=a((t,e,n,o)=>{e.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},"nullProcessor"),_S=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),xS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},"voidProcessor"),ES=a((t,e,n,o)=>{n.not={}},"neverProcessor"),SS=a((t,e,n,o)=>{},"anyProcessor"),TS=a((t,e,n,o)=>{},"unknownProcessor"),CS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},"dateProcessor"),IS=a((t,e,n,o)=>{let r=t._zod.def,i=Ia(r.entries);i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},"enumProcessor"),AS=a((t,e,n,o)=>{let r=t._zod.def,i=[];for(let s of r.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];n.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[s]:n.const=s}else i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),i.every(s=>typeof s=="boolean")&&(n.type="boolean"),i.every(s=>s===null)&&(n.type="null"),n.enum=i},"literalProcessor"),wS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},"nanProcessor"),bS=a((t,e,n,o)=>{let r=n,i=t._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=i.source},"templateLiteralProcessor"),RS=a((t,e,n,o)=>{let r=n,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:u,mime:c}=t._zod.bag;s!==void 0&&(i.minLength=s),u!==void 0&&(i.maxLength=u),c?c.length===1?(i.contentMediaType=c[0],Object.assign(r,i)):(Object.assign(r,i),r.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(r,i)},"fileProcessor"),kS=a((t,e,n,o)=>{n.type="boolean"},"successProcessor"),PS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},"customProcessor"),NS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},"functionProcessor"),$S=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},"transformProcessor"),DS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},"mapProcessor"),OS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},"setProcessor"),LS=a((t,e,n,o)=>{let r=n,i=t._zod.def,{minimum:s,maximum:u}=t._zod.bag;typeof s=="number"&&(r.minItems=s),typeof u=="number"&&(r.maxItems=u),r.type="array",r.items=ge(i.element,e,{...o,path:[...o.path,"items"]})},"arrayProcessor"),MS=a((t,e,n,o)=>{var l;let r=n,i=t._zod.def;r.type="object",r.properties={};let s=i.shape;for(let p in s)r.properties[p]=ge(s[p],e,{...o,path:[...o.path,"properties",p]});let u=new Set(Object.keys(s)),c=new Set([...u].filter(p=>{let d=i.shape[p]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(r.required=Array.from(c)),((l=i.catchall)==null?void 0:l._zod.def.type)==="never"?r.additionalProperties=!1:i.catchall?i.catchall&&(r.additionalProperties=ge(i.catchall,e,{...o,path:[...o.path,"additionalProperties"]})):e.io==="output"&&(r.additionalProperties=!1)},"objectProcessor"),Cd=a((t,e,n,o)=>{let r=t._zod.def,i=r.inclusive===!1,s=r.options.map((u,c)=>ge(u,e,{...o,path:[...o.path,i?"oneOf":"anyOf",c]}));i?n.oneOf=s:n.anyOf=s},"unionProcessor"),US=a((t,e,n,o)=>{let r=t._zod.def,i=ge(r.left,e,{...o,path:[...o.path,"allOf",0]}),s=ge(r.right,e,{...o,path:[...o.path,"allOf",1]}),u=a(l=>"allOf"in l&&Object.keys(l).length===1,"isSimpleIntersection"),c=[...u(i)?i.allOf:[i],...u(s)?s.allOf:[s]];n.allOf=c},"intersectionProcessor"),FS=a((t,e,n,o)=>{let r=n,i=t._zod.def;r.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",u=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((g,h)=>ge(g,e,{...o,path:[...o.path,s,h]})),l=i.rest?ge(i.rest,e,{...o,path:[...o.path,u,...e.target==="openapi-3.0"?[i.items.length]:[]]}):null;e.target==="draft-2020-12"?(r.prefixItems=c,l&&(r.items=l)):e.target==="openapi-3.0"?(r.items={anyOf:c},l&&r.items.anyOf.push(l),r.minItems=c.length,l||(r.maxItems=c.length)):(r.items=c,l&&(r.additionalItems=l));let{minimum:p,maximum:d}=t._zod.bag;typeof p=="number"&&(r.minItems=p),typeof d=="number"&&(r.maxItems=d)},"tupleProcessor"),zS=a((t,e,n,o)=>{let r=n,i=t._zod.def;r.type="object";let s=i.keyType,u=s._zod.bag,c=u==null?void 0:u.patterns;if(i.mode==="loose"&&c&&c.size>0){let p=ge(i.valueType,e,{...o,path:[...o.path,"patternProperties","*"]});r.patternProperties={};for(let d of c)r.patternProperties[d.source]=p}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(r.propertyNames=ge(i.keyType,e,{...o,path:[...o.path,"propertyNames"]})),r.additionalProperties=ge(i.valueType,e,{...o,path:[...o.path,"additionalProperties"]});let l=s._zod.values;if(l){let p=[...l].filter(d=>typeof d=="string"||typeof d=="number");p.length>0&&(r.required=p)}},"recordProcessor"),GS=a((t,e,n,o)=>{let r=t._zod.def,i=ge(r.innerType,e,o),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=r.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},"nullableProcessor"),BS=a((t,e,n,o)=>{let r=t._zod.def;ge(r.innerType,e,o);let i=e.seen.get(t);i.ref=r.innerType},"nonoptionalProcessor"),qS=a((t,e,n,o)=>{let r=t._zod.def;ge(r.innerType,e,o);let i=e.seen.get(t);i.ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))},"defaultProcessor"),VS=a((t,e,n,o)=>{let r=t._zod.def;ge(r.innerType,e,o);let i=e.seen.get(t);i.ref=r.innerType,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},"prefaultProcessor"),ZS=a((t,e,n,o)=>{let r=t._zod.def;ge(r.innerType,e,o);let i=e.seen.get(t);i.ref=r.innerType;let s;try{s=r.catchValue(void 0)}catch(u){throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},"catchProcessor"),HS=a((t,e,n,o)=>{let r=t._zod.def,i=r.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?i?r.out:r.in:r.out;ge(s,e,o);let u=e.seen.get(t);u.ref=s},"pipeProcessor"),JS=a((t,e,n,o)=>{let r=t._zod.def;ge(r.innerType,e,o);let i=e.seen.get(t);i.ref=r.innerType,n.readOnly=!0},"readonlyProcessor"),KS=a((t,e,n,o)=>{let r=t._zod.def;ge(r.innerType,e,o);let i=e.seen.get(t);i.ref=r.innerType},"promiseProcessor"),Id=a((t,e,n,o)=>{let r=t._zod.def;ge(r.innerType,e,o);let i=e.seen.get(t);i.ref=r.innerType},"optionalProcessor"),WS=a((t,e,n,o)=>{let r=t._zod.innerType;ge(r,e,o);let i=e.seen.get(t);i.ref=r},"lazyProcessor"),Td={string:pS,number:mS,boolean:gS,bigint:hS,symbol:vS,null:yS,undefined:_S,void:xS,never:ES,any:SS,unknown:TS,date:CS,enum:IS,literal:AS,nan:wS,template_literal:bS,file:RS,success:kS,custom:PS,function:NS,transform:$S,map:DS,set:OS,array:LS,object:MS,union:Cd,intersection:US,tuple:FS,record:zS,nullable:GS,nonoptional:BS,default:qS,prefault:VS,catch:ZS,pipe:HS,readonly:JS,promise:KS,optional:Id,lazy:WS};function wr(t,e){if("_idmap"in t){let o=t,r=Cr({...e,processors:Td}),i={};for(let c of o._idmap.entries()){let[l,p]=c;ge(p,r)}let s={},u={registry:o,uri:e==null?void 0:e.uri,defs:i};r.external=u;for(let c of o._idmap.entries()){let[l,p]=c;Ir(r,p),s[l]=Ar(r,p)}if(Object.keys(i).length>0){let c=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:i}}return{schemas:s}}let n=Cr({...e,processors:Td});return ge(t,n),Ir(n,t),Ar(n,t)}a(wr,"toJSONSchema");var jS=class jS{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){var o;let n=(o=e==null?void 0:e.target)!=null?o:"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=Cr({processors:Td,target:n,...(e==null?void 0:e.metadata)&&{metadata:e.metadata},...(e==null?void 0:e.unrepresentable)&&{unrepresentable:e.unrepresentable},...(e==null?void 0:e.override)&&{override:e.override},...(e==null?void 0:e.io)&&{io:e.io}})}process(e,n={path:[],schemaPath:[]}){return ge(e,this.ctx,n)}emit(e,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),Ir(this.ctx,e);let o=Ar(this.ctx,e),{"~standard":r,...i}=o;return i}};a(jS,"JSONSchemaGenerator");var Ad=jS;var YS={};var Za={};Rn(Za,{ZodAny:()=>ET,ZodArray:()=>IT,ZodBase64:()=>Jd,ZodBase64URL:()=>Kd,ZodBigInt:()=>is,ZodBigIntFormat:()=>Yd,ZodBoolean:()=>os,ZodCIDRv4:()=>Zd,ZodCIDRv6:()=>Hd,ZodCUID:()=>Ud,ZodCUID2:()=>Fd,ZodCatch:()=>JT,ZodCodec:()=>ru,ZodCustom:()=>ou,ZodCustomStringFormat:()=>ns,ZodDate:()=>Xa,ZodDefault:()=>GT,ZodDiscriminatedUnion:()=>wT,ZodE164:()=>Wd,ZodEmail:()=>Od,ZodEmoji:()=>Ld,ZodEnum:()=>es,ZodExactOptional:()=>UT,ZodFile:()=>LT,ZodFunction:()=>rC,ZodGUID:()=>Ja,ZodIPv4:()=>qd,ZodIPv6:()=>Vd,ZodIntersection:()=>bT,ZodJWT:()=>jd,ZodKSUID:()=>Bd,ZodLazy:()=>eC,ZodLiteral:()=>OT,ZodMAC:()=>mT,ZodMap:()=>$T,ZodNaN:()=>WT,ZodNanoID:()=>Md,ZodNever:()=>TT,ZodNonOptional:()=>rf,ZodNull:()=>_T,ZodNullable:()=>zT,ZodNumber:()=>rs,ZodNumberFormat:()=>ro,ZodObject:()=>eu,ZodOptional:()=>nf,ZodPipe:()=>nu,ZodPrefault:()=>qT,ZodPreprocess:()=>jT,ZodPromise:()=>nC,ZodReadonly:()=>YT,ZodRecord:()=>Qi,ZodSet:()=>DT,ZodString:()=>ts,ZodStringFormat:()=>ye,ZodSuccess:()=>HT,ZodSymbol:()=>vT,ZodTemplateLiteral:()=>QT,ZodTransform:()=>MT,ZodTuple:()=>kT,ZodType:()=>ee,ZodULID:()=>zd,ZodURL:()=>Ya,ZodUUID:()=>En,ZodUndefined:()=>yT,ZodUnion:()=>tu,ZodUnknown:()=>ST,ZodVoid:()=>CT,ZodXID:()=>Gd,ZodXor:()=>AT,_ZodString:()=>Dd,_default:()=>BT,_function:()=>WO,any:()=>AO,array:()=>Qa,base64:()=>lO,base64url:()=>cO,bigint:()=>EO,boolean:()=>hT,catch:()=>KT,check:()=>jO,cidrv4:()=>aO,cidrv6:()=>uO,codec:()=>ZO,cuid:()=>QD,cuid2:()=>eO,custom:()=>YO,date:()=>bO,describe:()=>XO,discriminatedUnion:()=>DO,e164:()=>dO,email:()=>qD,emoji:()=>YD,enum:()=>ef,exactOptional:()=>FT,file:()=>GO,float32:()=>vO,float64:()=>yO,function:()=>WO,guid:()=>VD,hash:()=>hO,hex:()=>gO,hostname:()=>mO,httpUrl:()=>jD,instanceof:()=>eL,int:()=>Nd,int32:()=>_O,int64:()=>SO,intersection:()=>RT,invertCodec:()=>HO,ipv4:()=>oO,ipv6:()=>sO,json:()=>nL,jwt:()=>fO,keyof:()=>RO,ksuid:()=>rO,lazy:()=>tC,literal:()=>zO,looseObject:()=>NO,looseRecord:()=>LO,mac:()=>iO,map:()=>MO,meta:()=>QO,nan:()=>VO,nanoid:()=>XD,nativeEnum:()=>FO,never:()=>Xd,nonoptional:()=>ZT,null:()=>xT,nullable:()=>Wa,nullish:()=>BO,number:()=>gT,object:()=>kO,optional:()=>Ka,partialRecord:()=>OO,pipe:()=>$d,prefault:()=>VT,preprocess:()=>rL,promise:()=>KO,readonly:()=>XT,record:()=>NT,refine:()=>oC,set:()=>UO,strictObject:()=>PO,string:()=>Ha,stringFormat:()=>pO,stringbool:()=>tL,success:()=>qO,superRefine:()=>iC,symbol:()=>CO,templateLiteral:()=>JO,transform:()=>tf,tuple:()=>PT,uint32:()=>xO,uint64:()=>TO,ulid:()=>tO,undefined:()=>IO,union:()=>Qd,unknown:()=>no,url:()=>WD,uuid:()=>ZD,uuidv4:()=>HD,uuidv6:()=>JD,uuidv7:()=>KD,void:()=>wO,xid:()=>nO,xor:()=>$O});var wd={};Rn(wd,{endsWith:()=>Vi,gt:()=>yn,gte:()=>pt,includes:()=>Bi,length:()=>eo,lowercase:()=>zi,lt:()=>vn,lte:()=>Nt,maxLength:()=>Qr,maxSize:()=>Tr,mime:()=>Zi,minLength:()=>Jn,minSize:()=>_n,multipleOf:()=>Sr,negative:()=>_d,nonnegative:()=>Ed,nonpositive:()=>xd,normalize:()=>Hi,overwrite:()=>un,positive:()=>yd,property:()=>Sd,regex:()=>Fi,size:()=>Xr,slugify:()=>ji,startsWith:()=>qi,toLowerCase:()=>Ki,toUpperCase:()=>Wi,trim:()=>Ji,uppercase:()=>Gi});var to={};Rn(to,{ZodISODate:()=>Rd,ZodISODateTime:()=>bd,ZodISODuration:()=>Pd,ZodISOTime:()=>kd,date:()=>QS,datetime:()=>XS,duration:()=>tT,time:()=>eT});var bd=C("ZodISODateTime",(t,e)=>{P_.init(t,e),ye.init(t,e)});function XS(t){return PE(bd,t)}a(XS,"datetime");var Rd=C("ZodISODate",(t,e)=>{N_.init(t,e),ye.init(t,e)});function QS(t){return NE(Rd,t)}a(QS,"date");var kd=C("ZodISOTime",(t,e)=>{$_.init(t,e),ye.init(t,e)});function eT(t){return $E(kd,t)}a(eT,"time");var Pd=C("ZodISODuration",(t,e)=>{D_.init(t,e),ye.init(t,e)});function tT(t){return DE(Pd,t)}a(tT,"duration");var GD=a((t,e)=>{ka.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(n=>Na(t,n),"value")},flatten:{value:a(n=>Pa(t,n),"value")},addIssue:{value:a(n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,ki,2)},"value")},addIssues:{value:a(n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,ki,2)},"value")},isEmpty:{get(){return t.issues.length===0}}})},"initializer"),mY=C("ZodError",GD),Ct=C("ZodError",GD,{Parent:Error});var nT=$i(Ct),rT=Di(Ct),oT=Oi(Ct),iT=Li(Ct),sT=Rc(Ct),aT=kc(Ct),uT=Pc(Ct),lT=Nc(Ct),cT=$c(Ct),dT=Dc(Ct),fT=Oc(Ct),pT=Lc(Ct);var BD=new WeakMap;function ja(t,e,n){let o=Object.getPrototypeOf(t),r=BD.get(o);if(r||(r=new Set,BD.set(o,r)),!r.has(e)){r.add(e);for(let i in n){let s=n[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let u=s.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:u}),u},set(u){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:u})}})}}}a(ja,"_installLazyMethods");var ee=C("ZodType",(t,e)=>(Y.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Xi(t,"input"),output:Xi(t,"output")}}),t.toJSONSchema=fS(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(n,o)=>nT(t,n,o,{callee:t.parse}),t.safeParse=(n,o)=>oT(t,n,o),t.parseAsync=async(n,o)=>rT(t,n,o,{callee:t.parseAsync}),t.safeParseAsync=async(n,o)=>iT(t,n,o),t.spa=t.safeParseAsync,t.encode=(n,o)=>sT(t,n,o),t.decode=(n,o)=>aT(t,n,o),t.encodeAsync=async(n,o)=>uT(t,n,o),t.decodeAsync=async(n,o)=>lT(t,n,o),t.safeEncode=(n,o)=>cT(t,n,o),t.safeDecode=(n,o)=>dT(t,n,o),t.safeEncodeAsync=async(n,o)=>fT(t,n,o),t.safeDecodeAsync=async(n,o)=>pT(t,n,o),ja(t,"ZodType",{check(...n){var r;let o=this.def;return this.clone(L.mergeDefs(o,{checks:[...(r=o.checks)!=null?r:[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,o){return dt(this,n,o)},brand(){return this},register(n,o){return n.add(this,o),this},refine(n,o){return this.check(oC(n,o))},superRefine(n,o){return this.check(iC(n,o))},overwrite(n){return this.check(un(n))},optional(){return Ka(this)},exactOptional(){return FT(this)},nullable(){return Wa(this)},nullish(){return Ka(Wa(this))},nonoptional(n){return ZT(this,n)},array(){return Qa(this)},or(n){return Qd([this,n])},and(n){return RT(this,n)},transform(n){return $d(this,tf(n))},default(n){return BT(this,n)},prefault(n){return VT(this,n)},catch(n){return KT(this,n)},pipe(n){return $d(this,n)},readonly(){return XT(this)},describe(n){let o=this.clone();return Ke.add(o,{description:n}),o},meta(...n){if(n.length===0)return Ke.get(this);let o=this.clone();return Ke.add(o,n[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(t,"description",{get(){var n;return(n=Ke.get(t))==null?void 0:n.description},configurable:!0}),t)),Dd=C("_ZodString",(t,e)=>{var o,r,i;jr.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(s,u,c)=>pS(t,s,u,c);let n=t._zod.bag;t.format=(o=n.format)!=null?o:null,t.minLength=(r=n.minimum)!=null?r:null,t.maxLength=(i=n.maximum)!=null?i:null,ja(t,"_ZodString",{regex(...s){return this.check(Fi(...s))},includes(...s){return this.check(Bi(...s))},startsWith(...s){return this.check(qi(...s))},endsWith(...s){return this.check(Vi(...s))},min(...s){return this.check(Jn(...s))},max(...s){return this.check(Qr(...s))},length(...s){return this.check(eo(...s))},nonempty(...s){return this.check(Jn(1,...s))},lowercase(s){return this.check(zi(s))},uppercase(s){return this.check(Gi(s))},trim(){return this.check(Ji())},normalize(...s){return this.check(Hi(...s))},toLowerCase(){return this.check(Ki())},toUpperCase(){return this.check(Wi())},slugify(){return this.check(ji())}})}),ts=C("ZodString",(t,e)=>{jr.init(t,e),Dd.init(t,e),t.email=n=>t.check(Xc(Od,n)),t.url=n=>t.check(Va(Ya,n)),t.jwt=n=>t.check(vd(jd,n)),t.emoji=n=>t.check(rd(Ld,n)),t.guid=n=>t.check(qa(Ja,n)),t.uuid=n=>t.check(Qc(En,n)),t.uuidv4=n=>t.check(ed(En,n)),t.uuidv6=n=>t.check(td(En,n)),t.uuidv7=n=>t.check(nd(En,n)),t.nanoid=n=>t.check(od(Md,n)),t.guid=n=>t.check(qa(Ja,n)),t.cuid=n=>t.check(id(Ud,n)),t.cuid2=n=>t.check(sd(Fd,n)),t.ulid=n=>t.check(ad(zd,n)),t.base64=n=>t.check(md(Jd,n)),t.base64url=n=>t.check(gd(Kd,n)),t.xid=n=>t.check(ud(Gd,n)),t.ksuid=n=>t.check(ld(Bd,n)),t.ipv4=n=>t.check(cd(qd,n)),t.ipv6=n=>t.check(dd(Vd,n)),t.cidrv4=n=>t.check(fd(Zd,n)),t.cidrv6=n=>t.check(pd(Hd,n)),t.e164=n=>t.check(hd(Wd,n)),t.datetime=n=>t.check(XS(n)),t.date=n=>t.check(QS(n)),t.time=n=>t.check(eT(n)),t.duration=n=>t.check(tT(n))});function Ha(t){return wE(ts,t)}a(Ha,"string");var ye=C("ZodStringFormat",(t,e)=>{ve.init(t,e),Dd.init(t,e)}),Od=C("ZodEmail",(t,e)=>{S_.init(t,e),ye.init(t,e)});function qD(t){return Xc(Od,t)}a(qD,"email");var Ja=C("ZodGUID",(t,e)=>{x_.init(t,e),ye.init(t,e)});function VD(t){return qa(Ja,t)}a(VD,"guid");var En=C("ZodUUID",(t,e)=>{E_.init(t,e),ye.init(t,e)});function ZD(t){return Qc(En,t)}a(ZD,"uuid");function HD(t){return ed(En,t)}a(HD,"uuidv4");function JD(t){return td(En,t)}a(JD,"uuidv6");function KD(t){return nd(En,t)}a(KD,"uuidv7");var Ya=C("ZodURL",(t,e)=>{T_.init(t,e),ye.init(t,e)});function WD(t){return Va(Ya,t)}a(WD,"url");function jD(t){return Va(Ya,{protocol:Tt.httpProtocol,hostname:Tt.domain,...L.normalizeParams(t)})}a(jD,"httpUrl");var Ld=C("ZodEmoji",(t,e)=>{C_.init(t,e),ye.init(t,e)});function YD(t){return rd(Ld,t)}a(YD,"emoji");var Md=C("ZodNanoID",(t,e)=>{I_.init(t,e),ye.init(t,e)});function XD(t){return od(Md,t)}a(XD,"nanoid");var Ud=C("ZodCUID",(t,e)=>{A_.init(t,e),ye.init(t,e)});function QD(t){return id(Ud,t)}a(QD,"cuid");var Fd=C("ZodCUID2",(t,e)=>{w_.init(t,e),ye.init(t,e)});function eO(t){return sd(Fd,t)}a(eO,"cuid2");var zd=C("ZodULID",(t,e)=>{b_.init(t,e),ye.init(t,e)});function tO(t){return ad(zd,t)}a(tO,"ulid");var Gd=C("ZodXID",(t,e)=>{R_.init(t,e),ye.init(t,e)});function nO(t){return ud(Gd,t)}a(nO,"xid");var Bd=C("ZodKSUID",(t,e)=>{k_.init(t,e),ye.init(t,e)});function rO(t){return ld(Bd,t)}a(rO,"ksuid");var qd=C("ZodIPv4",(t,e)=>{O_.init(t,e),ye.init(t,e)});function oO(t){return cd(qd,t)}a(oO,"ipv4");var mT=C("ZodMAC",(t,e)=>{M_.init(t,e),ye.init(t,e)});function iO(t){return RE(mT,t)}a(iO,"mac");var Vd=C("ZodIPv6",(t,e)=>{L_.init(t,e),ye.init(t,e)});function sO(t){return dd(Vd,t)}a(sO,"ipv6");var Zd=C("ZodCIDRv4",(t,e)=>{U_.init(t,e),ye.init(t,e)});function aO(t){return fd(Zd,t)}a(aO,"cidrv4");var Hd=C("ZodCIDRv6",(t,e)=>{F_.init(t,e),ye.init(t,e)});function uO(t){return pd(Hd,t)}a(uO,"cidrv6");var Jd=C("ZodBase64",(t,e)=>{G_.init(t,e),ye.init(t,e)});function lO(t){return md(Jd,t)}a(lO,"base64");var Kd=C("ZodBase64URL",(t,e)=>{B_.init(t,e),ye.init(t,e)});function cO(t){return gd(Kd,t)}a(cO,"base64url");var Wd=C("ZodE164",(t,e)=>{q_.init(t,e),ye.init(t,e)});function dO(t){return hd(Wd,t)}a(dO,"e164");var jd=C("ZodJWT",(t,e)=>{V_.init(t,e),ye.init(t,e)});function fO(t){return vd(jd,t)}a(fO,"jwt");var ns=C("ZodCustomStringFormat",(t,e)=>{Z_.init(t,e),ye.init(t,e)});function pO(t,e,n={}){return Yi(ns,t,e,n)}a(pO,"stringFormat");function mO(t){return Yi(ns,"hostname",Tt.hostname,t)}a(mO,"hostname");function gO(t){return Yi(ns,"hex",Tt.hex,t)}a(gO,"hex");function hO(t,e){var i;let n=(i=e==null?void 0:e.enc)!=null?i:"hex",o=`${t}_${n}`,r=Tt[o];if(!r)throw new Error(`Unrecognized hash format: ${o}`);return Yi(ns,o,r,e)}a(hO,"hash");var rs=C("ZodNumber",(t,e)=>{var o,r,i,s,u,c,l,p,d;Zc.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(g,h,v)=>mS(t,g,h,v),ja(t,"ZodNumber",{gt(g,h){return this.check(yn(g,h))},gte(g,h){return this.check(pt(g,h))},min(g,h){return this.check(pt(g,h))},lt(g,h){return this.check(vn(g,h))},lte(g,h){return this.check(Nt(g,h))},max(g,h){return this.check(Nt(g,h))},int(g){return this.check(Nd(g))},safe(g){return this.check(Nd(g))},positive(g){return this.check(yn(0,g))},nonnegative(g){return this.check(pt(0,g))},negative(g){return this.check(vn(0,g))},nonpositive(g){return this.check(Nt(0,g))},multipleOf(g,h){return this.check(Sr(g,h))},step(g,h){return this.check(Sr(g,h))},finite(){return this}});let n=t._zod.bag;t.minValue=(i=Math.max((o=n.minimum)!=null?o:Number.NEGATIVE_INFINITY,(r=n.exclusiveMinimum)!=null?r:Number.NEGATIVE_INFINITY))!=null?i:null,t.maxValue=(c=Math.min((s=n.maximum)!=null?s:Number.POSITIVE_INFINITY,(u=n.exclusiveMaximum)!=null?u:Number.POSITIVE_INFINITY))!=null?c:null,t.isInt=((l=n.format)!=null?l:"").includes("int")||Number.isSafeInteger((p=n.multipleOf)!=null?p:.5),t.isFinite=!0,t.format=(d=n.format)!=null?d:null});function gT(t){return OE(rs,t)}a(gT,"number");var ro=C("ZodNumberFormat",(t,e)=>{H_.init(t,e),rs.init(t,e)});function Nd(t){return ME(ro,t)}a(Nd,"int");function vO(t){return UE(ro,t)}a(vO,"float32");function yO(t){return FE(ro,t)}a(yO,"float64");function _O(t){return zE(ro,t)}a(_O,"int32");function xO(t){return GE(ro,t)}a(xO,"uint32");var os=C("ZodBoolean",(t,e)=>{La.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>gS(t,n,o,r)});function hT(t){return BE(os,t)}a(hT,"boolean");var is=C("ZodBigInt",(t,e)=>{var o,r,i;Hc.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(s,u,c)=>hS(t,s,u,c),t.gte=(s,u)=>t.check(pt(s,u)),t.min=(s,u)=>t.check(pt(s,u)),t.gt=(s,u)=>t.check(yn(s,u)),t.gte=(s,u)=>t.check(pt(s,u)),t.min=(s,u)=>t.check(pt(s,u)),t.lt=(s,u)=>t.check(vn(s,u)),t.lte=(s,u)=>t.check(Nt(s,u)),t.max=(s,u)=>t.check(Nt(s,u)),t.positive=s=>t.check(yn(BigInt(0),s)),t.negative=s=>t.check(vn(BigInt(0),s)),t.nonpositive=s=>t.check(Nt(BigInt(0),s)),t.nonnegative=s=>t.check(pt(BigInt(0),s)),t.multipleOf=(s,u)=>t.check(Sr(s,u));let n=t._zod.bag;t.minValue=(o=n.minimum)!=null?o:null,t.maxValue=(r=n.maximum)!=null?r:null,t.format=(i=n.format)!=null?i:null});function EO(t){return VE(is,t)}a(EO,"bigint");var Yd=C("ZodBigIntFormat",(t,e)=>{J_.init(t,e),is.init(t,e)});function SO(t){return HE(Yd,t)}a(SO,"int64");function TO(t){return JE(Yd,t)}a(TO,"uint64");var vT=C("ZodSymbol",(t,e)=>{K_.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>vS(t,n,o,r)});function CO(t){return KE(vT,t)}a(CO,"symbol");var yT=C("ZodUndefined",(t,e)=>{W_.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>_S(t,n,o,r)});function IO(t){return WE(yT,t)}a(IO,"_undefined");var _T=C("ZodNull",(t,e)=>{j_.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>yS(t,n,o,r)});function xT(t){return jE(_T,t)}a(xT,"_null");var ET=C("ZodAny",(t,e)=>{Y_.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>SS(t,n,o,r)});function AO(){return YE(ET)}a(AO,"any");var ST=C("ZodUnknown",(t,e)=>{X_.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>TS(t,n,o,r)});function no(){return XE(ST)}a(no,"unknown");var TT=C("ZodNever",(t,e)=>{Q_.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>ES(t,n,o,r)});function Xd(t){return QE(TT,t)}a(Xd,"never");var CT=C("ZodVoid",(t,e)=>{ex.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>xS(t,n,o,r)});function wO(t){return eS(CT,t)}a(wO,"_void");var Xa=C("ZodDate",(t,e)=>{tx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(o,r,i)=>CS(t,o,r,i),t.min=(o,r)=>t.check(pt(o,r)),t.max=(o,r)=>t.check(Nt(o,r));let n=t._zod.bag;t.minDate=n.minimum?new Date(n.minimum):null,t.maxDate=n.maximum?new Date(n.maximum):null});function bO(t){return tS(Xa,t)}a(bO,"date");var IT=C("ZodArray",(t,e)=>{nx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>LS(t,n,o,r),t.element=e.element,ja(t,"ZodArray",{min(n,o){return this.check(Jn(n,o))},nonempty(n){return this.check(Jn(1,n))},max(n,o){return this.check(Qr(n,o))},length(n,o){return this.check(eo(n,o))},unwrap(){return this.element}})});function Qa(t,e){return oS(IT,t,e)}a(Qa,"array");function RO(t){let e=t._zod.def.shape;return ef(Object.keys(e))}a(RO,"keyof");var eu=C("ZodObject",(t,e)=>{rx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>MS(t,n,o,r),L.defineLazy(t,"shape",()=>e.shape),ja(t,"ZodObject",{keyof(){return ef(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:no()})},loose(){return this.clone({...this._zod.def,catchall:no()})},strict(){return this.clone({...this._zod.def,catchall:Xd()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return L.extend(this,n)},safeExtend(n){return L.safeExtend(this,n)},merge(n){return L.merge(this,n)},pick(n){return L.pick(this,n)},omit(n){return L.omit(this,n)},partial(...n){return L.partial(nf,this,n[0])},required(...n){return L.required(rf,this,n[0])}})});function kO(t,e){let n={type:"object",shape:t!=null?t:{},...L.normalizeParams(e)};return new eu(n)}a(kO,"object");function PO(t,e){return new eu({type:"object",shape:t,catchall:Xd(),...L.normalizeParams(e)})}a(PO,"strictObject");function NO(t,e){return new eu({type:"object",shape:t,catchall:no(),...L.normalizeParams(e)})}a(NO,"looseObject");var tu=C("ZodUnion",(t,e)=>{Ma.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>Cd(t,n,o,r),t.options=e.options});function Qd(t,e){return new tu({type:"union",options:t,...L.normalizeParams(e)})}a(Qd,"union");var AT=C("ZodXor",(t,e)=>{tu.init(t,e),ox.init(t,e),t._zod.processJSONSchema=(n,o,r)=>Cd(t,n,o,r),t.options=e.options});function $O(t,e){return new AT({type:"union",options:t,inclusive:!1,...L.normalizeParams(e)})}a($O,"xor");var wT=C("ZodDiscriminatedUnion",(t,e)=>{tu.init(t,e),ix.init(t,e)});function DO(t,e,n){return new wT({type:"union",options:e,discriminator:t,...L.normalizeParams(n)})}a(DO,"discriminatedUnion");var bT=C("ZodIntersection",(t,e)=>{sx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>US(t,n,o,r)});function RT(t,e){return new bT({type:"intersection",left:t,right:e})}a(RT,"intersection");var kT=C("ZodTuple",(t,e)=>{Jc.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>FS(t,n,o,r),t.rest=n=>t.clone({...t._zod.def,rest:n})});function PT(t,e,n){let o=e instanceof Y,r=o?n:e,i=o?e:null;return new kT({type:"tuple",items:t,rest:i,...L.normalizeParams(r)})}a(PT,"tuple");var Qi=C("ZodRecord",(t,e)=>{ax.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>zS(t,n,o,r),t.keyType=e.keyType,t.valueType=e.valueType});function NT(t,e,n){return!e||!e._zod?new Qi({type:"record",keyType:Ha(),valueType:t,...L.normalizeParams(e)}):new Qi({type:"record",keyType:t,valueType:e,...L.normalizeParams(n)})}a(NT,"record");function OO(t,e,n){let o=dt(t);return o._zod.values=void 0,new Qi({type:"record",keyType:o,valueType:e,...L.normalizeParams(n)})}a(OO,"partialRecord");function LO(t,e,n){return new Qi({type:"record",keyType:t,valueType:e,mode:"loose",...L.normalizeParams(n)})}a(LO,"looseRecord");var $T=C("ZodMap",(t,e)=>{ux.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>DS(t,n,o,r),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...n)=>t.check(_n(...n)),t.nonempty=n=>t.check(_n(1,n)),t.max=(...n)=>t.check(Tr(...n)),t.size=(...n)=>t.check(Xr(...n))});function MO(t,e,n){return new $T({type:"map",keyType:t,valueType:e,...L.normalizeParams(n)})}a(MO,"map");var DT=C("ZodSet",(t,e)=>{lx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>OS(t,n,o,r),t.min=(...n)=>t.check(_n(...n)),t.nonempty=n=>t.check(_n(1,n)),t.max=(...n)=>t.check(Tr(...n)),t.size=(...n)=>t.check(Xr(...n))});function UO(t,e){return new DT({type:"set",valueType:t,...L.normalizeParams(e)})}a(UO,"set");var es=C("ZodEnum",(t,e)=>{cx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(o,r,i)=>IS(t,o,r,i),t.enum=e.entries,t.options=Object.values(e.entries);let n=new Set(Object.keys(e.entries));t.extract=(o,r)=>{let i={};for(let s of o)if(n.has(s))i[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new es({...e,checks:[],...L.normalizeParams(r),entries:i})},t.exclude=(o,r)=>{let i={...e.entries};for(let s of o)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new es({...e,checks:[],...L.normalizeParams(r),entries:i})}});function ef(t,e){let n=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new es({type:"enum",entries:n,...L.normalizeParams(e)})}a(ef,"_enum");function FO(t,e){return new es({type:"enum",entries:t,...L.normalizeParams(e)})}a(FO,"nativeEnum");var OT=C("ZodLiteral",(t,e)=>{dx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>AS(t,n,o,r),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function zO(t,e){return new OT({type:"literal",values:Array.isArray(t)?t:[t],...L.normalizeParams(e)})}a(zO,"literal");var LT=C("ZodFile",(t,e)=>{fx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>RS(t,n,o,r),t.min=(n,o)=>t.check(_n(n,o)),t.max=(n,o)=>t.check(Tr(n,o)),t.mime=(n,o)=>t.check(Zi(Array.isArray(n)?n:[n],o))});function GO(t){return iS(LT,t)}a(GO,"file");var MT=C("ZodTransform",(t,e)=>{px.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>$S(t,n,o,r),t._zod.parse=(n,o)=>{if(o.direction==="backward")throw new vr(t.constructor.name);n.addIssue=i=>{var s,u,c;if(typeof i=="string")n.issues.push(L.issue(i,n.value,e));else{let l=i;l.fatal&&(l.continue=!1),(s=l.code)!=null||(l.code="custom"),(u=l.input)!=null||(l.input=n.value),(c=l.inst)!=null||(l.inst=t),n.issues.push(L.issue(l))}};let r=e.transform(n.value,n);return r instanceof Promise?r.then(i=>(n.value=i,n.fallback=!0,n)):(n.value=r,n.fallback=!0,n)}});function tf(t){return new MT({type:"transform",transform:t})}a(tf,"transform");var nf=C("ZodOptional",(t,e)=>{Kc.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>Id(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function Ka(t){return new nf({type:"optional",innerType:t})}a(Ka,"optional");var UT=C("ZodExactOptional",(t,e)=>{mx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>Id(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function FT(t){return new UT({type:"optional",innerType:t})}a(FT,"exactOptional");var zT=C("ZodNullable",(t,e)=>{gx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>GS(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function Wa(t){return new zT({type:"nullable",innerType:t})}a(Wa,"nullable");function BO(t){return Ka(Wa(t))}a(BO,"nullish");var GT=C("ZodDefault",(t,e)=>{hx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>qS(t,n,o,r),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function BT(t,e){return new GT({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():L.shallowClone(e)}})}a(BT,"_default");var qT=C("ZodPrefault",(t,e)=>{vx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>VS(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function VT(t,e){return new qT({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():L.shallowClone(e)}})}a(VT,"prefault");var rf=C("ZodNonOptional",(t,e)=>{yx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>BS(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function ZT(t,e){return new rf({type:"nonoptional",innerType:t,...L.normalizeParams(e)})}a(ZT,"nonoptional");var HT=C("ZodSuccess",(t,e)=>{_x.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>kS(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function qO(t){return new HT({type:"success",innerType:t})}a(qO,"success");var JT=C("ZodCatch",(t,e)=>{xx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>ZS(t,n,o,r),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function KT(t,e){return new JT({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}a(KT,"_catch");var WT=C("ZodNaN",(t,e)=>{Ex.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>wS(t,n,o,r)});function VO(t){return rS(WT,t)}a(VO,"nan");var nu=C("ZodPipe",(t,e)=>{Wc.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>HS(t,n,o,r),t.in=e.in,t.out=e.out});function $d(t,e){return new nu({type:"pipe",in:t,out:e})}a($d,"pipe");var ru=C("ZodCodec",(t,e)=>{nu.init(t,e),Ua.init(t,e)});function ZO(t,e,n){return new ru({type:"pipe",in:t,out:e,transform:n.decode,reverseTransform:n.encode})}a(ZO,"codec");function HO(t){let e=t._zod.def;return new ru({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}a(HO,"invertCodec");var jT=C("ZodPreprocess",(t,e)=>{nu.init(t,e),Sx.init(t,e)}),YT=C("ZodReadonly",(t,e)=>{Tx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>JS(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function XT(t){return new YT({type:"readonly",innerType:t})}a(XT,"readonly");var QT=C("ZodTemplateLiteral",(t,e)=>{Cx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>bS(t,n,o,r)});function JO(t,e){return new QT({type:"template_literal",parts:t,...L.normalizeParams(e)})}a(JO,"templateLiteral");var eC=C("ZodLazy",(t,e)=>{wx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>WS(t,n,o,r),t.unwrap=()=>t._zod.def.getter()});function tC(t){return new eC({type:"lazy",getter:t})}a(tC,"lazy");var nC=C("ZodPromise",(t,e)=>{Ax.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>KS(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function KO(t){return new nC({type:"promise",innerType:t})}a(KO,"promise");var rC=C("ZodFunction",(t,e)=>{Ix.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>NS(t,n,o,r)});function WO(t){var e,n;return new rC({type:"function",input:Array.isArray(t==null?void 0:t.input)?PT(t==null?void 0:t.input):(e=t==null?void 0:t.input)!=null?e:Qa(no()),output:(n=t==null?void 0:t.output)!=null?n:no()})}a(WO,"_function");var ou=C("ZodCustom",(t,e)=>{bx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>PS(t,n,o,r)});function jO(t){let e=new _e({check:"custom"});return e._zod.check=t,e}a(jO,"check");function YO(t,e){return sS(ou,t!=null?t:(()=>!0),e)}a(YO,"custom");function oC(t,e={}){return aS(ou,t,e)}a(oC,"refine");function iC(t,e){return uS(t,e)}a(iC,"superRefine");var XO=lS,QO=cS;function eL(t,e={}){let n=new ou({type:"custom",check:"custom",fn:a(o=>o instanceof t,"fn"),abort:!0,...L.normalizeParams(e)});return n._zod.bag.Class=t,n._zod.check=o=>{var r;o.value instanceof t||o.issues.push({code:"invalid_type",expected:t.name,input:o.value,inst:n,path:[...(r=n._zod.def.path)!=null?r:[]]})},n}a(eL,"_instanceof");var tL=a((...t)=>dS({Codec:ru,Boolean:os,String:ts},...t),"stringbool");function nL(t){let e=tC(()=>Qd([Ha(t),gT(),hT(),xT(),Qa(e),NT(Ha(),e)]));return e}a(nL,"json");function rL(t,e){return new jT({type:"pipe",in:tf(t),out:e})}a(rL,"preprocess");var hY={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 vY(t){Pe({customError:t})}a(vY,"setErrorMap");function yY(){return Pe().customError}a(yY,"getErrorMap");var sC;sC||(sC={});var G={...Za,...wd,iso:to},_Y=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"]);function xY(t,e){let n=t.$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":e!=null?e:"draft-2020-12"}a(xY,"detectVersion");function EY(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=t.slice(1).split("/").filter(Boolean);if(n.length===0)return e.rootSchema;let o=e.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===o){let r=n[1];if(!r||!e.defs[r])throw new Error(`Reference not found: ${t}`);return e.defs[r]}throw new Error(`Reference not found: ${t}`)}a(EY,"resolveRef");function oL(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return G.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let r=t.$ref;if(e.refs.has(r))return e.refs.get(r);if(e.processing.has(r))return G.lazy(()=>{if(!e.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return e.refs.get(r)});e.processing.add(r);let i=EY(r,e),s=et(i,e);return e.refs.set(r,s),e.processing.delete(r),s}if(t.enum!==void 0){let r=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&r.length===1&&r[0]===null)return G.null();if(r.length===0)return G.never();if(r.length===1)return G.literal(r[0]);if(r.every(s=>typeof s=="string"))return G.enum(r);let i=r.map(s=>G.literal(s));return i.length<2?i[0]:G.union([i[0],i[1],...i.slice(2)])}if(t.const!==void 0)return G.literal(t.const);let n=t.type;if(Array.isArray(n)){let r=n.map(i=>{let s={...t,type:i};return oL(s,e)});return r.length===0?G.never():r.length===1?r[0]:G.union(r)}if(!n)return G.any();let o;switch(n){case"string":{let r=G.string();if(t.format){let i=t.format;i==="email"?r=r.check(G.email()):i==="uri"||i==="uri-reference"?r=r.check(G.url()):i==="uuid"||i==="guid"?r=r.check(G.uuid()):i==="date-time"?r=r.check(G.iso.datetime()):i==="date"?r=r.check(G.iso.date()):i==="time"?r=r.check(G.iso.time()):i==="duration"?r=r.check(G.iso.duration()):i==="ipv4"?r=r.check(G.ipv4()):i==="ipv6"?r=r.check(G.ipv6()):i==="mac"?r=r.check(G.mac()):i==="cidr"?r=r.check(G.cidrv4()):i==="cidr-v6"?r=r.check(G.cidrv6()):i==="base64"?r=r.check(G.base64()):i==="base64url"?r=r.check(G.base64url()):i==="e164"?r=r.check(G.e164()):i==="jwt"?r=r.check(G.jwt()):i==="emoji"?r=r.check(G.emoji()):i==="nanoid"?r=r.check(G.nanoid()):i==="cuid"?r=r.check(G.cuid()):i==="cuid2"?r=r.check(G.cuid2()):i==="ulid"?r=r.check(G.ulid()):i==="xid"?r=r.check(G.xid()):i==="ksuid"&&(r=r.check(G.ksuid()))}typeof t.minLength=="number"&&(r=r.min(t.minLength)),typeof t.maxLength=="number"&&(r=r.max(t.maxLength)),t.pattern&&(r=r.regex(new RegExp(t.pattern))),o=r;break}case"number":case"integer":{let r=n==="integer"?G.number().int():G.number();typeof t.minimum=="number"&&(r=r.min(t.minimum)),typeof t.maximum=="number"&&(r=r.max(t.maximum)),typeof t.exclusiveMinimum=="number"?r=r.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(r=r.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?r=r.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(r=r.lt(t.maximum)),typeof t.multipleOf=="number"&&(r=r.multipleOf(t.multipleOf)),o=r;break}case"boolean":{o=G.boolean();break}case"null":{o=G.null();break}case"object":{let r={},i=t.properties||{},s=new Set(t.required||[]);for(let[c,l]of Object.entries(i)){let p=et(l,e);r[c]=s.has(c)?p:p.optional()}if(t.propertyNames){let c=et(t.propertyNames,e),l=t.additionalProperties&&typeof t.additionalProperties=="object"?et(t.additionalProperties,e):G.any();if(Object.keys(r).length===0){o=G.record(c,l);break}let p=G.object(r).passthrough(),d=G.looseRecord(c,l);o=G.intersection(p,d);break}if(t.patternProperties){let c=t.patternProperties,l=Object.keys(c),p=[];for(let g of l){let h=et(c[g],e),v=G.string().regex(new RegExp(g));p.push(G.looseRecord(v,h))}let d=[];if(Object.keys(r).length>0&&d.push(G.object(r).passthrough()),d.push(...p),d.length===0)o=G.object({}).passthrough();else if(d.length===1)o=d[0];else{let g=G.intersection(d[0],d[1]);for(let h=2;h<d.length;h++)g=G.intersection(g,d[h]);o=g}break}let u=G.object(r);t.additionalProperties===!1?o=u.strict():typeof t.additionalProperties=="object"?o=u.catchall(et(t.additionalProperties,e)):o=u.passthrough();break}case"array":{let r=t.prefixItems,i=t.items;if(r&&Array.isArray(r)){let s=r.map(c=>et(c,e)),u=i&&typeof i=="object"&&!Array.isArray(i)?et(i,e):void 0;u?o=G.tuple(s).rest(u):o=G.tuple(s),typeof t.minItems=="number"&&(o=o.check(G.minLength(t.minItems))),typeof t.maxItems=="number"&&(o=o.check(G.maxLength(t.maxItems)))}else if(Array.isArray(i)){let s=i.map(c=>et(c,e)),u=t.additionalItems&&typeof t.additionalItems=="object"?et(t.additionalItems,e):void 0;u?o=G.tuple(s).rest(u):o=G.tuple(s),typeof t.minItems=="number"&&(o=o.check(G.minLength(t.minItems))),typeof t.maxItems=="number"&&(o=o.check(G.maxLength(t.maxItems)))}else if(i!==void 0){let s=et(i,e),u=G.array(s);typeof t.minItems=="number"&&(u=u.min(t.minItems)),typeof t.maxItems=="number"&&(u=u.max(t.maxItems)),o=u}else o=G.array(G.any());break}default:throw new Error(`Unsupported type: ${n}`)}return o}a(oL,"convertBaseSchema");function et(t,e){if(typeof t=="boolean")return t?G.any():G.never();let n=oL(t,e),o=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let u=t.anyOf.map(l=>et(l,e)),c=G.union(u);n=o?G.intersection(n,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let u=t.oneOf.map(l=>et(l,e)),c=G.xor(u);n=o?G.intersection(n,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)n=o?n:G.any();else{let u=o?n:et(t.allOf[0],e),c=o?0:1;for(let l=c;l<t.allOf.length;l++)u=G.intersection(u,et(t.allOf[l],e));n=u}t.nullable===!0&&e.version==="openapi-3.0"&&(n=G.nullable(n)),t.readOnly===!0&&(n=G.readonly(n)),t.default!==void 0&&(n=n.default(t.default));let r={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let u of i)u in t&&(r[u]=t[u]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let u of s)u in t&&(r[u]=t[u]);for(let u of Object.keys(t))_Y.has(u)||(r[u]=t[u]);return Object.keys(r).length>0&&e.registry.add(n,r),t.description&&(n=n.describe(t.description)),n}a(et,"convertSchema");function iL(t,e){var s;if(typeof t=="boolean")return t?G.any():G.never();let n;try{n=JSON.parse(JSON.stringify(t))}catch(u){throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=xY(n,e==null?void 0:e.defaultTarget),r=n.$defs||n.definitions||{},i={version:o,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:(s=e==null?void 0:e.registry)!=null?s:Ke};return et(n,i)}a(iL,"fromJSONSchema");var of={};Rn(of,{bigint:()=>IY,boolean:()=>CY,date:()=>AY,number:()=>TY,string:()=>SY});function SY(t){return bE(ts,t)}a(SY,"string");function TY(t){return LE(rs,t)}a(TY,"number");function CY(t){return qE(os,t)}a(CY,"boolean");function IY(t){return ZE(is,t)}a(IY,"bigint");function AY(t){return nS(Xa,t)}a(AY,"date");Pe(Fa());var wY=["minItems","maxItems","minLength","maxLength","minProperties","maxProperties"],bY=new Set(["propertyOrdering","example"]),RY={STRING:"string",NUMBER:"number",INTEGER:"integer",BOOLEAN:"boolean",ARRAY:"array",OBJECT:"object",NULL:"null"};function Sn(t){let e=t,n={};for(let[r,i]of Object.entries(e))if(!(i===void 0||bY.has(r)))switch(r){case"type":case"nullable":break;case"items":n.items=Sn(i);break;case"properties":{let s={};for(let[u,c]of Object.entries(i))s[u]=Sn(c);n.properties=s;break}case"anyOf":n.anyOf=i.map(Sn);break;case"format":i!=="enum"&&(n.format=i);break;default:n[r]=wY.includes(r)?Number(i):i}let o=typeof t.type=="string"?RY[t.type]:void 0;return o&&(n.type=t.nullable?[o,"null"]:o),Array.isArray(n.enum)&&(o==="integer"||o==="number")&&(n.enum=n.enum.map(r=>typeof r=="string"&&r.trim()!==""&&!isNaN(Number(r))?Number(r):r)),n}a(Sn,"genaiSchemaToJsonSchema");function iu(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}a(iu,"isZodSchema");function aC(t){return iu(t)&&!("_zod"in t)}a(aC,"isZodV3Schema");function uC(t){return iu(t)&&"_zod"in t}a(uC,"isZodV4Schema");function kY(t){var o,r;let e=t;if((o=e._def)!=null&&o.typeName)return e._def.typeName;let n=(r=e._def)==null?void 0:r.type;if(typeof n=="string"&&n)return"Zod"+n.charAt(0).toUpperCase()+n.slice(1)}a(kY,"getZodTypeName");function Tn(t){return iu(t)&&kY(t)==="ZodObject"}a(Tn,"isZodObject");function br(t){if(!Tn(t))throw new Error("Expected a Zod Object");if(uC(t))return wr(t,{target:"openapi-3.0",io:"input",override:a(e=>{var o;let{jsonSchema:n}=e;n.additionalProperties!==void 0&&delete n.additionalProperties,n.readOnly!==void 0&&delete n.readOnly,n.maxItems!==void 0&&(n.maxItems=n.maxItems.toString()),(n.format==="email"||n.format==="uuid")&&delete n.pattern,n.minItems!==void 0&&(n.minItems=n.minItems.toString()),n.minLength!==void 0&&(n.minLength=n.minLength.toString()),n.maxLength!==void 0&&(n.maxLength=n.maxLength.toString()),((o=n.enum)==null?void 0:o.length)===1&&n.enum[0]===null&&(n.type=j.NULL,delete n.enum),n.type!==void 0&&(n.type=n.type.toUpperCase())},"override")});if(aC(t))return Ta(t,{target:"openApi3",emailStrategy:"format:email",postProcess:a(e=>{var n,o,r,i,s,u,c;if(e)return e.additionalProperties!==void 0&&delete e.additionalProperties,e.maxItems!==void 0&&(e.maxItems=(n=e.maxItems)==null?void 0:n.toString()),e.minItems!==void 0&&(e.minItems=(o=e.minItems)==null?void 0:o.toString()),e.minLength!==void 0&&(e.minLength=(r=e.minLength)==null?void 0:r.toString()),e.maxLength!==void 0&&(e.maxLength=(i=e.maxLength)==null?void 0:i.toString()),((s=e.enum)==null?void 0:s.length)===1&&e.enum[0]==="null"&&(e.type=j.NULL,delete e.enum),e.type==="integer"&&e.format!=="int64"&&((u=e.minimum)!=null||(e.minimum=Number.MIN_SAFE_INTEGER),(c=e.maximum)!=null||(e.maximum=Number.MAX_SAFE_INTEGER)),e.type!==void 0&&(e.type=e.type.toUpperCase()),e},"postProcess")});throw new Error("Unsupported Zod schema version.")}a(br,"zodObjectToSchema");var sL=new WeakMap;function PY(t){let e=sL.get(t);if(e!==void 0)return e!=null?e:void 0;let n=null;try{n=pe.fromJSONSchema(Sn(t))}catch(o){n=null}return sL.set(t,n),n!=null?n:void 0}a(PY,"genaiSchemaValidator");function su(t,e){if(t===void 0)return e;if(iu(t))return t.parse(e);let n=PY(t);return n?n.parse(e):e}a(su,"parseWithSchema");function lC(t){return uC(t)?wr(t):aC(t)?Ta(t):Sn(t)}a(lC,"toJsonSchema");function cC(t){if(!(t===null||typeof t!="object"))try{return pe.fromJSONSchema(t)}catch(e){return}}a(cC,"compileJsonSchema");var aL=new WeakMap;function uL(t){let e=aL.get(t);if(e!==void 0)return e!=null?e:void 0;let n=null;try{let o=lC(t),r=o.properties;r&&typeof r=="object"&&(n=new Map(Object.entries(r).map(([i,s])=>[i,NY(s,o)])))}catch(o){n=null}return aL.set(t,n),n!=null?n:void 0}a(uL,"objectSchemaFields");var sf=Symbol("unresolvable-ref");function NY(t,e){try{return cC(af(t,e))}catch(n){return}}a(NY,"compileField");function $Y(t,e){if(!e.startsWith("#"))throw sf;let n=t;for(let o of e.slice(1).split("/").filter(Boolean)){let r=decodeURIComponent(o).replaceAll("~1","/").replaceAll("~0","~");if(n===null||typeof n!="object")throw sf;n=n[r]}if(n===void 0)throw sf;return n}a($Y,"resolvePointer");function af(t,e,n=new Set){if(Array.isArray(t))return t.map(i=>af(i,e,n));if(t===null||typeof t!="object")return t;let o=Object.entries(t),r=t.$ref;if(typeof r=="string"){if(n.has(r))throw sf;let i=af($Y(e,r),e,new Set([...n,r])),s=Object.fromEntries(o.filter(([u])=>u!=="$ref"));return{...i,...s}}return Object.fromEntries(o.map(([i,s])=>[i,af(s,e,n)]))}a(af,"inlineRefs");var cf=class cf extends Error{constructor(e="Node interrupted (awaiting resume input)."){super(e),this.name="NodeInterruptedError",Object.setPrototypeOf(this,cf.prototype)}};a(cf,"NodeInterruptedError");var uf=cf;function ls(t){return t instanceof Error&&t.name==="NodeInterruptedError"}a(ls,"isNodeInterruptedError");var df=class df extends Error{constructor(e){super(`Node '${e.nodeName}' timed out after ${e.timeout} seconds.`),this.name="NodeTimeoutError",this.nodeName=e.nodeName,this.timeout=e.timeout,Object.setPrototypeOf(this,df.prototype)}};a(df,"NodeTimeoutError");var ss=df;function lL(t){return t instanceof Error&&t.name==="NodeTimeoutError"}a(lL,"isNodeTimeoutError");var ff=class ff extends Error{constructor(e){super(e.message),this.name="DynamicNodeFailError",this.error=e.error,this.errorNodePath=e.errorNodePath,Object.setPrototypeOf(this,ff.prototype)}};a(ff,"DynamicNodeFailError");var lf=ff;function hf(t){return t instanceof Error&&t.name==="DynamicNodeFailError"}a(hf,"isDynamicNodeFailError");var pf=class pf extends Error{constructor(e){var r,i;let n=(r=e.errorCode)!=null?r:"UNKNOWN_ERROR",o=(i=e.errorMessage)!=null?i:n;super(`Node '${e.nodeName}' failed: ${n==="UNKNOWN_ERROR"?o:`${n}: ${o}`}`),this.name="NodeReportedError",this.code=n,this.nodeName=e.nodeName,Object.setPrototypeOf(this,pf.prototype)}};a(pf,"NodeReportedError");var as=pf;function cL(t){return t instanceof Error&&t.name==="NodeReportedError"}a(cL,"isNodeReportedError");var mf=class mf extends Error{constructor(e="Invocation aborted."){super(e),this.name="InvocationAbortedError",Object.setPrototypeOf(this,mf.prototype)}};a(mf,"InvocationAbortedError");var us=mf;function vf(t){return t instanceof Error&&t.name==="InvocationAbortedError"}a(vf,"isInvocationAbortedError");var gf=class gf extends Error{constructor(e){let n=e.direction==="input"?"inputSchema":"outputSchema",o=e.cause instanceof Error?e.cause.message:String(e.cause);super(`Node '${e.nodeName}' ${e.direction} does not match its ${n}: ${o}`,{cause:e.cause}),this.name="NodeSchemaValidationError",this.nodeName=e.nodeName,this.direction=e.direction,Object.setPrototypeOf(this,gf.prototype)}};a(gf,"NodeSchemaValidationError");var oo=gf;function dL(t){return t instanceof Error&&t.name==="NodeSchemaValidationError"}a(dL,"isNodeSchemaValidationError");var dC=Symbol.for("google.adk.workflow.requestInput"),fL;fL=dC;var fC=class fC{constructor(e={}){this[fL]=!0;var n;this.interruptId=(n=e.interruptId)!=null?n:fn(),this.payload=e.payload,this.message=e.message,this.responseSchema=e.responseSchema}};a(fC,"RequestInput");var yf=fC;function _f(t){return typeof t=="object"&&t!==null&&dC in t&&t[dC]===!0}a(_f,"isRequestInput");function pC(t){if(t!=null)return t.map(e=>{if(typeof e=="string")return e;if(typeof e=="function"&&e.name)return e.name;throw new Error(`exceptions must contain error class names (string) or error classes, got: ${String(e)}`)})}a(pC,"normalizeRetryExceptions");function cs(t){return{maxAttempts:t.maxAttempts,initialDelay:t.initialDelay,maxDelay:t.maxDelay,backoffFactor:t.backoffFactor,jitter:t.jitter,exceptions:pC(t.exceptions)}}a(cs,"prepareRetryConfig");var au=(n=>(n.VERTEX_AI="VERTEX_AI",n.GEMINI_API="GEMINI_API",n))(au||{});function xf(){return Zu()?"VERTEX_AI":"GEMINI_API"}a(xf,"getGoogleLlmVariant");var mC=Symbol.for("google.adk.baseTool"),gC=Symbol.for("google.adk.inModelTool");function DY(t){return typeof t=="object"&&t!==null&&t[gC]===!0}a(DY,"isInModelTool");function uu(t){return typeof t=="object"&&t!==null&&mC in t&&t[mC]===!0}a(uu,"isBaseTool");var pL;pL=mC;var hC=class hC{constructor(e){this[pL]=!0;var n;this.name=e.name,this.description=e.description,this.isLongRunning=(n=e.isLongRunning)!=null?n:!1}_getDeclaration(){}async checkRequireConfirmation(e,n){return!1}async processLlmRequest({llmRequest:e}){let n=this._getDeclaration();if(!n)return;let o=Object.hasOwn(e.toolsDict,this.name)?e.toolsDict[this.name]:void 0;if(o&&!DY(o))throw new Error(`Duplicate tool name: ${this.name}`);e.toolsDict[this.name]=this;let r=OY(e);r?(r.functionDeclarations||(r.functionDeclarations=[]),r.functionDeclarations.push(n)):(e.config=e.config||{},e.config.tools=e.config.tools||[],e.config.tools.push({functionDeclarations:[n]}))}get apiVariant(){return xf()}};a(hC,"BaseTool");var se=hC;function OY(t){var e;return(((e=t.config)==null?void 0:e.tools)||[]).find(n=>"functionDeclarations"in n)}a(OY,"findToolWithFunctionDeclarations");var vC=(r=>(r.CLIENT_CREDENTIALS="client_credentials",r.AUTHORIZATION_CODE="authorization_code",r.IMPLICIT="implicit",r.PASSWORD="password",r))(vC||{});function mL(t){if(t.clientCredentials)return"client_credentials";if(t.authorizationCode)return"authorization_code";if(t.implicit)return"implicit";if(t.password)return"password"}a(mL,"getOAuthGrantTypeFromFlow");var yC=class yC extends Error{};a(yC,"CredentialExchangeError");var It=yC;var LY=new Set(["password","passwd","pwd","sslpassword","code","access_token","id_token","refresh_token","client_secret","code_verifier"]);function gL(t){try{let e=new URL(t),n=!1;e.password&&(e.password="***",n=!0);for(let o of[...e.searchParams.keys()])LY.has(o.toLowerCase())&&(e.searchParams.set(o,"***"),n=!0);return n?e.toString():t}catch(e){let n=t.indexOf("://");return n===-1?"<unparseable URI, redacted>":`${t.slice(0,n)}://<unparseable URI, redacted>`}}a(gL,"redactUriPassword");var MY=pe.object({issuer:pe.string(),authorization_endpoint:pe.string(),token_endpoint:pe.string(),scopes_supported:pe.array(pe.string()).optional(),registration_endpoint:pe.string().optional()}),UY=pe.object({resource:pe.string(),authorization_servers:pe.array(pe.string()).default([])}),xC=class xC{async discoverAuthServerMetadata(e){if(!Ef(e))return;let n,o;try{let i=new URL(e);n=`${i.protocol}//${i.host}`,o=i.pathname}catch(i){N.warn(`Failed to parse issuerUrl ${e}: ${i}`);return}let r=[];o&&o!=="/"?r.push(`${n}/.well-known/oauth-authorization-server${o}`,`${n}/.well-known/openid-configuration${o}`,`${n}${o}/.well-known/openid-configuration`):r.push(`${n}/.well-known/oauth-authorization-server`,`${n}/.well-known/openid-configuration`);for(let i of r)try{let s=await fetch(i,{method:"GET",headers:{Accept:"application/json"},redirect:"error"});if(!s.ok)continue;let u=await s.json(),c=MY.parse(u);if(c.issuer.replace(/\/$/,"")===e.replace(/\/$/,""))return c;N.warn(`Issuer in metadata ${c.issuer} does not match issuerUrl ${e}`)}catch(s){N.debug(`Failed to fetch metadata from ${i}: ${s}`)}}async discoverResourceMetadata(e){if(!Ef(e))return;let n,o;try{let i=new URL(e);n=`${i.protocol}//${i.host}`,o=i.pathname}catch(i){N.warn(`Failed to parse resourceUrl ${e}: ${i}`);return}let r;o&&o!=="/"?r=`${n}/.well-known/oauth-protected-resource${o}`:r=`${n}/.well-known/oauth-protected-resource`;try{let i=await fetch(r,{method:"GET",headers:{Accept:"application/json"},redirect:"error"});if(!i.ok)return;let s=await i.json(),u=UY.parse(s);if(u.resource.replace(/\/$/,"")===e.replace(/\/$/,""))return u;N.warn(`Resource in metadata ${u.resource} does not match resourceUrl ${e}`)}catch(i){N.debug(`Failed to fetch metadata from ${r}: ${i}`)}}};a(xC,"OAuth2DiscoveryManager");var _C=xC;function FY(t){let e=t.replace(/^\[|\]$/g,""),n=e.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(n){let r=parseInt(n[1],16),i=parseInt(n[2],16);return[r>>8&255,r&255,i>>8&255,i&255].join(".")}let o=e.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);return o?o[1]:t}a(FY,"normaliseHostname");function Ef(t){try{let e=new URL(t);if(e.protocol!=="https:")return N.warn(`Unsafe protocol for discovery URL: ${e.protocol}`),!1;let n=FY(e.hostname.toLowerCase());if(n==="localhost"||n==="metadata.google.internal"||n==="metadata.goog"||n.startsWith("127.")||n==="[::1]"||n==="[::]"||n==="0.0.0.0"||n.startsWith("10.")||n.startsWith("192.168.")||n.startsWith("169.254."))return N.warn(`Unsafe host for discovery URL: ${n}`),!1;let o=n.match(/^172\.(\d+)\./);if(o){let i=parseInt(o[1],10);if(i>=16&&i<=31)return N.warn(`Unsafe host for discovery URL: ${n}`),!1}let r=n.match(/^100\.(\d+)\./);if(r){let i=parseInt(r[1],10);if(i>=64&&i<=127)return N.warn(`Unsafe host for discovery URL: ${n}`),!1}return/^\[(f[cd][0-9a-f]{2}|fe[89ab][0-9a-f]):/i.test(e.hostname)?(N.warn(`Unsafe host for discovery URL: ${e.hostname}`),!1):!0}catch(e){return N.warn(`Failed to parse URL for validation ${t}: ${e}`),!1}}a(Ef,"validateDiscoveryUrl");var zY=36;function hL(){return sR(zY).toString("base64url")}a(hL,"generateCodeVerifier");function vL(t){return iR("sha256").update(t).digest("base64url")}a(vL,"createS256CodeChallenge");function EC(t){if(t.type==="openIdConnect"&&t.tokenEndpoint)return t.tokenEndpoint;if(t.type==="oauth2"&&t.flows){let e=t.flows,n=e.authorizationCode||e.clientCredentials||e.password||e.implicit;if(n&&"tokenUrl"in n)return n.tokenUrl}}a(EC,"getTokenEndpoint");async function SC(t,e){if(!Ef(t))throw new Error(`SSRF protection: OAuth2 token endpoint '${t}' is not allowed. Must use HTTPS and must not target private/loopback/cloud-metadata addresses.`);try{let n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:e.toString(),redirect:"error"});if(!n.ok)throw new Error(`Token request failed with status ${n.status}`);let o=await n.json();return{accessToken:o.access_token,refreshToken:o.refresh_token,idToken:o.id_token,expiresIn:o.expires_in,expiresAt:o.expires_in?Date.now()+o.expires_in*1e3:void 0}}catch(n){throw N.error(`Failed to fetch OAuth2 tokens: ${n}`),n}}a(SC,"fetchOAuth2Tokens");function yL(t){try{return new URL(t).searchParams.get("code")||void 0}catch(e){N.warn(`Failed to parse authorization URI ${gL(t)}`);return}}a(yL,"parseAuthorizationCode");function TC(t){let e=new URLSearchParams;return e.set("grant_type",t.grantType),e.set("client_id",t.clientId),e.set("client_secret",t.clientSecret),t.grantType==="authorization_code"?(e.set("code",t.code),t.redirectUri&&e.set("redirect_uri",t.redirectUri),t.codeVerifier&&e.set("code_verifier",t.codeVerifier)):t.grantType==="refresh_token"&&e.set("refresh_token",t.refreshToken),e}a(TC,"createOAuth2TokenRequestBody");var CC=class CC{async exchange({authCredential:e,authScheme:n}){var r;if(!n)throw new It("authScheme is required for OAuth2 credential exchange");if((r=e.oauth2)!=null&&r.accessToken)return{credential:e,wasExchanged:!1};let o=GY(n);return o==="client_credentials"?BY({authCredential:e,authScheme:n}):o==="authorization_code"?qY({authCredential:e,authScheme:n}):(N.warn(`Unsupported OAuth2 grant type: ${o}`),{credential:e,wasExchanged:!1})}};a(CC,"OAuth2CredentialExchanger");var lu=CC;function GY(t){var e;if("flows"in t&&t.flows)return mL(t.flows);if(t.grantTypesSupported)return(e=t.grantTypesSupported)!=null&&e.includes("client_credentials")?"client_credentials":"authorization_code"}a(GY,"determineGrantType");async function BY({authCredential:t,authScheme:e}){var r,i;let n=EC(e);if(!n)throw new It("Token endpoint not found in auth scheme.");if(!((r=t.oauth2)!=null&&r.clientId)||!((i=t.oauth2)!=null&&i.clientSecret))throw new It("clientId and clientSecret are required for client credentials exchange.");let o=TC({grantType:"client_credentials",clientId:t.oauth2.clientId,clientSecret:t.oauth2.clientSecret});try{let s=await SC(n,o);return{credential:{...t,oauth2:{...t.oauth2,...s}},wasExchanged:!0}}catch(s){throw new It(`Failed to exchange tokens: ${s instanceof Error?s.message:String(s)}`)}}a(BY,"exchangeClientCredentials");async function qY({authCredential:t,authScheme:e}){var i,s,u,c;let n=EC(e);if(!n)throw new It("Token endpoint not found in auth scheme.");if(!((i=t.oauth2)!=null&&i.clientId)||!((s=t.oauth2)!=null&&s.clientSecret)||!((u=t.oauth2)!=null&&u.authCode)&&!((c=t.oauth2)!=null&&c.authResponseUri))throw new It("clientId, clientSecret, and either authCode or authResponseUri are required for authorization code exchange.");let o=t.oauth2.authCode;if(!o&&t.oauth2.authResponseUri&&(o=yL(t.oauth2.authResponseUri)),t.oauth2.authResponseUri&&t.oauth2.state)try{let p=new URL(t.oauth2.authResponseUri).searchParams.get("state")||void 0;if(t.oauth2.state!==p)throw new It("State mismatch detected. Potential CSRF attack.")}catch(l){throw new It(`Failed to parse authResponseUri for state validation: ${l instanceof Error?l.message:String(l)}`)}if(!o)throw new It("Authorization code not found in auth response.");let r=TC({grantType:"authorization_code",clientId:t.oauth2.clientId,clientSecret:t.oauth2.clientSecret,code:o,redirectUri:t.oauth2.redirectUri,codeVerifier:t.oauth2.codeVerifier});try{let l=await SC(n,r);return{credential:{...t,oauth2:{...t.oauth2,...l}},wasExchanged:!0}}catch(l){throw new It(`Failed to exchange tokens: ${l instanceof Error?l.message:String(l)}`)}}a(qY,"exchangeAuthorizationCode");var _L="S256",IC=class IC{constructor(e){this.authConfig=e}getAuthResponse(e){let n="temp:"+this.authConfig.credentialKey;return e.get(n)}async parseAndStoreAuthResponse(e){if(!this.authConfig.credentialKey)throw new Error("credentialKey is empty.");let n="temp:"+this.authConfig.credentialKey,o=this.authConfig.authScheme.type;if(!["oauth2","openIdConnect"].includes(o)){e.set(n,this.authConfig.exchangedAuthCredential);return}if(this.authConfig.exchangedAuthCredential){let i=await new lu().exchange({authCredential:this.authConfig.exchangedAuthCredential,authScheme:this.authConfig.authScheme});e.set(n,i.credential)}}generateAuthRequest(){var n,o;let e=this.authConfig.authScheme.type;if(!["oauth2","openIdConnect"].includes(e))return this.authConfig;if((o=(n=this.authConfig.exchangedAuthCredential)==null?void 0:n.oauth2)!=null&&o.authUri)return this.authConfig;if(!this.authConfig.rawAuthCredential)throw new Error(`Auth Scheme ${e} requires authCredential.`);if(!this.authConfig.rawAuthCredential.oauth2)throw new Error(`Auth Scheme ${e} requires oauth2 in authCredential.`);if(this.authConfig.rawAuthCredential.oauth2.authUri)return{credentialKey:this.authConfig.credentialKey,authScheme:this.authConfig.authScheme,rawAuthCredential:this.authConfig.rawAuthCredential,exchangedAuthCredential:this.authConfig.rawAuthCredential};if(!this.authConfig.rawAuthCredential.oauth2.clientId||!this.authConfig.rawAuthCredential.oauth2.clientSecret)throw new Error(`Auth Scheme ${e} requires both clientId and clientSecret in authCredential.oauth2.`);return{credentialKey:this.authConfig.credentialKey,authScheme:this.authConfig.authScheme,rawAuthCredential:this.authConfig.rawAuthCredential,exchangedAuthCredential:this.generateAuthUri()}}generateAuthUri(){let e=this.authConfig.authScheme,n=this.authConfig.rawAuthCredential;if(!n||!n.oauth2)return n;let o=n.oauth2,r=o.codeChallengeMethod;if(r&&r!==_L)throw new Error(`Unsupported codeChallengeMethod: ${r}. Only '${_L}' is supported.`);let i="",s=[];if("authorizationEndpoint"in e)i=e.authorizationEndpoint,s=e.scopes||[];else if(e.type==="oauth2"&&e.flows){let d=e.flows,g=d.implicit||d.authorizationCode||d.clientCredentials||d.password;g&&("authorizationUrl"in g&&g.authorizationUrl?i=g.authorizationUrl:"tokenUrl"in g&&g.tokenUrl&&(i=g.tokenUrl),g.scopes&&(s=Object.keys(g.scopes)))}if(!i)throw new Error("Authorization endpoint not configured in auth scheme.");let u=fn(),c=new URL(i);c.searchParams.set("client_id",o.clientId||""),c.searchParams.set("redirect_uri",o.redirectUri||""),c.searchParams.set("response_type","code"),c.searchParams.set("scope",s.join(" ")),c.searchParams.set("state",u),c.searchParams.set("access_type","offline"),c.searchParams.set("prompt","consent"),o.audience&&c.searchParams.set("audience",o.audience),o.nonce&&c.searchParams.set("nonce",o.nonce);let l=o.codeVerifier;return r&&(l!=null||(l=hL()),c.searchParams.set("code_challenge",vL(l)),c.searchParams.set("code_challenge_method",r)),{...n,oauth2:{...o,authUri:c.toString(),state:u,codeVerifier:l}}}};a(IC,"AuthHandler");var Ht=IC;var Sf=class Sf extends TypeError{constructor(e){super(e),this.name="StateSchemaError",Object.setPrototypeOf(this,Sf.prototype)}};a(Sf,"StateSchemaError");var cu=Sf;function VY(t){return t instanceof Error&&t.name==="StateSchemaError"}a(VY,"isStateSchemaError");var ds=class ds{constructor(e={},n={},o){this.value=e;this.delta=n;this.schema=o}validateDelta(e){for(let[n,o]of Object.entries(e))this.validate(n,o)}validate(e,n){if(this.schema===void 0||e.includes(":"))return;let o=uL(this.schema);if(!o)return;if(!o.has(e))throw new cu(`Key '${e}' is not declared in the state schema. Declared fields: `+JSON.stringify([...o.keys()].sort()));let r=o.get(e);if(!r)return;let i=r.safeParse(n);if(!i.success)throw new cu(`Value for '${e}' does not match the type declared in the state schema: ${i.error.message}`)}get(e,n){return e in this.delta?this.delta[e]:e in this.value?this.value[e]:n}set(e,n){this.validate(e,n),this.value[e]=n,this.delta[e]=n,em(this.value,this.delta,e)}has(e){return e in this.value||e in this.delta}hasDelta(){return Object.keys(this.delta).length>0}update(e){this.validateDelta(e),Object.assign(this.delta,e),Object.assign(this.value,e);for(let n of Object.keys(e))em(this.value,this.delta,n)}toRecord(){return{...this.value,...this.delta}}};a(ds,"State"),ds.APP_PREFIX="app:",ds.USER_PREFIX="user:",ds.TEMP_PREFIX="temp:";var me=ds;var AC=class AC{constructor({hint:e,confirmed:n,payload:o}){this.hint=e!=null?e:"",this.confirmed=n,this.payload=o}};a(AC,"ToolConfirmation");var Rr=AC,Tf=class Tf extends Error{constructor(e){let n=e.functionCallId?` for function call '${e.functionCallId}'`:"";super(`Tool confirmation rejected${n}: ${e.reason}.`),this.name="IntentMismatchError",this.reason=e.reason,this.functionCallId=e.functionCallId,Object.setPrototypeOf(this,Tf.prototype)}};a(Tf,"IntentMismatchError");var io=Tf;function ZY(t){return t instanceof Error&&t.name==="IntentMismatchError"}a(ZY,"isIntentMismatchError");var RC=class RC{constructor(){this.numberOfLlmCalls=0}incrementAndEnforceLlmCallsLimit(e){if(this.numberOfLlmCalls++,e&&e.maxLlmCalls>0&&this.numberOfLlmCalls>e.maxLlmCalls)throw new Error(`Max number of llm calls limit of ${e.maxLlmCalls} exceeded`)}};a(RC,"InvocationCostManager");var wC=RC,Cf=class Cf{constructor(e){var n,o;this.artifactService=e.artifactService,this.sessionService=e.sessionService,this.memoryService=e.memoryService,this.invocationId=e.invocationId,this.branch=e.branch,this.agent=e.agent,this.userContent=e.userContent,this.session=e.session,this.endInvocation=e.endInvocation||!1,this.transcriptionCache=e.transcriptionCache,this.runConfig=e.runConfig,this.activeStreamingTools=e.activeStreamingTools,this.pluginManager=e.pluginManager,this.abortSignal=e.abortSignal,this.workflowInstructionScope=e.workflowInstructionScope,this.isolationScope=e.isolationScope,this.nodeToolDepth=(n=e.nodeToolDepth)!=null?n:0,this.a2aMetadata=e.a2aMetadata,this.invocationCostManager=(o=e.invocationCostManager)!=null?o:new wC,this.liveRequestQueue=e.liveRequestQueue,this.liveSessionResumptionHandle=e.liveSessionResumptionHandle}get appName(){return this.session.appName}get userId(){return this.session.userId}incrementLlmCallCount(){this.invocationCostManager.incrementAndEnforceLlmCallsLimit(this.runConfig)}clone(e={}){return new Cf({...this,...e})}};a(Cf,"InvocationContext");var Jt=Cf;function bC(){return`e-${fn()}`}a(bC,"newInvocationContextId");function We(t){if(!t.agent)throw new Error("InvocationContext.agent is not set: this invocation is running a node directly, so there is no agent at this level.");return t.agent}a(We,"requireAgent");var kC=class kC{constructor(e){this.invocationContext=e}get userContent(){return this.invocationContext.userContent}get invocationId(){return this.invocationContext.invocationId}get userId(){return this.invocationContext.userId}get sessionId(){return this.invocationContext.session.id}get agentName(){return We(this.invocationContext).name}get state(){return new me(this.invocationContext.session.state,{})}get a2aMetadata(){return this.invocationContext.a2aMetadata}};a(kC,"ReadonlyContext");var Ie=kC;var PC=class PC extends Ie{constructor(e){var n;super(e.invocationContext),this.eventActions=e.eventActions||Ft(),this._state=new me(e.invocationContext.session.state,this.eventActions.stateDelta),this.functionCallId=e.functionCallId,this.toolConfirmation=e.toolConfirmation,this.resumeInputs=(n=e.resumeInputs)!=null?n:{},this.abortSignal=e.invocationContext.abortSignal}get state(){return this._state}get actions(){return this.eventActions}loadArtifact(e,n){if(!this.invocationContext.artifactService)throw new Error("Artifact service is not initialized.");return this.invocationContext.artifactService.loadArtifact({filename:e,version:n})}async saveArtifact(e,n){if(!this.invocationContext.artifactService)throw new Error("Artifact service is not initialized.");let o=await this.invocationContext.artifactService.saveArtifact({filename:e,artifact:n});return this.eventActions.artifactDelta[e]=o,o}requestCredential(e){if(!this.functionCallId)throw new Error("functionCallId is not set.");let n=new Ht(e);this.eventActions.requestedAuthConfigs[this.functionCallId]=n.generateAuthRequest()}getAuthResponse(e){return new Ht(e).getAuthResponse(this.state)}listArtifacts(){if(!this.invocationContext.artifactService)throw new Error("Artifact service is not initialized.");return this.invocationContext.artifactService.listArtifactKeys()}searchMemory(e){if(!this.invocationContext.memoryService)throw new Error("Memory service is not initialized.");return this.invocationContext.memoryService.searchMemory({appName:this.invocationContext.session.appName,userId:this.invocationContext.session.userId,query:e})}requestConfirmation({hint:e,payload:n}){if(!this.functionCallId)throw new Error("functionCallId is not set.");this.eventActions.requestedToolConfirmations[this.functionCallId]=new Rr({hint:e,confirmed:!1,payload:n})}};a(PC,"Context");var Le=PC;var je="adk_request_confirmation",qe="adk_request_credential",Me="adk_request_input",HY=new Set([je,qe,Me]);function NC(t){var e,n;for(let o of(e=t==null?void 0:t.parts)!=null?e:[]){let r=(n=o.functionCall)==null?void 0:n.name;if(r&&HY.has(r))return r}}a(NC,"reservedFunctionCallName");function du(t){var e,n;return(n=(e=t.agent)==null?void 0:e.name)!=null?n:""}a(du,"toolEventAuthor");var JY={handleFunctionCallList:kr,generateAuthEvent:Af,generateRequestConfirmationEvent:OC};function DC(t,e){let n=new Set;for(let o of t)o.name&&o.name in e&&e[o.name].isLongRunning&&o.id&&n.add(o.id);return n}a(DC,"getLongRunningFunctionCalls");function Af(t,e){var r,i,s;if(!((r=e.actions)!=null&&r.requestedAuthConfigs)||rt(e.actions.requestedAuthConfigs))return;let n=[],o=new Set;for(let[u,c]of Object.entries(e.actions.requestedAuthConfigs)){let l={name:qe,args:{function_call_id:u,auth_config:c},id:bt()};o.add(l.id),n.push({functionCall:l})}return J({invocationId:t.invocationId,author:du(t),branch:t.branch,content:{parts:n,role:(s=(i=e.content)==null?void 0:i.role)!=null?s:"user"},longRunningToolIds:Array.from(o)})}a(Af,"generateAuthEvent");function OC({invocationContext:t,functionCallEvent:e,functionResponseEvent:n}){var s,u,c,l;if(!((s=n.actions)!=null&&s.requestedToolConfirmations)||rt(n.actions.requestedToolConfirmations))return;let o=[],r=new Set,i=le(e);for(let[p,d]of Object.entries(n.actions.requestedToolConfirmations)){let g=(u=i.find(v=>v.id===p))!=null?u:void 0;if(!g)continue;let h={name:je,args:{originalFunctionCall:g,toolConfirmation:d},id:bt()};r.add(h.id),o.push({functionCall:h})}return J({invocationId:t.invocationId,author:du(t),branch:t.branch,content:{parts:o,role:(l=(c=n.content)==null?void 0:c.role)!=null?l:"user"},actions:n.actions,longRunningToolIds:Array.from(r)})}a(OC,"generateRequestConfirmationEvent");async function KY(t,e,n){return Ze.startActiveSpan(`execute_tool ${t.name}`,async o=>{try{N.debug(`callToolAsync ${t.name}`);let r=await t.runAsync({args:e,toolContext:n});return gP({tool:t,args:e,functionResponseEvent:SL(t,r,n,n.invocationContext)}),r}finally{o.end()}})}a(KY,"callToolAsync");function SL(t,e,n,o){let r;typeof e!="object"||e==null?r={result:e}:Array.isArray(e)?r={results:e}:r=e;let s={role:"user",parts:[{functionResponse:{name:t.name,response:r,id:n.functionCallId}}]};return J({invocationId:o.invocationId,author:du(o),content:s,actions:n.actions,branch:o.branch})}a(SL,"buildResponseEvent");async function fu({invocationContext:t,functionCallEvent:e,toolsDict:n,beforeToolCallbacks:o,afterToolCallbacks:r,filters:i,toolConfirmationDict:s,resumeInputsDict:u}){let c=le(e);return await kr({invocationContext:t,functionCalls:c,toolsDict:n,beforeToolCallbacks:o,afterToolCallbacks:r,filters:i,toolConfirmationDict:s,resumeInputsDict:u})}a(fu,"handleFunctionCallsAsync");function If(t){if(t!=null)return typeof t!="object"?{result:t}:Array.isArray(t)?{results:t}:t}a(If,"normalizeCallbackResponse");var WY="Possible causes:\n 1. The model hallucinated the name.\n 2. The tool is not registered on this agent, or a plugin filtered it out of this request.\n 3. The name does not match the registered tool's name exactly.\n 4. The tool is registered but never enters the toolsDict, because its `_getDeclaration()` returns undefined (as prompt-injecting tools like `ExampleTool` and `PreloadMemoryTool` do).",TL=Symbol.for("google.adk.toolNotFound");function jY(t){return typeof t=="object"&&t!==null&&t[TL]===!0}a(jY,"isToolNotFound");var xL,EL,MC=class MC extends(EL=se,xL=TL,EL){constructor(n,o){super({name:n,description:"Tool not found"});this.resolutionError=o;this[xL]=!0}async runAsync(){throw this.resolutionError}};a(MC,"ToolNotFoundPlaceholder");var $C=MC;async function YY({invocationContext:t,functionCall:e,toolsDict:n,toolContext:o}){return Ze.startActiveSpan(`execute_tool ${e.name||"<unnamed>"}`,async r=>{var i,s;try{let u=e.name||"<unnamed>",c=new Error(`Function ${u} is not found in the toolsDict.`),l=new $C(u,c),p=await t.pluginManager.runOnToolErrorCallback({tool:l,toolArgs:(i=e.args)!=null?i:{},toolContext:o,error:c});if(p==null){let d=Object.keys(n);N.warn(`Could not resolve tool '${u}' for function call '${(s=e.id)!=null?s:""}'. Callable tools: ${d.length?d.join(", "):"(none)"}.
82
+ `+WY)}return SL(l,p!=null?p:{error:c.message},o,t)}finally{r.end()}})}a(YY,"answerUnresolvableCall");async function kr({invocationContext:t,functionCalls:e,toolsDict:n,beforeToolCallbacks:o,afterToolCallbacks:r,filters:i,toolConfirmationDict:s,resumeInputsDict:u}){var d;let c=[],l=e.filter(g=>!i||g.id&&i.has(g.id));for(let g of l){let h;s&&g.id&&(h=s[g.id]);let v;u&&g.id&&(v=u[g.id]);let y=new Le({invocationContext:t,functionCallId:g.id||void 0,toolConfirmation:h,resumeInputs:v}),_=g.name&&Object.hasOwn(n,g.name)?n[g.name]:void 0;if(!_){c.push(await YY({invocationContext:t,functionCall:g,toolsDict:n,toolContext:y}));continue}N.debug(`execute_tool ${_.name}`);let x=(d=g.args)!=null?d:{},E=null,T;if(E=await t.pluginManager.runBeforeToolCallback({tool:_,toolArgs:x,toolContext:y}),E==null){for(let w of o)if(E=await w({tool:_,args:x,context:y}),E)break}if(E=If(E),E==null)try{E=await KY(_,x,y)}catch(w){if(w instanceof Error){let b=await t.pluginManager.runOnToolErrorCallback({tool:_,toolArgs:x,toolContext:y,error:w});b!=null?E=If(b):T=w.message}else T=w}let S=await t.pluginManager.runAfterToolCallback({tool:_,toolArgs:x,toolContext:y,result:E});if(S==null){for(let w of r)if(S=await w({tool:_,args:x,context:y,response:E}),S)break}if(S!=null&&(E=If(S)),_.isLongRunning&&E==null){vl(y.actions)||c.push(J({invocationId:t.invocationId,author:du(t),actions:y.actions,branch:t.branch}));continue}T?E={error:T}:E==null?E={result:E}:E=If(E);let I=J({invocationId:t.invocationId,author:du(t),content:uc({functionResponse:{id:y.functionCallId,name:_.name,response:E}}),actions:y.actions,branch:t.branch});N.debug("traceToolCall",{tool:_.name,args:x,functionResponseEvent:I.id}),c.push(I)}if(!c.length)return null;let p=XY(c);return c.length>1&&Ze.startActiveSpan("execute_tool (merged)",g=>{try{N.debug("execute_tool (merged)"),N.debug("traceMergedToolCalls",{responseEventId:p.id,functionResponseEvent:p.id}),hP({responseEventId:p.id,functionResponseEvent:p})}finally{g.end()}}),p}a(kr,"handleFunctionCallList");function XY(t){if(!t.length)throw new Error("No function response events provided.");if(t.length===1)return t[0];let e=[];for(let i of t)i.content&&i.content.parts&&e.push(...i.content.parts);let n=t[0],o=t.map(i=>i.actions||{}),r=rP(o);return J({invocationId:n.invocationId,author:n.author,branch:n.branch,content:{role:"user",parts:e},actions:r,timestamp:n.timestamp})}a(XY,"mergeParallelFunctionResponseEvents");function CL(t,e,n=t.length){for(let o=n-1;o>=0;o--){let r=t[o],i=le(r);for(let s of i)if(s.id===e)return r}}a(CL,"findEventByFunctionCallId");function IL(t){var i,s;if(!t.length)return{resolved:void 0,conflictingAuthors:void 0};let e=t[t.length-1],n=fe(e);if(!n.length)return{resolved:void 0,conflictingAuthors:void 0};let o,r;for(let u of n){if(!u.id)continue;let c=CL(t,u.id,t.length-1);c&&(!r&&o&&o.author!==c.author&&(r=[(i=o.author)!=null?i:"",(s=c.author)!=null?s:""]),o=c)}return{resolved:o,conflictingAuthors:r}}a(IL,"resolveFunctionResponseMatch");function LC(t){return IL(t).resolved}a(LC,"findMatchingFunctionCall");function AL(t){return IL(t).conflictingAuthors}a(AL,"getConflictingFunctionResponseAuthors");var wf=(i=>(i.API_KEY="apiKey",i.HTTP="http",i.OAUTH2="oauth2",i.OPEN_ID_CONNECT="openIdConnect",i.SERVICE_ACCOUNT="serviceAccount",i))(wf||{});function UC(t,e){if(typeof t!="object"||t===null)return;let n=t;return e in n?n[e]:n[e.replace(/[A-Z]/g,o=>`_${o.toLowerCase()}`)]}a(UC,"readField");function wL(t,e){let n=UC(t,e);return typeof n=="string"?n:void 0}a(wL,"readString");function QY(t,e){var u;let n=t.exchangedAuthCredential;if(!((u=n==null?void 0:n.oauth2)!=null&&u.authUri))return e;let o=UC(e,"oauth2"),r={},i=wL(o,"authResponseUri");i!==void 0&&(r.authResponseUri=i);let s=wL(o,"authCode");if(s!==void 0&&(r.authCode=s),!(i===void 0&&s===void 0))return{...n,oauth2:{...n.oauth2,...r}}}a(QY,"bindCredential");function bf(t,e){let{authScheme:n,credentialKey:o}=t;if(!n||!o)return;let r=UC(e,"exchangedAuthCredential");if(typeof r!="object"||r===null)return;let i=QY(t,r);if(i)return{authScheme:n,credentialKey:o,rawAuthCredential:t.rawAuthCredential,exchangedAuthCredential:i}}a(bf,"bindCredentialResponse");var bL="response_schema";function RL(t){var n,o;let e={interruptId:t.interruptId,payload:(n=t.payload)!=null?n:null,message:(o=t.message)!=null?o:null,[bL]:t.responseSchema?lC(t.responseSchema):null};return J({content:{role:"model",parts:[{functionCall:{name:Me,args:e,id:t.interruptId}}]},longRunningToolIds:[t.interruptId]})}a(RL,"createRequestInputEvent");function Rf(t){var n,o,r;let e=new Map;for(let i of t)for(let s of(o=(n=i.content)==null?void 0:n.parts)!=null?o:[]){let u=s.functionCall;if((u==null?void 0:u.name)!==Me||!u.id)continue;let c=(r=u.args)==null?void 0:r[bL];c&&e.set(u.id,c)}return e}a(Rf,"responseSchemasByInterruptId");function pu(t,e,n){if(typeof e!="object"||e===null)return;let o=cC(n);if(!o)return;let r=o.safeParse(e);if(r.success)return;let i=r.error.issues.map(s=>{let u=s.path.length?` at '${s.path.join(".")}'`:"";return`${s.message}${u}`}).join("; ");return`The reply to interrupt '${t}' does not match the responseSchema it declared: ${i}. A structured reply must either match that schema, or wrap a bare value as {result: <value>}; a plain-text reply is accepted as-is and is not checked. The interrupt is still waiting, so you can answer it again.`}a(pu,"interruptResponseMismatch");function FC(t,e){return new Ht(t).getAuthResponse(e)!==void 0}a(FC,"hasAuthCredential");function kL(t,e){let n=new Ht(t).generateAuthRequest(),o={functionCallId:e,authConfig:n,message:nX(t)};return J({content:{role:"model",parts:[{functionCall:{name:qe,id:e,args:o}}]},longRunningToolIds:[e]})}a(kL,"createAuthRequestEvent");async function PL({responseData:t,authConfig:e,state:n}){let o;if(eX(t)?o=bf(e,t):o={...e,exchangedAuthCredential:tX(e,t)},!o){N.warn(`Ignoring auth resume response for '${e.credentialKey}': it carries no credential for the request that was raised.`);return}await new Ht(o).parseAndStoreAuthResponse(n)}a(PL,"processAuthResume");function eX(t){return typeof t=="object"&&t!==null&&"authScheme"in t&&"credentialKey"in t}a(eX,"isAuthConfigLike");function tX(t,e){var n;return((n=t.rawAuthCredential)==null?void 0:n.authType)==="apiKey"?{authType:"apiKey",apiKey:String(e)}:e}a(tX,"buildCredentialFromValue");function nX(t){var n;let e=(n=t.rawAuthCredential)==null?void 0:n.authType;return e==="apiKey"?"Please provide your API key.":e==="oauth2"||e==="openIdConnect"?"Please complete the authentication flow.":"Please provide your authentication credentials."}a(nX,"buildAuthMessage");var zC=Symbol.for("google.adk.workflow.baseNode"),NL;NL=zC;var BC=class BC{constructor(e){this[NL]=!0;var n,o,r;if(!e.name||typeof e.name!="string"||e.name.trim().length===0)throw new Error("Node name must be a non-empty string.");this.name=e.name.trim(),this.description=(n=e.description)!=null?n:"",this.rerunOnResume=(o=e.rerunOnResume)!=null?o:!1,this.waitForOutput=(r=e.waitForOutput)!=null?r:!1,this.retryConfig=e.retryConfig,this.preparedRetryConfig=e.retryConfig?cs(e.retryConfig):void 0,this.timeout=e.timeout,this.inputSchema=e.inputSchema,this.outputSchema=e.outputSchema,this.stateSchema=e.stateSchema,this.isolationScope=e.isolationScope}get requiresAllPredecessors(){return!1}async*run(e,n){let o=this.validateInput(n);for await(let r of this.runImpl(e,o)){if(_f(r)){yield RL(r);continue}let i=this.toEvent(e,r);i&&(yield i)}}validateInput(e){if(Kn(e))return e;try{return su(this.inputSchema,e)}catch(n){throw new oo({nodeName:this.name,direction:"input",cause:n})}}validateOutput(e){if(Kn(e))return e;try{return su(this.outputSchema,e)}catch(n){throw new oo({nodeName:this.name,direction:"output",cause:n})}}toEvent(e,n){if(n==null)return null;if(xl(n)){let r=n;return r.output!==void 0&&(r.output=this.validateOutput(r.output)),r}let o=this.validateOutput(n);return J({author:this.name,invocationId:e.invocationContext.invocationId,branch:e.branch,content:gu(o),output:o})}};a(BC,"BaseNode");var Fe=BC;function mu(t){return typeof t=="object"&&t!==null&&zC in t&&t[zC]===!0}a(mu,"isBaseNode");function Kn(t){return typeof t=="object"&&t!==null&&"parts"in t&&Array.isArray(t.parts)}a(Kn,"isContent");var qC=class qC extends Fe{async*runImpl(){throw new Error("START node is never executed.")}};a(qC,"StartNode");var GC=qC,ln=new GC({name:"__START__"});function gu(t){if(t!=null){if(Kn(t))return t;try{return Dg(t)}catch(e){return Dg(rX(t))}}}a(gu,"toContent");function rX(t){var e;if(typeof t=="string")return t;try{return(e=JSON.stringify(t))!=null?e:String(t)}catch(n){return String(t)}}a(rX,"valueToText");var VC=Symbol.for("google.adk.baseAgent");function Wn(t){return typeof t=="object"&&t!==null&&VC in t&&t[VC]===!0}a(Wn,"isBaseAgent");var OL,LL,ZC=class ZC extends(LL=Fe,OL=VC,LL){constructor(n){super({...n,name:$L(n.name)});this[OL]=!0;this.config={...n},this.name=$L(n.name),this.parentAgent=n.parentAgent,this.subAgents=n.subAgents||[],this.beforeAgentCallback=DL(n.beforeAgentCallback),this.afterAgentCallback=DL(n.afterAgentCallback),this.setParentAgentForSubAgents()}get rootAgent(){return iX(this)}clone(n){if(n&&"parentAgent"in n)throw new Error("Cannot update `parentAgent` field in clone. Parent agent is set only when the parent agent is instantiated with the sub-agents.");let o={...this.config,...n};o.parentAgent=void 0;let r=o;for(let s of Object.keys(r)){if(s==="subAgents"||n&&s in n)continue;let u=r[s];Array.isArray(u)&&(r[s]=u.slice())}(!n||!("subAgents"in n))&&(o.subAgents=this.subAgents.map(s=>s.clone()));let i=this.constructor;return new i(o)}async*runAsync(n){let o=Ze.startSpan(`invoke_agent ${this.name}`),r=$e.setSpan(Ue.active(),o);try{yield*ur(r,this,async function*(){var c,l;let i=this.createInvocationContext(n),s=await this.handleBeforeAgentCallback(i);if(s&&(yield s),i.endInvocation||(c=n.abortSignal)!=null&&c.aborted)return;pP({agent:this,invocationContext:i});for await(let p of this.runAsyncImpl(i))yield p;if(i.endInvocation||(l=n.abortSignal)!=null&&l.aborted)return;let u=await this.handleAfterAgentCallback(i);u&&(yield u)})}finally{o.end()}}async*runImpl(n,o){yield*this.runAsync(n.getInvocationContext())}async*runLive(n){let o=Ze.startSpan(`invoke_agent ${this.name}`),r=$e.setSpan(Ue.active(),o);try{yield*ur(r,this,async function*(){var c,l;let i=this.createInvocationContext(n),s=await this.handleBeforeAgentCallback(i);if(s&&(yield s),i.endInvocation||(c=n.abortSignal)!=null&&c.aborted)return;for await(let p of this.runLiveImpl(i))yield p;if(i.endInvocation||(l=n.abortSignal)!=null&&l.aborted)return;let u=await this.handleAfterAgentCallback(i);u&&(yield u)})}finally{o.end()}}findAgent(n){return this.name===n?this:this.findSubAgent(n)}findSubAgent(n){for(let o of this.subAgents){let r=o.findAgent(n);if(r)return r}}createInvocationContext(n){return new Jt({...n,agent:this})}async handleBeforeAgentCallback(n){var r;if(this.beforeAgentCallback.length===0)return;let o=new Le({invocationContext:n});for(let i of this.beforeAgentCallback){let s=await i(o);if((r=n.abortSignal)!=null&&r.aborted)return;if(s)return n.endInvocation=!0,J({invocationId:n.invocationId,author:this.name,branch:n.branch,content:s,actions:o.eventActions})}if(o.state.hasDelta())return J({invocationId:n.invocationId,author:this.name,branch:n.branch,actions:o.eventActions})}async handleAfterAgentCallback(n){var r;if(this.afterAgentCallback.length===0)return;let o=new Le({invocationContext:n});for(let i of this.afterAgentCallback){let s=await i(o);if((r=n.abortSignal)!=null&&r.aborted)return;if(s)return J({invocationId:n.invocationId,author:this.name,branch:n.branch,content:s,actions:o.eventActions})}if(o.state.hasDelta())return J({invocationId:n.invocationId,author:this.name,branch:n.branch,actions:o.eventActions})}setParentAgentForSubAgents(){for(let n of this.subAgents){if(n.parentAgent)throw new Error(`Agent "${n.name}" already has a parent agent, current parent: "${n.parentAgent.name}", trying to add: "${this.name}"`);n.parentAgent=this}}};a(ZC,"BaseAgent");var $t=ZC;function $L(t){if(!oX(t))throw new Error(`Found invalid agent name: "${t}". Agent name must be a valid identifier. It should start with a letter (a-z, A-Z) or an underscore (_), and can only contain letters, digits (0-9), underscores, and hyphens.`);if(t==="user")throw new Error("Agent name cannot be 'user'. 'user' is reserved for end-user's input.");return t}a($L,"validateAgentName");function oX(t){return/^[\p{ID_Start}$_][\p{ID_Continue}$_-]*$/u.test(t)}a(oX,"isIdentifier");function iX(t){for(;t.parentAgent;)t=t.parentAgent;return t}a(iX,"getRootAgent");function DL(t){return t?Array.isArray(t)?t:[t]:[]}a(DL,"getCannonicalCallback");var JC=class JC{constructor(){this.queue=[];this.resolveFnFifoQueue=[];this.isClosed=!1}send(e){if(this.isClosed)throw new Error("Cannot send to a closed queue.");this.resolveFnFifoQueue.length>0?this.resolveFnFifoQueue.shift()(e):this.queue.push(e)}async get(e){if(this.queue.length>0)return this.queue.shift();if(this.isClosed)return{close:!0};if(e!=null&&e.aborted)throw new Error("LiveRequestQueue.get() was aborted.");return new Promise((n,o)=>{let r=a(()=>{let s=this.resolveFnFifoQueue.indexOf(i);s!==-1&&this.resolveFnFifoQueue.splice(s,1),o(new Error("LiveRequestQueue.get() was aborted."))},"onAbort"),i=a(s=>{e==null||e.removeEventListener("abort",r),n(s)},"resolveFn");this.resolveFnFifoQueue.push(i),e==null||e.addEventListener("abort",r,{once:!0})})}close(){if(this.isClosed)return;for(this.isClosed=!0;this.resolveFnFifoQueue.length>0&&this.queue.length>0;){let n=this.resolveFnFifoQueue.shift(),o=this.queue.shift();n(o)}let e={close:!0};for(;this.resolveFnFifoQueue.length>0;)this.resolveFnFifoQueue.shift()(e)}sendContent(e){this.send({content:e})}sendRealtime(e){this.send({blob:e})}sendActivityStart(){this.send({activityStart:{}})}sendActivityEnd(){this.send({activityEnd:{}})}async*[Symbol.asyncIterator](){for(;;){let e=await this.get();if(yield e,e.close)break}}};a(JC,"LiveRequestQueue");var HC=JC;function Ve(t,e){t.config||(t.config={});let n=e.join(`
83
+
84
+ `);t.config.systemInstruction?t.config.systemInstruction+=`
85
+
86
+ `+n:t.config.systemInstruction=n}a(Ve,"appendInstructions");function ML(t,e){t.config||(t.config={}),t.config.responseSchema=e,t.config.responseMimeType="application/json"}a(ML,"setOutputSchema");var vu="finish_task",kf="Task completed.",sX={type:j.OBJECT,properties:{result:{type:j.STRING,description:"A brief summary of what the agent accomplished."}},required:["result"]},KC=class KC extends se{constructor(e){let n=e!=null?e:sX,o="Signal that this agent has completed its delegated task. Call this when you have finished your delegated task.";e&&(o+=" Pass the required output data in the parameters."),super({name:vu,description:o}),this.outputSchema=n,this.wrapperKey=n.type===j.OBJECT?void 0:"result"}_getDeclaration(){let e=this.wrapperKey?{type:j.OBJECT,properties:{[this.wrapperKey]:this.outputSchema},required:[this.wrapperKey]}:this.outputSchema;return{name:this.name,description:this.description,parameters:e}}async processLlmRequest(e){await super.processLlmRequest(e),Ve(e.llmRequest,["Do NOT call `finish_task` prematurely. Use your available tools to fully complete every aspect of the task first. If the task is unclear, ask the user for clarification before proceeding. Once the task is fully complete, call `finish_task` by itself with no accompanying text output."])}extractOutput(e){return this.wrapperKey?e[this.wrapperKey]:e}async runAsync({args:e}){let n=this.wrapperKey?e[this.wrapperKey]:e,o=this.missingRequiredKeys(n);return o.length>0?{error:`Invoking \`${this.name}()\` failed due to missing required parameters: ${o.join(", ")}. You could retry calling this tool, but it is IMPORTANT for you to provide all the mandatory parameters with correct types.`}:kf}missingRequiredKeys(e){var r;let n=this.wrapperKey?e==null?[this.wrapperKey]:[]:(r=this.outputSchema.required)!=null?r:[];if(this.wrapperKey||typeof e!="object"||e===null)return n;let o=e;return n.filter(i=>o[i]===void 0)}};a(KC,"FinishTaskTool");var hu=KC;function aX(t){return t===void 0?{type:j.OBJECT,properties:{}}:Tn(t)?br(t):t}a(aX,"toSchema");var WC=Symbol.for("google.adk.functionTool");function uX(t){return typeof t=="object"&&t!==null&&WC in t&&t[WC]===!0}a(uX,"isFunctionTool");var UL,FL,jC=class jC extends(FL=se,UL=WC,FL){constructor(n){var r,i;let o=(r=n.name)!=null?r:n.execute.name;if(!o)throw new Error("Tool name cannot be empty. Either name the `execute` function or provide a `name`.");super({name:o,description:n.description,isLongRunning:n.isLongRunning});this[UL]=!0;this.execute=n.execute,this.parameters=n.parameters,this.requireConfirmation=(i=n.requireConfirmation)!=null?i:!1}_getDeclaration(){return{name:this.name,description:this.description,parameters:aX(this.parameters)}}async runAsync(n){try{let o=this.validateArgs(n.args),r=await this.checkConfirmation(o,n.toolContext);return r!==void 0?r:await this.execute(o,n.toolContext)}catch(o){let r=o instanceof Error?o.message:String(o);throw new Error(`Error in tool '${this.name}': ${r}`)}}async checkRequireConfirmation(n,o){return typeof this.requireConfirmation!="function"?this.requireConfirmation:this.requireConfirmation(this.validateArgs(n),o)}validateArgs(n){return Tn(this.parameters)?this.parameters.parse(n):n}async evaluateRequireConfirmation(n,o){return typeof this.requireConfirmation=="function"?this.requireConfirmation(n,o):this.requireConfirmation}async checkConfirmation(n,o){if(await this.evaluateRequireConfirmation(n,o)){if(!o)throw new Error(`Tool '${this.name}' requires confirmation but no tool context was provided.`);if(!o.toolConfirmation)return o.requestConfirmation({hint:`Please approve or reject the tool call ${this.name}() by responding with a FunctionResponse with an expected ToolConfirmation payload.`}),o.actions.skipSummarization=!0,{error:"This tool call requires confirmation, please approve or reject."};if(!o.toolConfirmation.confirmed)return{error:"This tool call is rejected."}}}};a(jC,"FunctionTool");var Dt=jC;var YC=class YC{constructor(){this.queue=[];this.resolvers=[];this.closed=!1}get isClosed(){return this.closed}get size(){return this.queue.length}push(e){if(this.closed)return;let n=this.resolvers.shift();n?n.resolve({value:e,done:!1}):this.queue.push(e)}fail(e){if(!this.failure)for(this.failure={error:e},this.closed=!0;this.resolvers.length>0;)this.resolvers.shift().reject(e)}error(e){this.fail(e)}close(){if(!this.closed)for(this.closed=!0;this.resolvers.length>0;)this.resolvers.shift().resolve({value:void 0,done:!0})}[Symbol.asyncIterator](){return{next:a(()=>this.queue.length>0?Promise.resolve({value:this.queue.shift(),done:!1}):this.failure?Promise.reject(this.failure.error):this.closed?Promise.resolve({value:void 0,done:!0}):new Promise((e,n)=>{this.resolvers.push({resolve:e,reject:n})}),"next")}}};a(YC,"AsyncQueue");var cn=YC;var lX="... [truncated]",zL="Unknown error";function XC(t){return t!==null&&typeof t=="object"?t:void 0}a(XC,"asRecord");function GL(...t){for(let e of t)if(typeof e=="string")return e}a(GL,"firstString");function cX(t){return t.length>1e3?t.slice(0,1e3)+lX:t}a(cX,"truncateBody");function BL(t){return t instanceof Error?t.message:typeof t=="string"?t:String(t)}a(BL,"baseMessage");function dX(t){var c,l;let e=XC(t);if(e===void 0)return;let n=XC(e.response),o=(l=(c=e.status)!=null?c:e.code)!=null?l:n==null?void 0:n.status,r=typeof o=="number"&&o>=100&&o<=599?o:void 0,i=GL(e.statusText,n==null?void 0:n.statusText),s=GL(n==null?void 0:n.data,n==null?void 0:n.body,n==null?void 0:n.text);if(r===void 0&&s===void 0)return;let u=r===void 0?"HTTP error":`HTTP ${r}${i===void 0?"":` ${i}`}`;return s===void 0?u:`${u}: ${cX(s)}`}a(dX,"extractHttpDetails");function QC(t,e){var u;if(t==null)return zL;if(typeof t=="object"){if(e.has(t))return BL(t);e.add(t)}if(t instanceof AggregateError&&t.errors.length>0)return t.errors.map(c=>QC(c,e)).join(" | ");let n=dX(t),o=BL(t),r=(u=XC(t))==null?void 0:u.cause,i=r!==void 0?QC(r,e):void 0,s=o.length>0?o:zL;return n!==void 0&&(s=`${s} (${n})`),i!==void 0&&n===void 0&&!s.includes(i)&&(s=`${s}: ${i}`),s}a(QC,"formatErrorRecursive");function eI(t){return QC(t,new Set)}a(eI,"formatError");var Pf=class Pf{constructor(e){this.segments=[...e]}toString(){return this.segments.join(".")}getSegments(){return[...this.segments]}isDescendantOf(e){return this.segments.length<=e.segments.length?!1:e.segments.every((n,o)=>this.segments[o]===n)}append(e,n){let o=n!==void 0?`${e}@${n}`:e;return new Pf([...this.segments,o])}};a(Pf,"BranchPath");var Pr=Pf;function qL(t){return t?new Pr(t.split(".")):new Pr([])}a(qL,"branchPathFromString");function fX(t){if(t.length===0)return new Pr([]);let e=t.map(r=>r.getSegments()),n=[],o=Math.min(...e.map(r=>r.length));for(let r=0;r<o;r++){let i=e[0][r];if(e.every(s=>s[r]===i))n.push(i);else break}return new Pr(n)}a(fX,"commonPrefixOfPaths");function Nf(t,e){return qL(t).append(e.name,e.runId).toString()}a(Nf,"createSubBranch");function $f(t){return fX(t.map(e=>qL(e))).toString()}a($f,"commonPrefixOf");var pX=5,mX=1,gX=60,hX=2,vX=1;function VL(t){var e;if(t instanceof Error){let n=[(e=t.constructor)==null?void 0:e.name,t.name].filter(o=>!!o);return[...new Set(n)]}return typeof t=="object"&&t!==null?[t.constructor.name]:[typeof t]}a(VL,"errorNames");function ZL(t){let[e,n]=VL(t);return e==="Error"&&n?n:e}a(ZL,"errorName");function HL({error:t,retryConfig:e,nodeState:n}){var s;let o=n.attemptCount,r=(s=e.maxAttempts)!=null?s:pX;if(o>=r)return!1;let i=e.exceptions;return!(i!==void 0&&!VL(t).some(u=>i.includes(u)))}a(HL,"shouldRetryNode");function JL({retryConfig:t,nodeState:e,randomFn:n=Math.random}){var p,d,g,h;let o=(p=t.initialDelay)!=null?p:mX,r=(d=t.maxDelay)!=null?d:gX,i=(g=t.backoffFactor)!=null?g:hX,s=(h=t.jitter)!=null?h:vX,u=e.attemptCount||1,c=Math.max(0,u-1),l=o*Math.pow(i,c);if(s>0){l=Math.min(l,r/(1+s));let v=s*l,y=-v+n()*(2*v);l=Math.max(0,l+y)}return Math.min(l,r)}a(JL,"getRetryDelaySeconds");function Df(t){return"isNodeError"in t&&t.isNodeError===!0}a(Df,"isNodeErrorEvent");var KL=new WeakMap;function Of(t,e){return typeof t!="object"||t===null?!0:KL.get(t)===e?!1:(KL.set(t,e),!0)}a(Of,"claimNodeErrorReport");function Lf(t){var r,i;let{error:e,attemptCount:n,...o}=t;return{...J(o),isNodeError:!0,errorType:ZL(e),errorCode:(r=o.errorCode)!=null?r:yX(e),errorMessage:(i=o.errorMessage)!=null?i:_X(e),attemptCount:n!=null?n:1}}a(Lf,"createNodeErrorEvent");function yX(t){let e=t==null?void 0:t.code;return typeof e=="string"||typeof e=="number"?String(e):"UNKNOWN_ERROR"}a(yX,"errorCodeOf");function _X(t){return t instanceof Error?t.message:String(t)}a(_X,"errorMessageOf");var so=(u=>(u[u.INACTIVE=0]="INACTIVE",u[u.PENDING=1]="PENDING",u[u.RUNNING=2]="RUNNING",u[u.COMPLETED=3]="COMPLETED",u[u.WAITING=4]="WAITING",u[u.FAILED=5]="FAILED",u[u.CANCELLED=6]="CANCELLED",u))(so||{});function jn(t){return{status:0,attemptCount:1,interrupts:[],resumeInputs:{},runCounter:0,...t}}a(jn,"createNodeState");function WL(t){return typeof t=="object"&&t!==null&&"status"in t&&typeof t.status=="number"&&"attemptCount"in t&&"interrupts"in t&&Array.isArray(t.interrupts)}a(WL,"isNodeState");function Nr(t){var u,c;let{parent:e,node:n,options:o={}}=t,r=(u=o.nodeName)!=null?u:n.name,i=(c=o.overrideNodePath)!=null?c:e.nodePath?`${e.nodePath}.${r}`:r,s=Ze.startSpan(`execute_node ${r}`);return Ue.with($e.setSpan(Ue.active(),s),()=>xX({params:t,nodeName:r,nodePath:i,span:s}))}a(Nr,"executeChildNode");async function xX({params:{parent:t,node:e,input:n,options:o={},abortSignal:r,nodeState:i,resumeInputs:s},nodeName:u,nodePath:c,span:l}){var T,S,I,w;let p=(T=o.runId)!=null?T:u,d=t.branch;o.overrideBranch!==void 0?d=o.overrideBranch:o.useSubBranch&&(d=Nf(t.branch,{name:u,runId:o.runId}));let g=e.isolationScope===!0?`${c}@${p}`:e.isolationScope,h=(I=(S=o.overrideIsolationScope)!=null?S:g)!=null?I:t.isolationScope,v=r!=null?r:t.invocationContext.abortSignal,y=d===t.invocationContext.branch&&v===t.invocationContext.abortSignal&&h===t.invocationContext.isolationScope?t.invocationContext:new Jt({...t.invocationContext,branch:d,abortSignal:v,isolationScope:h}),_=new Cn({invocationContext:y,channel:t.channel,nodePath:c,runId:p,resumeInputs:s!=null?s:t.resumeInputs,isolationScope:h,stateSchema:(w=e.stateSchema)!=null?w:t.stateSchema});_.scheduler=t.scheduler,o.useAsOutput&&(_.outputForAncestors=[t.nodePath,...t.outputForAncestors].filter(b=>b!==""));let x=i!=null?i:jn({status:2,input:n,runId:p}),E=_.invocationContext.pluginManager;try{if(E!=null&&E.hasPlugins){let k=await E.runBeforeNodeCallback({node:e,nodeContext:_,input:n});if(k!==void 0)return _.output=k,Wo({nodePath:c,runId:p,attempt:x.attemptCount,status:"completed",interruptCount:_.interruptIds.length}),o.useAsOutput&&(t.output=_.output,t.route=_.route),_}let b=!1,B=!1;for(;!b;){TX(_),_.attemptCount=x.attemptCount;try{B=await EX({node:e,child:_,input:n,nodeName:u,branch:d,isolationScope:h,nodePath:c,runId:p,attempt:x.attemptCount}),SX(_,u),b=!0}catch(k){if(ls(k)){b=!0;break}if(vf(k)||hf(k))throw k;let V=e.preparedRetryConfig;if(!V||!HL({error:k,retryConfig:V,nodeState:x}))throw k;let ce=JL({retryConfig:V,nodeState:x});x.attemptCount+=1,await IX(ce*1e3,v)}}if(!B&&_.interruptIds.length>0&&CX({child:_,nodeName:u,branch:d,isolationScope:h,input:n}),Wo({nodePath:c,runId:p,attempt:x.attemptCount,status:_.interruptIds.length>0?"waiting":"completed",interruptCount:_.interruptIds.length}),E!=null&&E.hasPlugins){let k=await E.runAfterNodeCallback({node:e,nodeContext:_,output:_.output});k!==void 0&&(_.output=k)}return o.useAsOutput&&(t.output=_.output,t.route=_.route,t.outputDelegated=!0),_}catch(b){throw Wo({nodePath:c,runId:p,attempt:x.attemptCount,status:"failed",interruptCount:_.interruptIds.length}),l.setStatus({code:$o.ERROR,message:eI(b)}),b}finally{l.end()}}a(xX,"runChildNode");function EX(t){let{node:e,nodePath:n,runId:o,attempt:r}=t;return e.preparedRetryConfig?Ze.startActiveSpan(`execute_node_attempt ${t.nodeName}`,async i=>{try{let s=await jL(t);return Wo({nodePath:n,runId:o,attempt:r,status:t.child.interruptIds.length>0?"waiting":"completed",interruptCount:t.child.interruptIds.length}),s}catch(s){throw Wo({nodePath:n,runId:o,attempt:r,status:"failed",interruptCount:t.child.interruptIds.length}),i.setStatus({code:$o.ERROR,message:eI(s)}),s}finally{i.end()}}):jL(t)}a(EX,"runAttempt");function SX(t,e){let n=t.reportedError;if(!n||t.output!==void 0||t.route!==void 0||t.interruptIds.length>0)return;let o=new as({nodeName:e,...n});throw Of(o,t.invocationId),o}a(SX,"failIfNodeReportedError");function TX(t){t.output=void 0,t.route=void 0,t.interruptIds=[],t.reportedError=void 0;for(let e of Object.keys(t.actions.stateDelta))delete t.actions.stateDelta[e]}a(TX,"resetState");async function jL({node:t,child:e,input:n,nodeName:o,branch:r,isolationScope:i}){var x;let s=!1,u=a(E=>{var S,I,w;YL({event:E,child:e,nodeName:o,branch:r,isolationScope:i});let T=(S=E.actions)==null?void 0:S.stateDelta;if(T&&T!==e.actions.stateDelta&&e.state.validateDelta(T),E.output!==void 0&&(e.output=E.output,e.outputDelegated)){let b=(I=E.actions)==null?void 0:I.stateDelta;if(!b||Object.keys(b).length===0)return;E.output=void 0,E.content=void 0}if(E.route!==void 0&&(e.route=E.route),E.errorCode!==void 0&&!Df(E)&&(e.reportedError={errorCode:E.errorCode,errorMessage:E.errorMessage}),E.longRunningToolIds&&E.longRunningToolIds.length>0){for(let b of E.longRunningToolIds)e.interruptIds.includes(b)||e.interruptIds.push(b);E.actions.agentState={...(w=E.actions.agentState)!=null?w:{},input:n},s=!0}e.channel.push(E)},"consume"),c=e.invocationContext.abortSignal,l=typeof t.timeout=="number"&&t.timeout>0;if(!l&&!c){for await(let E of t.run(e,n))u(E);return s}if(!l){e.abortSignal=c;try{for await(let E of t.run(e,n))u(E)}finally{e.abortSignal=void 0}return s}let p=t.timeout,d=new AbortController,g=a(()=>d.abort(),"onParentAbort");c!=null&&c.aborted?d.abort():c==null||c.addEventListener("abort",g,{once:!0});let h=!1,v=setTimeout(()=>{h=!0,d.abort()},(p!=null?p:0)*1e3);e.abortSignal=d.signal;let y=new Promise((E,T)=>{let S=a(()=>T(h?new ss({nodeName:o,timeout:p!=null?p:0}):new us(`Invocation aborted while running node '${o}'.`)),"fail");d.signal.aborted?S():d.signal.addEventListener("abort",S,{once:!0})}),_=t.run(e,n)[Symbol.asyncIterator]();try{let E=await Promise.race([_.next(),y]);for(;!E.done;)u(E.value),E=await Promise.race([_.next(),y])}finally{clearTimeout(v),c==null||c.removeEventListener("abort",g),e.abortSignal=void 0,Promise.resolve((x=_.return)==null?void 0:x.call(_,void 0)).catch(()=>{})}return s}a(jL,"runOnce");function CX({child:t,nodeName:e,branch:n,isolationScope:o,input:r}){let i=J({author:e,invocationId:t.invocationId,branch:n,longRunningToolIds:[...t.interruptIds],actions:{agentState:{input:r}}});YL({event:i,child:t,nodeName:e,branch:n,isolationScope:o}),t.channel.push(i)}a(CX,"recordInputForResume");function YL({event:t,child:e,nodeName:n,branch:o,isolationScope:r}){var i;t.author||(t.author=n),t.invocationId||(t.invocationId=e.invocationId),t.nodeInfo={...(i=t.nodeInfo)!=null?i:{},path:e.nodePath},t.output!==void 0&&(t.nodeInfo.outputFor=[e.nodePath,...e.outputForAncestors]),o!==void 0&&t.branch===void 0&&(t.branch=o),r!==void 0&&t.isolationScope===void 0&&(t.isolationScope=r)}a(YL,"enrichEvent");function IX(t,e){return new Promise((n,o)=>{if(e!=null&&e.aborted){o(new us("Invocation aborted during retry."));return}let r=setTimeout(()=>{e==null||e.removeEventListener("abort",i),n()},t),i=a(()=>{clearTimeout(r),o(new us("Invocation aborted during retry."))},"onAbort");e==null||e.addEventListener("abort",i,{once:!0})})}a(IX,"delay");var tI=class tI extends Fe{constructor(n,o,r={}){if(typeof o!="function")throw new TypeError("FunctionNode handler must be a function.");super({...r,name:n});this.attachedStateByCtx=new WeakMap;this.handler=o,this.authConfig=r.authConfig}async*runImpl(n,o){if(this.authConfig){let i=await this.runAuthGate(n);if(i){yield i;return}}let r=this.handler(n,o);if(AX(r))for await(let i of r)yield i;else if(wX(r))for(let i of r)yield i;else yield await r;yield void 0}async runAuthGate(n){let o=this.authConfig;if(FC(o,n.state))return;let r=n.resumeInputs[o.credentialKey];if(!(r!==void 0&&(await PL({responseData:r,authConfig:o,state:n.state}),FC(o,n.state))))return kL(o,o.credentialKey)}pendingStateDelta(n){let o=this.attachedStateByCtx.get(n);o||(o=new Map,this.attachedStateByCtx.set(n,o));let r={};for(let[i,s]of Object.entries(n.actions.stateDelta))(!o.has(i)||o.get(i)!==s)&&(r[i]=s,o.set(i,s),nP(n.actions.stateDelta,r,i));return Object.keys(r).length>0?r:void 0}applyEmittedState(n,o){if(!o||Object.keys(o).length===0)return;n.state.update(o);let r=this.attachedStateByCtx.get(n);if(r)for(let[i,s]of Object.entries(o))r.set(i,s)}toEvent(n,o){let r=this.pendingStateDelta(n);if(o==null)return r?J({author:this.name,invocationId:n.invocationId,branch:n.branch,actions:{stateDelta:r}}):null;if(xl(o)){let s=o;return s.output!==void 0&&(s.output=this.validateOutput(s.output)),r&&(s.actions.stateDelta={...r,...s.actions.stateDelta}),this.applyEmittedState(n,s.actions.stateDelta),s}if(Kn(o))return J({author:this.name,invocationId:n.invocationId,branch:n.branch,content:o,actions:r?{stateDelta:r}:void 0});let i=this.validateOutput(o);return J({author:this.name,invocationId:n.invocationId,branch:n.branch,content:gu(i),output:i,actions:r?{stateDelta:r}:void 0})}};a(tI,"FunctionNode");var fs=tI;function AX(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(AX,"isAsyncIterable");function wX(t){return t!=null&&typeof t[Symbol.iterator]=="function"&&typeof t.next=="function"}a(wX,"isSyncGenerator");var bX=8,nI=class nI extends Fe{constructor(e,n={}){let o=Kt(e);if(super({name:o.name,rerunOnResume:!0}),n.maxParallelWorkers!==void 0&&n.maxParallelWorkers<1)throw new Error("maxParallelWorkers must be greater than or equal to 1.");this.inner=o,this.maxParallelWorkers=n.maxParallelWorkers}async*runImpl(e,n){var h;let o=Array.isArray(n)?n:[n];if(o.length===0){yield[];return}let r=new Array(o.length),i=Math.min((h=this.maxParallelWorkers)!=null?h:bX,o.length),s=0,u=!1,c,l=!1,p=[],d=a(()=>{var v,y;return((v=e.abortSignal)==null?void 0:v.aborted)===!0||((y=e.invocationContext.abortSignal)==null?void 0:y.aborted)===!0},"isAborted"),g=a(async()=>{for(;!u&&!l&&!d();){let v=s++;if(v>=o.length)break;try{let y=await e.runNode(this.inner,o[v],{useSubBranch:!0,runId:String(v),overrideNodePath:`${e.nodePath}.${this.inner.name}@${v}`});if(y.interruptIds.length>0){l=!0;for(let _ of y.interruptIds)p.includes(_)||p.push(_);break}r[v]=y.output}catch(y){if(ls(y)){l=!0;break}u||(u=!0,c=y);break}}},"worker");if(await Promise.all(Array.from({length:i},()=>g())),u)throw c;if(l){for(let v of p)e.interruptIds.includes(v)||e.interruptIds.push(v);return}d()||(yield r)}};a(nI,"ParallelWorker");var ps=nI;var rI=class rI extends Fe{constructor(e,n={}){var o;if(super({...n,name:(o=n.name)!=null?o:e.name}),e.isLongRunning)throw new Error(`ToolNode does not support long-running tools yet (tool '${e.name}').`);this.tool=e}async*runImpl(e,n){let o=this.validateInput(RX(n)),r={name:this.tool.name,args:o,id:`${e.nodePath}:${e.runId}`},i=await kr({invocationContext:e.invocationContext,functionCalls:[r],toolsDict:{[this.tool.name]:this.tool},beforeToolCallbacks:[],afterToolCallbacks:[]});if(!i)return;i.author=this.name;let s=fe(i);s.length>0&&(i.output=s[0].response),yield i}};a(rI,"ToolNode");var ms=rI;function RX(t){let e=t;if(Kn(e)&&(e=kX(e)),typeof e=="string"){let n=e.trim();if(!n)e=null;else try{e=JSON.parse(n)}catch(o){}}if(e==null)return{};if(typeof e!="object"||Array.isArray(e))throw new TypeError(`The input to ToolNode must be an object of tool arguments or null, but got ${typeof e}.`);return e}a(RX,"coerceToolArgs");function kX(t){var e;return((e=t.parts)!=null?e:[]).map(n=>{var o;return(o=n.text)!=null?o:""}).join("")}a(kX,"extractText");var PX={match:a(t=>typeof t=="function","match"),build:a((t,e)=>{var r;let n=t,o=(r=e.name)!=null?r:n.name;if(!o)throw new Error("node(): the wrapped function has no name; pass {name} explicitly.");return new fs(o,n,e)},"build")},NX={match:a(t=>uu(t),"match"),build:a((t,e)=>new ms(t,e),"build")},oI=[PX,NX],iI=a((t,e)=>new ps(t,e),"PARALLEL_WORKER_FACTORY");function Mf(t){if(typeof t!="object"||t===null||Array.isArray(t))return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}a(Mf,"isPlainObject");function yu(t){return t==="START"||mu(t)||oI.some(e=>e.match(t))}a(yu,"isNodeLike");function Kt(t,e={}){if(e.maxParallelWorkers!==void 0&&!e.parallelWorker)throw new Error("maxParallelWorkers can only be set when parallelWorker is true.");let n=$X(t,e);if(e.parallelWorker){if(t==="START")throw new Error("ParallelWorker cannot wrap a START node.");if(!iI)throw new Error("parallelWorker was requested but no ParallelWorker is available; the parallel worker node module is not part of this build.");return iI(n,{maxParallelWorkers:e.maxParallelWorkers})}return n}a(Kt,"buildNode");function $X(t,e){if(t==="START")return ln;if(mu(t))return LX(t,e);for(let n of oI)if(n.match(t))return n.build(t,e);throw new Error(`build_node: unsupported node-like value of type ${typeof t}. Import the node module that handles it (e.g. via the workflow barrel).`)}a($X,"buildInnerNode");var DX=["name","description","rerunOnResume","retryConfig","timeout","inputSchema","outputSchema","stateSchema","isolationScope"],OX=["authConfig"];function LX(t,e){let n={};for(let r of DX)e[r]!==void 0&&(n[r]=e[r]);for(let r of OX)e[r]!==void 0&&r in t&&(n[r]=e[r]);if(Object.keys(n).length===0)return t;if(typeof n.name=="string"){let r=n.name.trim();if(!r)throw new Error("Node name must be a non-empty string.");n.name=r}let o=Object.create(Object.getPrototypeOf(t));return Object.assign(o,t,n),"retryConfig"in n&&Object.assign(o,{preparedRetryConfig:e.retryConfig?cs(e.retryConfig):void 0}),o}a(LX,"cloneWithOverrides");var sI=class sI{constructor(e){this.outputForAncestors=[];this.outputDelegated=!1;this.output=void 0;this.interruptIds=[];this.attemptCount=1;this.dynamicRunCounters=new Map;this.autoRunIds=new Map;this.numericCustomRunIds=new Map;var n,o;this.invocationContext=e.invocationContext,this.channel=e.channel,this.nodePath=e.nodePath,this.runId=e.runId,this.resumeInputs=(n=e.resumeInputs)!=null?n:{},this.isolationScope=e.isolationScope,this.actions=(o=e.actions)!=null?o:Ft(),this.stateSchema=e.stateSchema,this._state=new me(e.invocationContext.session.state,this.actions.stateDelta,e.stateSchema)}get state(){return this._state}get branch(){return this.invocationContext.branch}get invocationId(){return this.invocationContext.invocationId}get session(){return this.invocationContext.session}getInvocationContext(){return this.invocationContext}emit(e){this.channel.push(e)}runNode(e,n,o){var i,s;let r=Kt(e);if(this.scheduler){let u=(i=o==null?void 0:o.nodeName)!=null?i:r.name,c=o==null?void 0:o.runId;if(c!==void 0&&(MX(c,u,Uf(this.autoRunIds,u)),XL(c)&&Uf(this.numericCustomRunIds,u).add(c)),!c){UX(u,Uf(this.numericCustomRunIds,u));let l=((s=this.dynamicRunCounters.get(u))!=null?s:0)+1;this.dynamicRunCounters.set(u,l),c=String(l),Uf(this.autoRunIds,u).add(c)}return this.scheduleAndUnwind(r,n,{...o,nodeName:u,runId:c})}return Nr({parent:this,node:r,input:n,options:o})}async scheduleAndUnwind(e,n,o){let r=await this.scheduler.schedule(this,e,n,o);if(r.interruptIds.length>0)throw new uf;return r}};a(sI,"NodeContext");var Cn=sI;function Uf(t,e){let n=t.get(e);return n||(n=new Set,t.set(e,n)),n}a(Uf,"mapSet");function XL(t){return/^\d+$/.test(t)}a(XL,"isAutoNumberShaped");function QL(t,e){return new Error(`Invalid runId '${e}' for node '${t}': ADK numbers automatic runs of a node "1", "2", "3", \u2026 per context, so an all-digit custom id draws from that same namespace. A later turn that issues a different set of custom ids shifts the automatic sequence onto a checkpoint path an earlier call already wrote, and the call is fast-forwarded to that run's cached output with its own input silently discarded. Give the custom id a non-numeric part, e.g. '${t}-${e}', or supply an explicit id for every run of this node so ADK never numbers one.`)}a(QL,"numericRunIdMixError");function MX(t,e,n){if(t.trim()==="")throw new Error(`Invalid runId for node '${e}': a custom run id cannot be empty. Omit runId to let ADK number the run automatically.`);if(n.size>0&&XL(t))throw QL(e,t)}a(MX,"assertCustomRunId");function UX(t,e){let n=e.values().next();if(!n.done)throw QL(t,n.value)}a(UX,"assertNoNumericCustomRunIds");var aI=Symbol.for("google.adk.workflow.nodeTool"),eM=8,tM,nM,uI=class uI extends(nM=se,tM=aI,nM){constructor(n,o,r){if(!n.inputSchema)throw new Error(`Node '${n.name}' does not have an inputSchema defined. NodeTool requires an explicit input schema on the wrapped node.`);super({name:o!=null?o:n.name,description:r||n.description||`Executes the node: ${n.name}`,isLongRunning:!0});this[tM]=!0;this.node=n}_getDeclaration(){let n=this.node.inputSchema,o;return n&&Tn(n)?o=br(n):o={type:j.OBJECT,properties:{request:{type:j.STRING}},required:["request"]},{name:this.name,description:this.description,parameters:o}}get inputIsObject(){return Tn(this.node.inputSchema)}async runAsync({args:n,toolContext:o}){let r=this.inputIsObject?n:n.request,i=await this.runNode(o,r);if(!(i.interruptIds.length>0))return i.output===void 0?{result:null}:i.output}async runNode(n,o){let r=n.invocationContext,i=r.eventQueue;if(!i)throw new Error(`NodeTool '${this.name}' requires an invocation event queue; it must be invoked from an LlmAgent tool-call step.`);let s=n.functionCallId;if(!s)throw new Error(`NodeTool '${this.name}' requires a function-call id; it must be invoked from an LlmAgent tool-call step.`);if(r.nodeToolDepth>=eM)throw new Error(`NodeTool '${this.name}': node-tool nesting exceeded ${eM} (possible node -> tool -> node recursion).`);let u=r.clone({nodeToolDepth:r.nodeToolDepth+1}),c=new Cn({invocationContext:u,channel:i,nodePath:"",runId:s,resumeInputs:n.resumeInputs}),l=u.branch,p=`${this.name}@${s}`,d=l?`${l}.${p}`:p;return Nr({parent:c,node:this.node,input:o,options:{runId:s,overrideBranch:d}})}};a(uI,"NodeTool");var gs=uI;function rM(t){return typeof t=="object"&&t!==null&&aI in t&&t[aI]===!0}a(rM,"isNodeTool");async function*oM(t,e,n){let o=t.mode==="task";!o&&!t.includeContentsExplicit&&(t.includeContents="none"),o||await FX(e,n);let r=BX(e.getInvocationContext(),{input:n,outputsByNode:qX(e)});if(o){yield*zX(e,r,t);return}for await(let i of t.runAsync(r))GX(t,i),yield i}a(oM,"runLlmAgentAsNode");async function FX(t,e){if(e==null)return;let n=J({author:"user",invocationId:t.invocationId,branch:t.branch,content:HX(e)});t.isolationScope!==void 0&&(n.isolationScope=t.isolationScope);let o=t.invocationContext.sessionService;o?await o.appendEvent({session:t.session,event:n}):t.session.events.push(n)}a(FX,"appendNodeInputAsUserTurn");async function*zX(t,e,n){var i,s;let o=n.finishTaskTool,r;for await(let u of n.runAsync(e)){let c=le(u).find(l=>l.name===vu);if(c){r={...(i=c.args)!=null?i:{}},yield u;continue}if(r!==void 0&&ZX(u)){let l=o.extractOutput(r);u.output=l,u.nodeInfo={...(s=u.nodeInfo)!=null?s:{},messageAsOutput:!0},n.outputKey&&l!==void 0&&(t.state.set(n.outputKey,l),u.actions.stateDelta[n.outputKey]=l),yield u;return}yield u}}a(zX,"runTaskMode");function GX(t,e){var i;if(e.partial||VX(e))return;let n=e.content;if(!n||n.role!=="model"||!n.parts)return;let o=n.parts.filter(s=>s.text&&!s.thought).map(s=>s.text).join(""),r=o;if(t.outputSchema&&o.trim())try{r=JSON.parse(o)}catch(s){r=o}r===""&&N.debug(`Agent '${t.name}' returned an empty response, so this node's output is the empty string and that is what the next node receives.`),e.output=r,e.nodeInfo={...(i=e.nodeInfo)!=null?i:{},messageAsOutput:!0}}a(GX,"maybeSetOutput");function BX(t,e){return t.clone({workflowInstructionScope:e})}a(BX,"withWorkflowInstructionScope");function qX(t){var n;let e={};for(let o of t.session.events){if(o.invocationId!==t.invocationId||o.output===void 0)continue;let r=(n=o.nodeInfo)==null?void 0:n.path;if(!r)continue;let i=r.slice(r.lastIndexOf(".")+1),s=i.includes("@")?i.slice(0,i.indexOf("@")):i;e[s]=o.output}return e}a(qX,"collectPredecessorOutputs");function VX(t){var e,n;return((n=(e=t.content)==null?void 0:e.parts)!=null?n:[]).some(o=>o.functionCall)}a(VX,"hasFunctionCalls");function ZX(t){return fe(t).some(e=>{var o;return e.name!==vu?!1:((o=e.response)!=null?o:{}).result===kf})}a(ZX,"isFinishTaskSuccessResponse");function HX(t){return Kn(t)?{...t,role:"user"}:typeof t=="string"?{role:"user",parts:[{text:t}]}:{role:"user",parts:[{text:JSON.stringify(t)}]}}a(HX,"toUserContent");var lI=class lI{run(e,n){let o=this.store;this.store=e;try{return n()}finally{this.store=o}}getStore(){return this.store}};a(lI,"AsyncLocalStorage");var Ff=lI;var JX="google-adk",KX="gl-typescript",WX="remote_reasoning_engine",jX="GOOGLE_CLOUD_AGENT_ENGINE_ID",iM=new Ff,YX=[["Edge",/(?:Edg|Edge|EdgA)\/([0-9.]+)/i],["Firefox",/(?:Firefox|FxiOS)\/([0-9.]+)/i],["Chrome",/(?:Chrome|CriOS)\/([0-9.]+)/i],["Safari",/Version\/([0-9.]+).*Safari/i]];function XX(t){if(!t)return"Browser";for(let[e,n]of YX){let o=t.match(n);if(o)return`${e}/${o[1]}`}return"Browser"}a(XX,"parseUserAgent");function QX(){let t=`${JX}/${Ks}`;!jt()&&process.env[jX]&&(t=`${t}+${WX}`);let e=jt()?XX(window.navigator.userAgent):process.version,n=`${KX}/${e}`;return[t,n]}a(QX,"_getDefaultLabels");function e3(t,e){if(typeof t!="string"||t.trim()==="")throw new Error("Client label must be a non-empty string.");return iM.run(t,e)}a(e3,"runWithClientLabel");function cI(){let t=QX(),e=iM.getStore();return e&&t.push(e),t}a(cI,"getClientLabels");var dI=Symbol.for("google.adk.baseModel");function fI(t){return typeof t=="object"&&t!==null&&dI in t&&t[dI]===!0}a(fI,"isBaseLlm");var sM;sM=dI;var zf=class zf{constructor({model:e}){this[sM]=!0;this.model=e}get trackingHeaders(){let n=cI().join(" ");return{"x-goog-api-client":n,"user-agent":n}}maybeAppendUserContent(e){var n;e.contents.length===0&&e.contents.push({role:"user",parts:[{text:"Handle the requests as specified in the System Instruction."}]}),((n=e.contents[e.contents.length-1])==null?void 0:n.role)!=="user"&&e.contents.push({role:"user",parts:[{text:"Continue processing previous requests as instructed. Exit or provide a summary if no more outputs are needed."}]})}};a(zf,"BaseLlm"),zf.supportedModels=[];var Yn=zf;var xI=class xI{add(e,n,o){if(typeof arguments[0]!="string")for(let r in arguments[0])this.add(r,arguments[0][r],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(r){this[r]=this[r]||[],n&&this[r][o?"unshift":"push"](n)},this)}run(e,n){this[e]=this[e]||[],this[e].forEach(function(o){o.call(n&&n.context?n.context:n,n)})}};a(xI,"Hooks");var mI=xI,EI=class EI{constructor(e){this.jsep=e,this.registered={}}register(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];n.forEach(r=>{if(typeof r!="object"||!r.name||!r.init)throw new Error("Invalid JSEP plugin format");this.registered[r.name]||(r.init(this.jsep),this.registered[r.name]=r)})}};a(EI,"Plugins");var gI=EI,R=class R{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+R.version}static addUnaryOp(e){return R.max_unop_len=Math.max(e.length,R.max_unop_len),R.unary_ops[e]=1,R}static addBinaryOp(e,n,o){return R.max_binop_len=Math.max(e.length,R.max_binop_len),R.binary_ops[e]=n,o?R.right_associative.add(e):R.right_associative.delete(e),R}static addIdentifierChar(e){return R.additional_identifier_chars.add(e),R}static addLiteral(e,n){return R.literals[e]=n,R}static removeUnaryOp(e){return delete R.unary_ops[e],e.length===R.max_unop_len&&(R.max_unop_len=R.getMaxKeyLen(R.unary_ops)),R}static removeAllUnaryOps(){return R.unary_ops={},R.max_unop_len=0,R}static removeIdentifierChar(e){return R.additional_identifier_chars.delete(e),R}static removeBinaryOp(e){return delete R.binary_ops[e],e.length===R.max_binop_len&&(R.max_binop_len=R.getMaxKeyLen(R.binary_ops)),R.right_associative.delete(e),R}static removeAllBinaryOps(){return R.binary_ops={},R.max_binop_len=0,R}static removeLiteral(e){return delete R.literals[e],R}static removeAllLiterals(){return R.literals={},R}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new R(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(n=>n.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return R.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!R.binary_ops[String.fromCharCode(e)]||R.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return R.isIdentifierStart(e)||R.isDecimalDigit(e)}throwError(e){let n=new Error(e+" at character "+this.index);throw n.index=this.index,n.description=e,n}runHook(e,n){if(R.hooks[e]){let o={context:this,node:n};return R.hooks.run(e,o),o.node}return n}searchHook(e){if(R.hooks[e]){let n={context:this};return R.hooks[e].find(function(o){return o.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let e=this.code;for(;e===R.SPACE_CODE||e===R.TAB_CODE||e===R.LF_CODE||e===R.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let e=this.gobbleExpressions(),n=e.length===1?e[0]:{type:R.COMPOUND,body:e};return this.runHook("after-all",n)}gobbleExpressions(e){let n=[],o,r;for(;this.index<this.expr.length;)if(o=this.code,o===R.SEMCOL_CODE||o===R.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())n.push(r);else if(this.index<this.expr.length){if(o===e)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,R.max_binop_len),n=e.length;for(;n>0;){if(R.binary_ops.hasOwnProperty(e)&&(!R.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!R.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=n,e;e=e.substr(0,--n)}return!1}gobbleBinaryExpression(){let e,n,o,r,i,s,u,c,l;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(i={value:n,prec:R.binaryPrecedence(n),right_a:R.right_associative.has(n)},u=this.gobbleToken(),u||this.throwError("Expected expression after "+n),r=[s,i,u];n=this.gobbleBinaryOp();){if(o=R.binaryPrecedence(n),o===0){this.index-=n.length;break}i={value:n,prec:o,right_a:R.right_associative.has(n)},l=n;let p=a(d=>i.right_a&&d.right_a?o>d.prec:o<=d.prec,"comparePrev");for(;r.length>2&&p(r[r.length-2]);)u=r.pop(),n=r.pop().value,s=r.pop(),e={type:R.BINARY_EXP,operator:n,left:s,right:u},r.push(e);e=this.gobbleToken(),e||this.throwError("Expected expression after "+l),r.push(i,e)}for(c=r.length-1,e=r[c];c>1;)e={type:R.BINARY_EXP,operator:r[c-1].value,left:r[c-2],right:e},c-=2;return e}gobbleToken(){let e,n,o,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"),r)return this.runHook("after-token",r);if(e=this.code,R.isDecimalDigit(e)||e===R.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===R.SQUOTE_CODE||e===R.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(e===R.OBRACK_CODE)r=this.gobbleArray();else{for(n=this.expr.substr(this.index,R.max_unop_len),o=n.length;o>0;){if(R.unary_ops.hasOwnProperty(n)&&(!R.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!R.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=o;let i=this.gobbleToken();return i||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:R.UNARY_EXP,operator:n,argument:i,prefix:!0})}n=n.substr(0,--o)}R.isIdentifierStart(e)?(r=this.gobbleIdentifier(),R.literals.hasOwnProperty(r.name)?r={type:R.LITERAL,value:R.literals[r.name],raw:r.name}:r.name===R.this_str&&(r={type:R.THIS_EXP})):e===R.OPAREN_CODE&&(r=this.gobbleGroup())}return r?(r=this.gobbleTokenProperty(r),this.runHook("after-token",r)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let n=this.code;for(;n===R.PERIOD_CODE||n===R.OBRACK_CODE||n===R.OPAREN_CODE||n===R.QUMARK_CODE;){let o;if(n===R.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==R.PERIOD_CODE)break;o=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===R.OBRACK_CODE?(e={type:R.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()},e.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==R.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===R.OPAREN_CODE?e={type:R.CALL_EXP,arguments:this.gobbleArguments(R.CPAREN_CODE),callee:e}:(n===R.PERIOD_CODE||o)&&(o&&this.index--,this.gobbleSpaces(),e={type:R.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),o&&(e.optional=!0),this.gobbleSpaces(),n=this.code}return e}gobbleNumericLiteral(){let e="",n,o;for(;R.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(this.code===R.PERIOD_CODE)for(e+=this.expr.charAt(this.index++);R.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(e+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(e+=this.expr.charAt(this.index++));R.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);R.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+e+this.char+")")}return o=this.code,R.isIdentifierStart(o)?this.throwError("Variable names cannot start with a number ("+e+this.char+")"):(o===R.PERIOD_CODE||e.length===1&&e.charCodeAt(0)===R.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:R.LITERAL,value:parseFloat(e),raw:e}}gobbleStringLiteral(){let e="",n=this.index,o=this.expr.charAt(this.index++),r=!1;for(;this.index<this.expr.length;){let i=this.expr.charAt(this.index++);if(i===o){r=!0;break}else if(i==="\\")switch(i=this.expr.charAt(this.index++),i){case"n":e+=`
87
+ `;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=i}else e+=i}return r||this.throwError('Unclosed quote after "'+e+'"'),{type:R.LITERAL,value:e,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let e=this.code,n=this.index;for(R.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(e=this.code,R.isIdentifierPart(e));)this.index++;return{type:R.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(e){let n=[],o=!1,r=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let i=this.code;if(i===e){o=!0,this.index++,e===R.CPAREN_CODE&&r&&r>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}else if(i===R.COMMA_CODE){if(this.index++,r++,r!==n.length){if(e===R.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===R.CBRACK_CODE)for(let s=n.length;s<r;s++)n.push(null)}}else if(n.length!==r&&r!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===R.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return o||this.throwError("Expected "+String.fromCharCode(e)),n}gobbleGroup(){this.index++;let e=this.gobbleExpressions(R.CPAREN_CODE);if(this.code===R.CPAREN_CODE)return this.index++,e.length===1?e[0]:e.length?{type:R.SEQUENCE_EXP,expressions:e}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:R.ARRAY_EXP,elements:this.gobbleArguments(R.CBRACK_CODE)}}};a(R,"Jsep");var At=R,t3=new mI;Object.assign(At,{hooks:t3,plugins:new gI(At),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});At.max_unop_len=At.getMaxKeyLen(At.unary_ops);At.max_binop_len=At.getMaxKeyLen(At.binary_ops);var In=a(t=>new At(t).parse(),"jsep"),vs,n3=Object.getOwnPropertyNames((vs=class{},a(vs,"Test"),vs));Object.getOwnPropertyNames(At).filter(t=>!n3.includes(t)&&In[t]===void 0).forEach(t=>{In[t]=At[t]});In.Jsep=At;var r3="ConditionalExpression",o3={name:"ternary",init(t){t.hooks.add("after-expression",a(function(n){if(n.node&&this.code===t.QUMARK_CODE){this.index++;let o=n.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===t.COLON_CODE){this.index++;let i=this.gobbleExpression();if(i||this.throwError("Expected expression"),n.node={type:r3,test:o,consequent:r,alternate:i},o.operator&&t.binary_ops[o.operator]<=.9){let s=o;for(;s.right.operator&&t.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=o}}else this.throwError("Expected :")}},"gobbleTernary"))}};In.plugins.register(o3);var aM=47,i3=92,s3={name:"regex",init(t){t.hooks.add("gobble-token",a(function(n){if(this.code===aM){let o=++this.index,r=!1;for(;this.index<this.expr.length;){if(this.code===aM&&!r){let i=this.expr.slice(o,this.index),s="";for(;++this.index<this.expr.length;){let c=this.code;if(c>=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57)s+=this.char;else break}let u;try{u=new RegExp(i,s)}catch(c){this.throwError(c.message)}return n.node={type:t.LITERAL,value:u,raw:this.expr.slice(o-1,this.index)},n.node=this.gobbleTokenProperty(n.node),n.node}this.code===t.OBRACK_CODE?r=!0:r&&this.code===t.CBRACK_CODE&&(r=!1),this.index+=this.code===i3?2:1}this.throwError("Unclosed Regex")}},"gobbleRegexLiteral"))}},pI=43,a3=45,hs={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[pI,a3],assignmentPrecedence:.9,init(t){let e=[t.IDENTIFIER,t.MEMBER_EXP];hs.assignmentOperators.forEach(o=>t.addBinaryOp(o,hs.assignmentPrecedence,!0)),t.hooks.add("gobble-token",a(function(r){let i=this.code;hs.updateOperators.some(s=>s===i&&s===this.expr.charCodeAt(this.index+1))&&(this.index+=2,r.node={type:"UpdateExpression",operator:i===pI?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},(!r.node.argument||!e.includes(r.node.argument.type))&&this.throwError(`Unexpected ${r.node.operator}`))},"gobbleUpdatePrefix")),t.hooks.add("after-token",a(function(r){if(r.node){let i=this.code;hs.updateOperators.some(s=>s===i&&s===this.expr.charCodeAt(this.index+1))&&(e.includes(r.node.type)||this.throwError(`Unexpected ${r.node.operator}`),this.index+=2,r.node={type:"UpdateExpression",operator:i===pI?"++":"--",argument:r.node,prefix:!1})}},"gobbleUpdatePostfix")),t.hooks.add("after-expression",a(function(r){r.node&&n(r.node)},"gobbleAssignment"));function n(o){hs.assignmentOperators.has(o.operator)?(o.type="AssignmentExpression",n(o.left),n(o.right)):o.operator||Object.values(o).forEach(r=>{r&&typeof r=="object"&&n(r)})}a(n,"updateBinariesToAssignments")}};In.plugins.register(s3,hs);In.addUnaryOp("typeof");In.addUnaryOp("void");In.addLiteral("null",null);In.addLiteral("undefined",void 0);var u3=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),he={evalAst(t,e){switch(t.type){case"BinaryExpression":case"LogicalExpression":return he.evalBinaryExpression(t,e);case"Compound":return he.evalCompound(t,e);case"ConditionalExpression":return he.evalConditionalExpression(t,e);case"Identifier":return he.evalIdentifier(t,e);case"Literal":return he.evalLiteral(t,e);case"MemberExpression":return he.evalMemberExpression(t,e);case"UnaryExpression":return he.evalUnaryExpression(t,e);case"ArrayExpression":return he.evalArrayExpression(t,e);case"CallExpression":return he.evalCallExpression(t,e);case"AssignmentExpression":return he.evalAssignmentExpression(t,e);default:throw SyntaxError("Unexpected expression",t)}},evalBinaryExpression(t,e){return{"||":a((o,r)=>o||r(),"||"),"&&":a((o,r)=>o&&r(),"&&"),"|":a((o,r)=>o|r(),"|"),"^":a((o,r)=>o^r(),"^"),"&":a((o,r)=>o&r(),"&"),"==":a((o,r)=>o==r(),"=="),"!=":a((o,r)=>o!=r(),"!="),"===":a((o,r)=>o===r(),"==="),"!==":a((o,r)=>o!==r(),"!=="),"<":a((o,r)=>o<r(),"<"),">":a((o,r)=>o>r(),">"),"<=":a((o,r)=>o<=r(),"<="),">=":a((o,r)=>o>=r(),">="),"<<":a((o,r)=>o<<r(),"<<"),">>":a((o,r)=>o>>r(),">>"),">>>":a((o,r)=>o>>>r(),">>>"),"+":a((o,r)=>o+r(),"+"),"-":a((o,r)=>o-r(),"-"),"*":a((o,r)=>o*r(),"*"),"/":a((o,r)=>o/r(),"/"),"%":a((o,r)=>o%r(),"%")}[t.operator](he.evalAst(t.left,e),()=>he.evalAst(t.right,e))},evalCompound(t,e){let n;for(let o=0;o<t.body.length;o++){t.body[o].type==="Identifier"&&["var","let","const"].includes(t.body[o].name)&&t.body[o+1]&&t.body[o+1].type==="AssignmentExpression"&&(o+=1);let r=t.body[o];n=he.evalAst(r,e)}return n},evalConditionalExpression(t,e){return he.evalAst(t.test,e)?he.evalAst(t.consequent,e):he.evalAst(t.alternate,e)},evalIdentifier(t,e){if(Object.hasOwn(e,t.name))return e[t.name];throw ReferenceError(`${t.name} is not defined`)},evalLiteral(t){return t.value},evalMemberExpression(t,e){let n=String(t.computed?he.evalAst(t.property):t.property.name),o=he.evalAst(t.object,e);if(o==null)throw TypeError(`Cannot read properties of ${o} (reading '${n}')`);if(!Object.hasOwn(o,n)&&u3.has(n))throw TypeError(`Cannot read properties of ${o} (reading '${n}')`);let r=o[n];return typeof r=="function"?r.bind(o):r},evalUnaryExpression(t,e){return{"-":a(o=>-he.evalAst(o,e),"-"),"!":a(o=>!he.evalAst(o,e),"!"),"~":a(o=>~he.evalAst(o,e),"~"),"+":a(o=>+he.evalAst(o,e),"+"),typeof:a(o=>typeof he.evalAst(o,e),"typeof"),void:a(o=>{he.evalAst(o,e)},"void")}[t.operator](t.argument)},evalArrayExpression(t,e){return t.elements.map(n=>he.evalAst(n,e))},evalCallExpression(t,e){let n=t.arguments.map(r=>he.evalAst(r,e)),o=he.evalAst(t.callee,e);if(o===Function)throw new Error("Function constructor is disabled");return o(...n)},evalAssignmentExpression(t,e){if(t.left.type!=="Identifier")throw SyntaxError("Invalid left-hand side in assignment");let n=t.left.name,o=he.evalAst(t.right,e);return e[n]=o,e[n]}},SI=class SI{constructor(e){this.code=e,this.ast=In(this.code)}runInNewContext(e){let n=Object.assign(Object.create(null),e);return he.evalAst(this.ast,n)}};a(SI,"SafeScript");var hI=SI;function $r(t,e){return t=t.slice(),t.push(e),t}a($r,"push");function vI(t,e){return e=e.slice(),e.unshift(t),e}a(vI,"unshift");var TI=class TI extends Error{constructor(e){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=e,this.name="NewError"}};a(TI,"NewError");var yI=TI;function ae(t,e,n,o,r){if(!(this instanceof ae))try{return new ae(t,e,n,o,r)}catch(s){if(!s.avoidNew)throw s;return s.value}typeof t=="string"&&(r=o,o=n,n=e,e=t,t=null);let i=t&&typeof t=="object";if(t=t||{},this.json=t.json||n,this.path=t.path||e,this.resultType=t.resultType||"value",this.flatten=t.flatten||!1,this.wrap=Object.hasOwn(t,"wrap")?t.wrap:!0,this.sandbox=t.sandbox||{},this.eval=t.eval===void 0?"safe":t.eval,this.ignoreEvalErrors=typeof t.ignoreEvalErrors>"u"?!1:t.ignoreEvalErrors,this.parent=t.parent||null,this.parentProperty=t.parentProperty||null,this.callback=t.callback||o||null,this.otherTypeCallback=t.otherTypeCallback||r||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},t.autostart!==!1){let s={path:i?t.path:e};i?"json"in t&&(s.json=t.json):s.json=n;let u=this.evaluate(s);if(!u||typeof u!="object")throw new yI(u);return u}}a(ae,"JSONPath");ae.prototype.evaluate=function(t,e,n,o){let r=this.parent,i=this.parentProperty,{flatten:s,wrap:u}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,n=n||this.callback,this.currOtherTypeCallback=o||this.otherTypeCallback,e=e||this.json,t=t||this.path,t&&typeof t=="object"&&!Array.isArray(t)){if(!t.path&&t.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:e}=t),s=Object.hasOwn(t,"flatten")?t.flatten:s,this.currResultType=Object.hasOwn(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=Object.hasOwn(t,"sandbox")?t.sandbox:this.currSandbox,u=Object.hasOwn(t,"wrap")?t.wrap:u,this.currEval=Object.hasOwn(t,"eval")?t.eval:this.currEval,n=Object.hasOwn(t,"callback")?t.callback:n,this.currOtherTypeCallback=Object.hasOwn(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,r=Object.hasOwn(t,"parent")?t.parent:r,i=Object.hasOwn(t,"parentProperty")?t.parentProperty:i,t=t.path}if(r=r||null,i=i||null,Array.isArray(t)&&(t=ae.toPathString(t)),!t&&t!==""||!e)return;let c=ae.toPathArray(t);c[0]==="$"&&c.length>1&&c.shift(),this._hasParentSelector=null;let l=this._trace(c,e,["$"],r,i,n).filter(function(p){return p&&!p.isParentSelector});return l.length?!u&&l.length===1&&!l[0].hasArrExpr?this._getPreferredOutput(l[0]):l.reduce((p,d)=>{let g=this._getPreferredOutput(d);return s&&Array.isArray(g)?p=p.concat(g):p.push(g),p},[]):u?[]:void 0};ae.prototype._getPreferredOutput=function(t){let e=this.currResultType;switch(e){case"all":{let n=Array.isArray(t.path)?t.path:ae.toPathArray(t.path);return t.pointer=ae.toPointer(n),t.path=typeof t.path=="string"?t.path:ae.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[e];case"path":return ae.toPathString(t[e]);case"pointer":return ae.toPointer(t.path);default:throw new TypeError("Unknown result type")}};ae.prototype._handleCallback=function(t,e,n){if(e){let o=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:ae.toPathString(t.path),e(o,n,t)}};ae.prototype._trace=function(t,e,n,o,r,i,s,u){let c;if(!t.length)return c={path:n,value:e,parent:o,parentProperty:r,hasArrExpr:s},this._handleCallback(c,i,"value"),c;let l=t[0],p=t.slice(1),d=[];function g(h){Array.isArray(h)?h.forEach(v=>{d.push(v)}):d.push(h)}if(a(g,"addRet"),(typeof l!="string"||u)&&e&&Object.hasOwn(e,l))g(this._trace(p,e[l],$r(n,l),e,l,i,s));else if(l==="*")this._walk(e,h=>{g(this._trace(p,e[h],$r(n,h),e,h,i,!0,!0))});else if(l==="..")g(this._trace(p,e,n,o,r,i,s)),this._walk(e,h=>{typeof e[h]=="object"&&g(this._trace(t.slice(),e[h],$r(n,h),e,h,i,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:n.slice(0,-1),expr:p,isParentSelector:!0};if(l==="~")return c={path:$r(n,l),value:r,parent:o,parentProperty:null},this._handleCallback(c,i,"property"),c;if(l==="$")g(this._trace(p,e,n,null,null,i,s));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(l))g(this._slice(l,p,e,n,o,r,i));else if(l.indexOf("?(")===0){if(this.currEval===!1)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");let h=l.replace(/^\?\((.*?)\)$/u,"$1"),v=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(h);v?this._walk(e,y=>{let _=[v[2]],x=v[1]?e[y][v[1]]:e[y];this._trace(_,x,n,o,r,i,!0).length>0&&g(this._trace(p,e[y],$r(n,y),e,y,i,!0))}):this._walk(e,y=>{this._eval(h,e[y],y,n,o,r)&&g(this._trace(p,e[y],$r(n,y),e,y,i,!0))})}else if(l[0]==="("){if(this.currEval===!1)throw new Error("Eval [(expr)] prevented in JSONPath expression.");g(this._trace(vI(this._eval(l,e,n.at(-1),n.slice(0,-1),o,r),p),e,n,o,r,i,s))}else if(l[0]==="@"){let h=!1,v=l.slice(1,-2);switch(v){case"scalar":(!e||!["object","function"].includes(typeof e))&&(h=!0);break;case"boolean":case"string":case"undefined":case"function":typeof e===v&&(h=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(h=!0);break;case"number":Number.isFinite(e)&&(h=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(h=!0);break;case"object":e&&typeof e===v&&(h=!0);break;case"array":Array.isArray(e)&&(h=!0);break;case"other":h=this.currOtherTypeCallback(e,n,o,r);break;case"null":e===null&&(h=!0);break;default:throw new TypeError("Unknown value type "+v)}if(h)return c={path:n,value:e,parent:o,parentProperty:r},this._handleCallback(c,i,"value"),c}else if(l[0]==="`"&&e&&Object.hasOwn(e,l.slice(1))){let h=l.slice(1);g(this._trace(p,e[h],$r(n,h),e,h,i,s,!0))}else if(l.includes(",")){let h=l.split(",");for(let v of h)g(this._trace(vI(v,p),e,n,o,r,i,!0))}else!u&&e&&Object.hasOwn(e,l)&&g(this._trace(p,e[l],$r(n,l),e,l,i,s,!0))}if(this._hasParentSelector)for(let h=0;h<d.length;h++){let v=d[h];if(v&&v.isParentSelector){let y=this._trace(v.expr,e,v.path,o,r,i,s);if(Array.isArray(y)){d[h]=y[0];let _=y.length;for(let x=1;x<_;x++)h++,d.splice(h,0,y[x])}else d[h]=y}}return d};ae.prototype._walk=function(t,e){if(Array.isArray(t)){let n=t.length;for(let o=0;o<n;o++)e(o)}else t&&typeof t=="object"&&Object.keys(t).forEach(n=>{e(n)})};ae.prototype._slice=function(t,e,n,o,r,i,s){if(!Array.isArray(n))return;let u=n.length,c=t.split(":"),l=c[2]&&Number.parseInt(c[2])||1,p=c[0]&&Number.parseInt(c[0])||0,d=c[1]&&Number.parseInt(c[1])||u;p=p<0?Math.max(0,p+u):Math.min(u,p),d=d<0?Math.max(0,d+u):Math.min(u,d);let g=[];for(let h=p;h<d;h+=l)this._trace(vI(h,e),n,o,r,i,s,!0).forEach(y=>{g.push(y)});return g};ae.prototype._eval=function(t,e,n,o,r,i){this.currSandbox._$_parentProperty=i,this.currSandbox._$_parent=r,this.currSandbox._$_property=n,this.currSandbox._$_root=this.json,this.currSandbox._$_v=e;let s=t.includes("@path");s&&(this.currSandbox._$_path=ae.toPathString(o.concat([n])));let u=this.currEval+"Script:"+t;if(!ae.cache[u]){let c=t.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(s&&(c=c.replaceAll("@path","_$_path")),this.currEval==="safe"||this.currEval===!0||this.currEval===void 0)ae.cache[u]=new this.safeVm.Script(c);else if(this.currEval==="native")ae.cache[u]=new this.vm.Script(c);else if(typeof this.currEval=="function"&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){let l=this.currEval;ae.cache[u]=new l(c)}else if(typeof this.currEval=="function")ae.cache[u]={runInNewContext:a(l=>this.currEval(c,l),"runInNewContext")};else throw new TypeError(`Unknown "eval" property "${this.currEval}"`)}try{return ae.cache[u].runInNewContext(this.currSandbox)}catch(c){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+c.message+": "+t)}};ae.cache={};ae.toPathString=function(t){let e=t,n=e.length,o="$";for(let r=1;r<n;r++)/^(~|\^|@.*?\(\))$/u.test(e[r])||(o+=/^[0-9*]+$/u.test(e[r])?"["+e[r]+"]":"['"+e[r]+"']");return o};ae.toPointer=function(t){let e=t,n=e.length,o="";for(let r=1;r<n;r++)/^(~|\^|@.*?\(\))$/u.test(e[r])||(o+="/"+e[r].toString().replaceAll("~","~0").replaceAll("/","~1"));return o};ae.toPathArray=function(t){let{cache:e}=ae;if(e[t])return e[t].concat();let n=[],r=t.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,function(i,s){return"[#"+(n.push(s)-1)+"]"}).replaceAll(/\[['"]([^'\]]*)['"]\]/gu,function(i,s){return"['"+s.replaceAll(".","%@%").replaceAll("~","%%@@%%")+"']"}).replaceAll("~",";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replaceAll("%@%",".").replaceAll("%%@@%%","~").replaceAll(/(?:;)?(\^+)(?:;)?/gu,function(i,s){return";"+s.split("").join(";")+";"}).replaceAll(/;;;|;;/gu,";..;").replaceAll(/;$|'?\]|'$/gu,"").split(";").map(function(i){let s=i.match(/#(\d+)/u);return!s||!s[1]?i:n[s[1]]});return e[t]=r,e[t].concat()};ae.prototype.safeVm={Script:hI};var l3=a(function(t,e,n){let o=t.length;for(let r=0;r<o;r++){let i=t[r];n(i)&&e.push(t.splice(r--,1)[0])}},"moveToAnotherArray"),CI=class CI{constructor(e){this.code=e}runInNewContext(e){let n=this.code,o=Object.keys(e),r=[];l3(o,r,l=>typeof e[l]=="function");let i=o.map(l=>e[l]);n=r.reduce((l,p)=>{let d=e[p].toString();return/function/u.test(d)||(d="function "+d),"var "+p+"="+d+";"+l},"")+n,!/(['"])use strict\1/u.test(n)&&!o.includes("arguments")&&(n="var arguments = undefined;"+n),n=n.replace(/;\s*$/u,"");let u=n.lastIndexOf(";"),c=u!==-1?n.slice(0,u+1)+" return "+n.slice(u+1):" return "+n;return new Function(...o,c)(...i)}};a(CI,"Script");var _I=CI;ae.prototype.vm={Script:_I};var lM=(e=>(e.PROGRESSIVE_SSE_STREAMING="PROGRESSIVE_SSE_STREAMING",e))(lM||{}),c3=(o=>(o.WIP="wip",o.EXPERIMENTAL="experimental",o.STABLE="stable",o))(c3||{}),cM={PROGRESSIVE_SSE_STREAMING:{stage:"experimental",defaultOn:!1}},uM=new Set,Xn={};function AI(t){return cM[t]}a(AI,"getFeatureConfig");function TSe(t,e){cM[t]=e}a(TSe,"registerFeature");function CSe(t,e){if(!AI(t))throw new Error(`Feature ${t} is not registered.`);e===void 0?delete Xn[t]:Xn[t]=e}a(CSe,"overrideFeatureEnabled");function dM(t){let e=AI(t);if(!e)throw new Error(`Feature ${t} is not registered.`);if(t in Xn){let r=Xn[t];return r&&e.stage!=="stable"&&II(t,e.stage),r}let n=`ADK_ENABLE_${t}`,o=`ADK_DISABLE_${t}`;return Ur(n)?(e.stage!=="stable"&&II(t,e.stage),!0):Ur(o)?!1:(e.stage!=="stable"&&e.defaultOn&&II(t,e.stage),e.defaultOn)}a(dM,"isFeatureEnabled");function II(t,e){uM.has(t)||(uM.add(t),N.warn(`[${e.toUpperCase()}] feature ${t} is enabled.`))}a(II,"emitNonStableWarningOnce");async function ISe(t,e,n){if(!AI(t))throw new Error(`Feature ${t} is not registered.`);let r=t in Xn,i=Xn[t];Xn[t]=e;try{return await n()}finally{r?Xn[t]=i:delete Xn[t]}}a(ISe,"withTemporaryFeatureOverride");function Gf(t){var n;let e=t.usageMetadata;if(t.candidates&&t.candidates.length>0){let o=t.candidates[0];return(n=o.content)!=null&&n.parts&&o.content.parts.length>0?{content:o.content,groundingMetadata:o.groundingMetadata,citationMetadata:o.citationMetadata,usageMetadata:e,finishReason:o.finishReason}:{errorCode:o.finishReason,errorMessage:o.finishMessage,usageMetadata:e,citationMetadata:o.citationMetadata,finishReason:o.finishReason}}return t.promptFeedback?{errorCode:t.promptFeedback.blockReason,errorMessage:t.promptFeedback.blockReasonMessage,usageMetadata:e}:{errorCode:"UNKNOWN_ERROR",errorMessage:"Unknown error.",usageMetadata:e}}a(Gf,"createLlmResponse");var d3=new Set(["__proto__","constructor","prototype"]),RI=class RI{constructor(){this.partsSequence=[];this.currentTextBuffer="";this.currentFcArgs={}}flushTextBufferToSequence(){this.currentTextBuffer&&(this.currentTextIsThought?this.partsSequence.push({text:this.currentTextBuffer,thought:!0}):this.partsSequence.push({text:this.currentTextBuffer}),this.currentTextBuffer="",this.currentTextIsThought=void 0)}getValueFromPartialArg(e,n){let o=null,r=!1,i=e.stringValue,s=e.numberValue,u=e.boolValue,c=e.nullValue;if(i!==void 0){let l=i;r=!0;let p=ae.toPathArray(n).filter(g=>g!=="$"&&g!=="$["),d=this.currentFcArgs;for(let g of p)if(d&&typeof d=="object"&&g in d)d=d[g];else{d=void 0;break}typeof d=="string"?o=d+l:o=l}else s!==void 0?(o=s,r=!0):u!==void 0?(o=u,r=!0):c!==void 0&&(o=null,r=!0);return[o,r]}setValueByJsonPath(e,n){let o=ae.toPathArray(e).filter(i=>i!=="$"&&i!=="$[");if(o.some(i=>d3.has(String(i))))return;let r=this.currentFcArgs;for(let i=0;i<o.length-1;i++){let s=o[i];Object.prototype.hasOwnProperty.call(r,s)||(r[s]={}),r=r[s]}o.length>0&&(r[o[o.length-1]]=n)}flushFunctionCallToSequence(){var e;if(this.currentFcName){let n={functionCall:{name:this.currentFcName,args:JSON.parse(JSON.stringify(this.currentFcArgs)),id:(e=this.currentFcId)!=null?e:bt()}};this.currentThoughtSignature&&(n.thoughtSignature=this.currentThoughtSignature.toString()),this.partsSequence.push(n),this.currentFcName=void 0,this.currentFcArgs={},this.currentFcId=void 0,this.currentThoughtSignature=void 0}}processStreamingFunctionCall(e){e.name&&(this.currentFcName=e.name),e.id&&(this.currentFcId=e.id);for(let n of e.partialArgs||[]){let o=n.jsonPath;if(!o)continue;let[r,i]=this.getValueFromPartialArg(n,o);i&&this.setValueByJsonPath(o,r)}e.willContinue||(this.flushTextBufferToSequence(),this.flushFunctionCallToSequence())}processFunctionCallPart(e){let n=e.functionCall;n&&(n.partialArgs||n.willContinue?(!n.id&&!this.currentFcId&&(n.id=bt()),e.thoughtSignature&&!this.currentThoughtSignature&&(this.currentThoughtSignature=e.thoughtSignature),this.processStreamingFunctionCall(n)):n.name&&(n.id||(n.id=bt()),this.flushTextBufferToSequence(),this.partsSequence.push(e)))}async*processResponse(e){var n;if(e.content&&e.content.parts)for(let o of e.content.parts)if(o.text){let r=(n=o.thought)!=null?n:!1;this.currentTextBuffer&&r!==this.currentTextIsThought&&this.flushTextBufferToSequence(),this.currentTextBuffer||(this.currentTextIsThought=r),this.currentTextBuffer+=o.text}else o.functionCall?this.processFunctionCallPart(o):(this.flushTextBufferToSequence(),this.partsSequence.push(o));e.partial=!0,yield e}close(){this.flushTextBufferToSequence(),this.flushFunctionCallToSequence();let e=this.partsSequence;if(e.length!==0)return e}};a(RI,"ProgressiveStrategy");var wI=RI,kI=class kI{constructor(){this.text="";this.thoughtText=""}async*processResponse(e){var n;if((n=e.content)!=null&&n.parts){let o=[],r=!1;for(let i of e.content.parts){if(typeof i.text=="string"){r=!0,i.thought?this.thoughtText+=i.text:this.text+=i.text;continue}i.functionCall&&!i.functionCall.id&&(i.functionCall.id=bt()),o.push(i)}if(o.length>0){if(this.thoughtText||this.text){let i=[];this.thoughtText&&i.push({text:this.thoughtText,thought:!0}),this.text&&i.push({text:this.text}),yield{content:{role:"model",parts:i},usageMetadata:e.usageMetadata,partial:!1},this.thoughtText="",this.text=""}yield{...e,content:{role:e.content.role,parts:o},partial:!1};return}r&&(e.partial=!0)}yield e}close(){if(this.text||this.thoughtText){let e=[];return this.thoughtText&&e.push({text:this.thoughtText,thought:!0}),this.text&&e.push({text:this.text}),e}}};a(kI,"NonProgressiveStrategy");var bI=kI,PI=class PI{constructor(e=dM("PROGRESSIVE_SSE_STREAMING")){this.isProgressiveMode=e;this.lastThoughtSignature={};this.strategy=this.isProgressiveMode?new wI:new bI}async*processResponse(e){var r,i;let n=Gf(e);if(((i=(r=n.content)==null?void 0:r.parts)!=null?i:[]).every(f3)&&(n.finishReason===void 0||n.finishReason===gn.STOP)){n.usageMetadata&&(this.usageMetadata=n.usageMetadata),n.groundingMetadata&&(this.groundingMetadata=n.groundingMetadata),n.citationMetadata&&(this.citationMetadata=n.citationMetadata),n.finishReason&&(this.finishReason=n.finishReason);return}if(this.response=e,this.usageMetadata=n.usageMetadata,n.groundingMetadata&&(this.groundingMetadata=n.groundingMetadata),n.citationMetadata&&(this.citationMetadata=n.citationMetadata),n.finishReason&&(this.finishReason=n.finishReason),n.content&&n.content.parts)for(let s of n.content.parts)s.thoughtSignature?this.lastThoughtSignature.value=s.thoughtSignature:s.functionCall&&this.lastThoughtSignature.value&&(s.thoughtSignature=this.lastThoughtSignature.value.toString());yield*this.strategy.processResponse(n)}close(){var i,s,u;let e=this.strategy.close(),n=this.usageMetadata!==void 0||this.groundingMetadata!==void 0||this.citationMetadata!==void 0;if(!e&&!n)return;let o=(s=(i=this.response)==null?void 0:i.candidates)==null?void 0:s[0],r=(u=this.finishReason)!=null?u:o==null?void 0:o.finishReason;return{content:e?{role:"model",parts:e}:void 0,groundingMetadata:this.groundingMetadata,citationMetadata:this.citationMetadata,errorCode:r===gn.STOP?void 0:r,errorMessage:r===gn.STOP||o==null?void 0:o.finishMessage,usageMetadata:this.usageMetadata,finishReason:r,partial:!1}}};a(PI,"StreamingResponseAggregator");var Bf=PI;function f3(t){return!t.functionCall&&!t.functionResponse&&!t.fileData&&!t.inlineData&&!t.executableCode&&!t.codeExecutionResult&&(!t.text||t.text==="")}a(f3,"isEmptyContentPart");var p3="^projects/[^/]+/locations/[^/]+/publishers/[^/]+/models/(.+)$";function qf(t){let e=t.match(p3);return e?e[1]:t}a(qf,"extractModelName");function An(t){return qf(t).startsWith("gemini-")}a(An,"isGeminiModel");function m3(t){if(!/^\d+(\.\d+)*$/.test(t))return{valid:!1,major:0,minor:0,patch:0};let e=t.split(".").map(n=>parseInt(n,10));return{valid:!0,major:e[0],minor:e.length>1?e[1]:0,patch:e.length>2?e[2]:0}}a(m3,"parseVersion");function Dr(t){return qf(t).startsWith("gemini-1")}a(Dr,"isGemini1Model");function Qn(t){if(!t)return!1;let e=qf(t);if(!e.startsWith("gemini-"))return!1;let n=e.slice(7).split("-",1)[0],o=m3(n);return o.valid&&o.major>=2}a(Qn,"isGemini2OrAbove");function ao(t){if(!t)return!1;let e=qf(t);return e.startsWith("gemini-3.")&&e.includes("-flash-live")}a(ao,"isGemini3xFlashLive");function ys(){return Ur("ADK_DISABLE_GEMINI_MODEL_ID_CHECK")}a(ys,"isGeminiModelIdCheckDisabled");var NI=class NI{constructor(e){this.modelVersion=e;this.text="";this.isThought=!1;this.toolCallParts=[];this.pendingGroundingMetadata=void 0;this.inputTranscriptionText="";this.outputTranscriptionText=""}*processMessage(e){if(e.usageMetadata&&(yield{usageMetadata:e.usageMetadata,...this.modelVersion?{modelVersion:this.modelVersion}:{}}),e.serverContent){let n=e.serverContent,o=n.modelTurn;if(n.groundingMetadata&&(this.pendingGroundingMetadata=n.groundingMetadata),!(o&&o.parts)&&n.groundingMetadata&&!n.turnComplete&&(yield{groundingMetadata:n.groundingMetadata,...n.interrupted!==void 0?{interrupted:n.interrupted}:{},...this.modelVersion?{modelVersion:this.modelVersion}:{}}),o&&o.parts){let r={content:o,...n.interrupted!==void 0?{interrupted:n.interrupted}:{},...this.modelVersion?{modelVersion:this.modelVersion}:{}};!n.turnComplete&&n.groundingMetadata&&(r.groundingMetadata=n.groundingMetadata);let i=o.parts.some(s=>s.inlineData);for(let s of o.parts)if(s.text){let u=!!s.thought;this.text&&u!==this.isThought&&(yield this.buildFullTextResponse(this.text,this.isThought),this.text="",this.isThought=!1),this.text+=s.text,this.isThought=u,r.partial=!0}this.text&&!o.parts.some(s=>s.text)&&!i&&(yield this.buildFullTextResponse(this.text,this.isThought),this.text="",this.isThought=!1),yield r}if(n.inputTranscription&&(n.inputTranscription.text&&(this.inputTranscriptionText+=n.inputTranscription.text,yield{inputTranscription:{text:n.inputTranscription.text,finished:!1},partial:!0,...this.modelVersion?{modelVersion:this.modelVersion}:{}}),n.inputTranscription.finished&&(yield{inputTranscription:{text:this.inputTranscriptionText,finished:!0},partial:!1,...this.modelVersion?{modelVersion:this.modelVersion}:{}},this.inputTranscriptionText="")),n.outputTranscription&&(n.outputTranscription.text&&(this.outputTranscriptionText+=n.outputTranscription.text,yield{outputTranscription:{text:n.outputTranscription.text,finished:!1},partial:!0,...this.modelVersion?{modelVersion:this.modelVersion}:{}}),n.outputTranscription.finished&&(yield{outputTranscription:{text:this.outputTranscriptionText,finished:!0},partial:!1,...this.modelVersion?{modelVersion:this.modelVersion}:{}},this.outputTranscriptionText="")),(n.interrupted||n.turnComplete||n.generationComplete)&&(this.inputTranscriptionText&&(yield{inputTranscription:{text:this.inputTranscriptionText,finished:!0},partial:!1,...this.modelVersion?{modelVersion:this.modelVersion}:{}},this.inputTranscriptionText=""),this.outputTranscriptionText&&(yield{outputTranscription:{text:this.outputTranscriptionText,finished:!0},partial:!1,...this.modelVersion?{modelVersion:this.modelVersion}:{}},this.outputTranscriptionText="")),n.turnComplete){let r=this.pendingGroundingMetadata;this.text&&(yield this.buildFullTextResponse(this.text,this.isThought,r),this.text="",this.isThought=!1,r=void 0),this.toolCallParts.length>0&&(yield{content:{role:"model",parts:this.toolCallParts},...this.modelVersion?{modelVersion:this.modelVersion}:{}},this.toolCallParts=[]);let i={turnComplete:!0,...this.modelVersion?{modelVersion:this.modelVersion}:{}};n.interrupted!==void 0&&(i.interrupted=n.interrupted);let s=n.groundingMetadata||r;s!=null&&(i.groundingMetadata=s),yield i}n.interrupted&&(this.text?(yield this.buildFullTextResponse(this.text,this.isThought),this.text="",this.isThought=!1):yield{interrupted:n.interrupted,...this.modelVersion?{modelVersion:this.modelVersion}:{}})}e.toolCall&&(this.text&&(yield this.buildFullTextResponse(this.text,this.isThought),this.text="",this.isThought=!1),e.toolCall.functionCalls&&this.toolCallParts.push(...e.toolCall.functionCalls.map(o=>({functionCall:o}))),ao(this.modelVersion)&&this.toolCallParts.length>0&&(yield{content:{role:"model",parts:this.toolCallParts},...this.modelVersion?{modelVersion:this.modelVersion}:{}},this.toolCallParts=[])),e.sessionResumptionUpdate&&(yield{liveSessionResumptionUpdate:e.sessionResumptionUpdate,...this.modelVersion?{modelVersion:this.modelVersion}:{}}),e.goAway&&(yield{goAway:e.goAway,...this.modelVersion?{modelVersion:this.modelVersion}:{}})}*close(){this.toolCallParts.length>0&&(yield{content:{role:"model",parts:this.toolCallParts},...this.modelVersion?{modelVersion:this.modelVersion}:{}},this.toolCallParts=[])}buildFullTextResponse(e,n,o){let r={text:e};n&&(r.thought=!0);let i={content:{role:"model",parts:[r]},partial:!1};return o!=null&&(i.groundingMetadata=o),this.modelVersion&&(i.modelVersion=this.modelVersion),i}};a(NI,"LiveResponseAggregator");var Vf=NI;var $I=class $I{constructor(e,n,o){this.geminiSession=e;this.modelVersion=n;this.messageQueue=o}async sendHistory(e){let n=e.filter(o=>{var r;return o.parts&&((r=o.parts[0])==null?void 0:r.text)});if(n.length>0){let o=ao(this.modelVersion);this.geminiSession.sendClientContent({turns:n,turnComplete:o?!0:n[n.length-1].role==="user"})}else N.info("no content is sent")}async sendContent(e){if(!e.parts)throw new Error("Content must have parts.");if(e.parts[0].functionResponse){let n=e.parts.map(o=>o.functionResponse).filter(o=>!!o);N.debug("Sending LLM function response:",n),this.geminiSession.sendToolResponse({functionResponses:n})}else N.debug("Sending LLM new content",e),ao(this.modelVersion)&&e.parts.length===1&&e.parts[0].text?(N.debug("Using sendRealtimeInput for Gemini 3.x text input"),this.geminiSession.sendRealtimeInput({text:e.parts[0].text})):this.geminiSession.sendClientContent({turns:[e],turnComplete:!0})}async sendRealtime(e){var r,i,s;N.debug("Sending LLM Blob:",e);let n=ao(this.modelVersion),o=(r=this.modelVersion)==null?void 0:r.includes("native-audio");n||o?(i=e.mimeType)!=null&&i.startsWith("audio/")?this.geminiSession.sendRealtimeInput({audio:e}):(s=e.mimeType)!=null&&s.startsWith("image/")?this.geminiSession.sendRealtimeInput({video:e}):N.warn("Blob not sent. Unknown or empty mime type for sendRealtimeInput:",e.mimeType):this.geminiSession.sendRealtimeInput({media:e})}async sendActivityStart(){this.geminiSession.sendRealtimeInput({activityStart:{}})}async sendActivityEnd(){this.geminiSession.sendRealtimeInput({activityEnd:{}})}async*receive(){if(!this.messageQueue)throw new Error("Message queue is not initialized.");let e=new Vf(this.modelVersion);for await(let n of this.messageQueue){N.debug("Got LLM Live message:",n);for(let o of e.processMessage(n))yield o}for(let n of e.close())yield n}async close(){this.geminiSession.close()}};a($I,"GeminiLlmConnection");var Zf=$I;function fM(t){switch(t.split("/")[0]){case"image":return"image";case"audio":return"audio";case"video":return"video";default:return"document"}}a(fM,"getInteractionMediaType");function g3(t){if(!t||t.length===0)return[];let e=[];for(let o=t.length-1;o>=0;o--){let r=t[o];if(r.role==="user")e.unshift(r);else break}let n=!1;for(let o of e){if(o.parts){for(let r of o.parts)if(r.functionResponse!==void 0&&r.functionResponse!==null){n=!0;break}}if(n)break}if(n&&t.length>e.length){let o=t.length-e.length;if(o>0){let r=t[o-1];if(r.role==="model"&&r.parts){for(let i of r.parts)if(i.functionCall!==void 0&&i.functionCall!==null)return[r,...e]}}}return e}a(g3,"getLatestUserContents");function pM(t){if(t.text!==void 0&&t.text!==null)return{type:"text",text:t.text};if(t.inlineData!==void 0&&t.inlineData!==null){let e=t.inlineData.mimeType||"";return{type:fM(e),data:t.inlineData.data,mime_type:e}}if(t.fileData!==void 0&&t.fileData!==null){let e=t.fileData.mimeType||"";return{type:fM(e),uri:t.fileData.fileUri,mime_type:e}}return null}a(pM,"convertPartToMediaContent");function h3(t){let e=[],n=t.role||"user";if(n==="user"){let o=[];if(t.parts)for(let r of t.parts)if(r.functionResponse)e.push({type:"function_result",call_id:r.functionResponse.id||"",name:r.functionResponse.name||"",result:r.functionResponse.response});else if(r.codeExecutionResult){let i=r.codeExecutionResult.outcome===mn.OUTCOME_FAILED||r.codeExecutionResult.outcome===mn.OUTCOME_DEADLINE_EXCEEDED;e.push({type:"code_execution_result",call_id:"",result:r.codeExecutionResult.output||"",is_error:i})}else{let i=pM(r);i&&o.push(i)}o.length>0&&e.push({type:"user_input",content:o})}else if(n==="model"){let o=[];if(t.parts)for(let r of t.parts)if(r.functionCall){let i={type:"function_call",id:r.functionCall.id||"",name:r.functionCall.name||"",arguments:r.functionCall.args||{}};r.thoughtSignature&&(i.signature=r.thoughtSignature),e.push(i)}else if(r.executableCode)e.push({type:"code_execution_call",id:"",arguments:{code:r.executableCode.code||"",language:"python"}});else if(r.thought){let i={type:"thought"};r.thoughtSignature&&(i.signature=r.thoughtSignature),e.push(i)}else{let i=pM(r);i&&o.push(i)}o.length>0&&e.push({type:"model_output",content:o})}return e}a(h3,"convertContentToSteps");function OI(t){if(t.type==="text")return{text:t.text||""};if(t.type==="image"||t.type==="audio"||t.type==="video"||t.type==="document"){let e=t;if(e.data)return{inlineData:{data:e.data,mimeType:e.mime_type||""}};if(e.uri)return{fileData:{fileUri:e.uri,mimeType:e.mime_type||""}}}return null}a(OI,"convertMediaContentToPart");function v3(t){if(!t||!t.type)return[];switch(t.type){case"model_output":{let e=t,n=[];if(e.content)for(let o of e.content){let r=OI(o);r&&n.push(r)}return n}case"user_input":{let e=t,n=[];if(e.content)for(let o of e.content){let r=OI(o);r&&n.push(r)}return n}case"function_call":{let e=t,n={functionCall:{id:e.id,name:e.name,args:e.arguments||{}}};return e.signature&&(n.thoughtSignature=e.signature),[n]}case"function_result":{let e=t,n=e.result;return[{functionResponse:{id:e.call_id,name:e.name||"",response:typeof n=="object"&&n!==null?n:{output:n}}}]}case"code_execution_call":{let n=t.arguments||{};return[{executableCode:{code:n.code||"",language:(n.language||"PYTHON").toUpperCase()}}]}case"code_execution_result":{let e=t;return[{codeExecutionResult:{output:e.result||"",outcome:e.is_error?mn.OUTCOME_FAILED:mn.OUTCOME_OK}}]}case"thought":{let e=t,n={thought:!0};return e.signature&&(n.thoughtSignature=e.signature),[n]}default:return[]}}a(v3,"convertStepToParts");function y3(t){if(!t.tools)return[];let e=[];for(let n of t.tools){let o=n;if(o.functionDeclarations)for(let r of o.functionDeclarations){let i={type:"function",name:r.name};if(r.description&&(i.description=r.description),r.parameters){if(r.parameters.properties){let s={};for(let[u,c]of Object.entries(r.parameters.properties))s[u]=JSON.parse(JSON.stringify(c));i.parameters={type:"object",properties:s,required:r.parameters.required?[...r.parameters.required]:void 0}}}else r.parametersJsonSchema&&(i.parameters=r.parametersJsonSchema);e.push(i)}o.googleSearch&&e.push({type:"google_search"}),o.codeExecution&&e.push({type:"code_execution"}),o.urlContext&&e.push({type:"url_context"})}return e}a(y3,"convertToolsConfigToInteractionsFormat");function DI(t,e){for(let n=t.length-1;n>=0;n--)if(e(t[n]))return t[n]}a(DI,"findLastPart");function _3(t){if(!t||t.length===0)return[];let e=[];for(let n=t.length-1;n>=0;n--){let o=t[n];if(o.type==="user_input"||o.type==="function_result"||o.type==="code_execution_result")break;let r=v3(o);e.unshift(...r)}return e}a(_3,"getLatestModelParts");function x3(t){if(t.status==="failed"){let i="Unknown error",s="UNKNOWN_ERROR";return t.error&&(i=t.error.message||i,s=t.error.code||s),{errorCode:s,errorMessage:i,interactionId:t.id}}let e=_3(t.steps||[]),n;e.length>0&&(n={role:"model",parts:e});let o;if(t.usage){let i=t.usage.total_input_tokens||0,s=t.usage.total_output_tokens||0;o={promptTokenCount:i,candidatesTokenCount:s,totalTokenCount:i+s}}let r;return(t.status==="completed"||t.status==="requires_action")&&(r="STOP"),{content:n,usageMetadata:o,finishReason:r,turnComplete:t.status==="completed"||t.status==="requires_action",interactionId:t.id}}a(x3,"convertInteractionToLlmResponse");function E3(t,e,n){var r,i;let o=t.event_type||t.eventType;if(o==="step.start"){let u=t.step;if(u.type==="function_call"){let c=u,l={functionCall:{id:c.id,name:c.name,args:{}},partMetadata:{accumulatedArgs:"",isComplete:!1}};return c.signature&&(l.thoughtSignature=c.signature),e.push(l),null}if(u.type==="thought"){let c={thought:!0,partMetadata:{isComplete:!1}};return u.signature&&(c.thoughtSignature=u.signature),e.push(c),null}}else if(o==="step.delta"){let u=t.delta;if(!u)return null;if(u.type==="text"){let c=u.text||"";if(c){let l={text:c};return e.push(l),{content:{role:"model",parts:[l]},partial:!0,turnComplete:!1,interactionId:n}}}else if(u.type==="arguments_delta"){let c=DI(e,l=>!!(l.functionCall&&l.partMetadata&&!l.partMetadata.isComplete));return c&&c.partMetadata&&u.arguments&&(c.partMetadata.accumulatedArgs=c.partMetadata.accumulatedArgs+u.arguments),null}else if(u.type==="thought_signature"){let c=DI(e,l=>!!((l.thought||l.functionCall)&&l.partMetadata&&!l.partMetadata.isComplete));return c&&u.signature&&(c.thoughtSignature=u.signature),null}else if(u.type==="image"||u.type==="audio"||u.type==="video"||u.type==="document"){let c=OI(u);if(c)return e.push(c),{content:{role:"model",parts:[c]},partial:!1,turnComplete:!1,interactionId:n}}}else if(o==="step.stop"){let s=DI(e,u=>!!(u.partMetadata&&!u.partMetadata.isComplete));if(s&&s.partMetadata){if(s.partMetadata.isComplete=!0,s.functionCall){let u=s.partMetadata.accumulatedArgs;try{s.functionCall.args=u?JSON.parse(u):{}}catch(c){N.error(`Failed to parse accumulated arguments: ${u}`,c),s.functionCall.args={}}return delete s.partMetadata,{content:{role:"model",parts:[s]},partial:!1,turnComplete:!1,interactionId:n}}if(s.thought)return delete s.partMetadata,null}}else{if(o==="interaction.completed")return{content:e.length>0?{role:"model",parts:[...e]}:void 0,partial:!1,turnComplete:!0,finishReason:"STOP",interactionId:n};if(o==="interaction.status_update"){let s=t,u=s.status;if(u==="completed"||u==="requires_action")return{content:e.length>0?{role:"model",parts:[...e]}:void 0,partial:!1,turnComplete:!0,finishReason:"STOP",interactionId:n};if(u==="failed"){let c=s.error;return{errorCode:c?c.code:"UNKNOWN_ERROR",errorMessage:c?c.message:"Unknown error",turnComplete:!0,interactionId:n}}}else if(o==="error")return{errorCode:((r=t.error)==null?void 0:r.code)||t.code||"UNKNOWN_ERROR",errorMessage:((i=t.error)==null?void 0:i.message)||t.message||"Unknown error",turnComplete:!0,interactionId:n}}return null}a(E3,"convertInteractionEventToLlmResponse");function S3(t){let e={};return t.temperature!==void 0&&t.temperature!==null&&(e.temperature=t.temperature),t.topP!==void 0&&t.topP!==null&&(e.top_p=t.topP),t.topK!==void 0&&t.topK!==null&&(e.top_k=t.topK),t.maxOutputTokens!==void 0&&t.maxOutputTokens!==null&&(e.max_output_tokens=t.maxOutputTokens),t.stopSequences&&(e.stop_sequences=t.stopSequences),t.presencePenalty!==void 0&&t.presencePenalty!==null&&(e.presence_penalty=t.presencePenalty),t.frequencyPenalty!==void 0&&t.frequencyPenalty!==null&&(e.frequency_penalty=t.frequencyPenalty),e}a(S3,"buildGenerationConfig");function T3(t){let e=t.systemInstruction;if(e){if(typeof e=="string")return e;if(typeof e=="object"&&"parts"in e&&Array.isArray(e.parts)){let n=[];for(let o of e.parts){let r=o;r.text&&n.push(r.text)}return n.length>0?n.join(`
88
+ `):void 0}}}a(T3,"extractSystemInstruction");function C3(t){if(t.interaction_id||t.interactionId)return t.interaction_id||t.interactionId;if(t.interaction&&t.interaction.id)return t.interaction.id;if(t.event_type==="interaction"||t.eventType==="interaction")return t.id}a(C3,"extractStreamInteractionId");async function*mM(t,e,n){let o=e.contents;e.previousInteractionId&&o&&(o=g3(o));let r=[];if(o)for(let p of o)r.push(...h3(p));let i=y3(e.config||{}),s=T3(e.config||{}),u=S3(e.config||{}),c=e.previousInteractionId;N.info(`Sending request via interactions API, model: ${e.model}, stream: ${n}, previous_interaction_id: ${c}`);let l=c;if(n){let p=await t.interactions.create({model:e.model||"gemini-2.5-flash",input:r,stream:!0,system_instruction:s,tools:i.length>0?i:void 0,generation_config:Object.keys(u).length>0?u:void 0,previous_interaction_id:c}),d=[];for await(let g of p){let h=C3(g);h&&(l=h);let v=E3(g,d,l);v&&(yield v)}d.length>0&&(yield{content:{role:"model",parts:d},partial:!1,turnComplete:!0,finishReason:"STOP",interactionId:l})}else{let p=await t.interactions.create({model:e.model||"gemini-2.5-flash",input:r,stream:!1,system_instruction:s,tools:i.length>0?i:void 0,generation_config:Object.keys(u).length>0?u:void 0,previous_interaction_id:c});N.info("Interaction response received from the model."),yield x3(p)}}a(mM,"generateContentViaInteractions");var LI=Symbol.for("google.adk.geminiModel");function yM(t){return typeof t=="object"&&t!==null&&LI in t&&t[LI]===!0}a(yM,"isGemini");var hM,vM,Hf=class Hf extends(vM=Yn,hM=LI,vM){constructor({model:n,apiKey:o,vertexai:r,project:i,location:s,headers:u,useInteractionsApi:c}){n||(n="gemini-2.5-flash");super({model:n});this[hM]=!0;let l=Jf({model:n,vertexai:r,project:i,location:s,apiKey:o});if(!l.vertexai&&!l.apiKey)throw new Error("API key must be provided via constructor or the GOOGLE_GENAI_API_KEY, GOOGLE_API_KEY or GEMINI_API_KEY environment variable.");this.project=l.project,this.location=l.location,this.apiKey=l.apiKey,this.headers=u,this.vertexai=!!l.vertexai,this.useInteractionsApi=!!c}async*generateContentAsync(n,o=!1,r){var i,s,u;if(this.useInteractionsApi){yield*mM(this.apiClient,n,o);return}if(this.preprocessRequest(n),this.maybeAppendUserContent(n),N.info(`Sending out request, model: ${(i=n.model)!=null?i:this.model}, backend: ${this.apiBackend}, stream: ${o}`),n.config||(n.config={}),n.config.httpOptions&&(n.config.httpOptions.headers={...n.config.httpOptions.headers,...this.trackingHeaders}),r&&(n.config.abortSignal=r),o){let c=await this.apiClient.models.generateContentStream({model:(s=n.model)!=null?s:this.model,contents:n.contents,config:n.config}),l=new Bf;for await(let d of c)for await(let g of l.processResponse(d))yield g;let p=l.close();p&&(yield p)}else{let c=await this.apiClient.models.generateContent({model:(u=n.model)!=null?u:this.model,contents:n.contents,config:n.config});yield Gf(c)}}getHttpOptions(){return{headers:{...this.trackingHeaders,...this.headers}}}get apiClient(){return this._apiClient?this._apiClient:(this.vertexai?this._apiClient=new qr({vertexai:this.vertexai,project:this.project,location:this.location,httpOptions:this.getHttpOptions()}):this._apiClient=new qr({apiKey:this.apiKey,httpOptions:this.getHttpOptions()}),this._apiClient)}get apiBackend(){return this._apiBackend||(this._apiBackend=this.apiClient.vertexai?"VERTEX_AI":"GEMINI_API"),this._apiBackend}get liveApiVersion(){return this._liveApiVersion||(this._liveApiVersion=this.apiBackend==="VERTEX_AI"?"v1beta1":"v1alpha"),this._liveApiVersion}getLiveHttpOptions(){return{headers:this.trackingHeaders,apiVersion:this.liveApiVersion}}get liveApiClient(){return this._liveApiClient||(this.vertexai?this._liveApiClient=new qr({vertexai:this.vertexai,project:this.project,location:this.location||"global",httpOptions:this.getLiveHttpOptions()}):this._liveApiClient=new qr({apiKey:this.apiKey,httpOptions:this.getLiveHttpOptions()})),this._liveApiClient}async connect(n){var s,u,c,l;if((s=n.liveConnectConfig)!=null&&s.httpOptions&&(n.liveConnectConfig.httpOptions.headers||(n.liveConnectConfig.httpOptions.headers={}),Object.assign(n.liveConnectConfig.httpOptions.headers,this.trackingHeaders),n.liveConnectConfig.httpOptions.apiVersion=this.liveApiVersion),(u=n.config)!=null&&u.systemInstruction&&(n.liveConnectConfig.systemInstruction={role:"system",parts:[oi(n.config.systemInstruction)]}),n.liveConnectConfig.tools=(c=n.config)==null?void 0:c.tools,this.apiBackend==="GEMINI_API"){let p=n.liveConnectConfig.sessionResumption;p&&delete p.transparent}let o=(l=n.model)!=null?l:this.model,r=new cn,i=await this.liveApiClient.live.connect({model:o,config:n.liveConnectConfig,callbacks:{onmessage:a(p=>{r.push(p)},"onmessage"),onerror:a(p=>{r.error(p)},"onerror"),onclose:a(()=>{r.close()},"onclose")}});return new Zf(i,o,r)}preprocessRequest(n){if(this.apiBackend==="GEMINI_API"&&(n.config&&(n.config.labels=void 0),n.contents)){for(let o of n.contents)if(o.parts)for(let r of o.parts)gM(r.inlineData),gM(r.fileData)}}};a(Hf,"Gemini"),Hf.supportedModels=[/gemini-.*/,/projects\/.+\/locations\/.+\/endpoints\/.+/,/projects\/.+\/locations\/.+\/publishers\/google\/models\/gemini.+/];var uo=Hf;function gM(t){t&&t.displayName&&(t.displayName=void 0)}a(gM,"removeDisplayNameIfPresent");function Jf({model:t,vertexai:e,project:n,location:o,apiKey:r}){let i={model:t,vertexai:e,project:n,location:o,apiKey:r};if(i.vertexai=!!e,!i.vertexai&&!jt()&&(i.vertexai=Zu()),i.vertexai){if(!jt()&&!i.project&&(i.project=process.env.GOOGLE_CLOUD_PROJECT),!jt()&&!i.location&&(i.location=process.env.GOOGLE_CLOUD_LOCATION),!i.project)throw new Error("VertexAI project must be provided via constructor or GOOGLE_CLOUD_PROJECT environment variable.");if(!i.location)throw new Error("VertexAI location must be provided via constructor or GOOGLE_CLOUD_LOCATION environment variable.")}else!i.apiKey&&!jt()&&(i.apiKey=process.env.GOOGLE_GENAI_API_KEY||process.env.GOOGLE_API_KEY||process.env.GEMINI_API_KEY);return i}a(Jf,"geminiInitParams");var _M="APIGEE_PROXY_URL",Kf=class Kf extends uo{constructor({model:e,proxyUrl:n,apiKey:o,vertexai:r,location:i,project:s,headers:u}){var c;if(!EM(e))throw new Error(`Model ${e} is not a valid Apigee model, expected apigee/[<provider>/][<version>/]<model_id>`);if(super({...I3({model:e,vertexai:r,project:s,location:i,apiKey:o}),headers:u}),this.proxyUrl=n!=null?n:"",!jt()&&!this.proxyUrl&&(this.proxyUrl=(c=process.env[_M])!=null?c:""),!this.proxyUrl)throw new Error(`Proxy URL must be provided via the constructor or ${_M} environment variable.`)}getHttpOptions(){let e=super.getHttpOptions();return e.baseUrl=this.proxyUrl,e}getLiveHttpOptions(){let e=super.getLiveHttpOptions();return e.baseUrl=this.proxyUrl,e}identifyApiVersion(){let n=(this.model.startsWith("apigee/")?this.model.substring(7):this.model).split("/");return n.length===3?n[1]:n.length===2&&n[0]!="vertex_ai"&&n[0]!="gemini"&&n[0].startsWith("v")?n[0]:this.vertexai?"v1beta1":"v1alpha"}get liveApiVersion(){return this._apigeeLiveApiVersion||(this._apigeeLiveApiVersion=this.identifyApiVersion()),this._apigeeLiveApiVersion}async*generateContentAsync(e,n=!1,o){var i;let r=(i=e.model)!=null?i:this.model;e.model=xM(r),yield*super.generateContentAsync(e,n,o)}async connect(e){var o;let n=(o=e.model)!=null?o:this.model;return e.model=xM(n),super.connect(e)}};a(Kf,"ApigeeLlm"),Kf.supportedModels=[/apigee\/.*/];var _u=Kf;function I3({model:t,vertexai:e,project:n,location:o,apiKey:r}){var s;let i=Jf({model:t,vertexai:e,project:n,location:o,apiKey:r});return i.vertexai=i.vertexai||((s=i.model)==null?void 0:s.startsWith("apigee/vertex_ai/")),i.vertexai||i.apiKey||(N.warn('No API key provided when using a Gemini model, using a fake key "-".'),i.apiKey="-"),i}a(I3,"apigeeToGeminiInitParams");function xM(t){if(!EM(t))throw new Error(`Model ${t} is not a valid Apigee model, expected apigee/[<provider>/][<version>/]<model_id>`);let e=t.split("/");return e[e.length-1]}a(xM,"getModelId");function EM(t){let e=["vertex_ai","gemini"];if(!t.startsWith("apigee/"))return!1;let n=t.substring(7);if(n.length===0)return!1;let o=n.split("/");return o[o.length-1].length===0?!1:o.length==1?!0:o.length==2?e.includes(o[0])?!0:o[0].startsWith("v"):o.length==3&&e.includes(o[0])?o[1].startsWith("v"):!1}a(EM,"validateModel");function wn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(wn,"isRecord");function SM(t){return wn(t.parametersJsonSchema)?t.parametersJsonSchema:t.parameters?Sn(t.parameters):{type:"object",properties:{}}}a(SM,"argumentSchema");function TM(t){var n,o;let e=[];for(let r of(o=(n=t.config)==null?void 0:n.tools)!=null?o:[])wn(r)&&Array.isArray(r.functionDeclarations)&&e.push(...r.functionDeclarations);return e}a(TM,"collectFunctionDeclarations");function CM(t){let e=[{type:"object",properties:{kind:{type:"string",enum:["final"]},text:{type:"string"}},required:["kind","text"]}];for(let n of t)n.name&&e.push({type:"object",properties:{kind:{type:"string",enum:["tool"]},name:{type:"string",enum:[n.name]},args:SM(n)},required:["kind","name","args"]});return e.length===1?e[0]:{anyOf:e}}a(CM,"buildToolChoiceSchema");function IM(t){return t.length?["You can call these tools:",...t.map(n=>{var o;return`- ${n.name}: ${(o=n.description)!=null?o:""}
89
+ arguments: ${JSON.stringify(SM(n))}`}),"",'Reply with JSON only. To call a tool use {"kind":"tool","name":<tool>,"args":{...}}.','When you have the answer use {"kind":"final","text":<answer>}.'].join(`
90
+ `):""}a(IM,"renderToolInstructions");function A3(t){if(t==null)return"{}";let e=t;if(wn(e)&&Object.keys(e).length===1&&"result"in e&&(e=e.result),typeof e=="string"){let n=e.trim();if(n.startsWith("{")||n.startsWith("["))try{return JSON.stringify(JSON.parse(n))}catch(o){return n}return n}try{return JSON.stringify(e)}catch(n){return String(e)}}a(A3,"renderToolResult");function AM(t){var n,o;let e=[];for(let r of t!=null?t:[]){let i=r.role==="model"?"assistant":"user",s=[];for(let u of(n=r.parts)!=null?n:[]){if(u.text&&s.push(u.text),u.functionCall){let c=JSON.stringify((o=u.functionCall.args)!=null?o:{});s.push(`[tool_call] ${u.functionCall.name}(${c})`)}if(u.functionResponse){let c=A3(u.functionResponse.response);s.push(`[tool_result] ${u.functionResponse.name} -> ${c}`)}}s.length&&e.push({role:i,content:s.join(`
91
+ `)})}return e}a(AM,"contentsToMessages");function wM(t){var n;let e=(n=t.config)==null?void 0:n.systemInstruction;return e?typeof e=="string"?e:Array.isArray(e)?e.map(o=>{var r;return typeof o=="string"?o:(r=o==null?void 0:o.text)!=null?r:""}).filter(Boolean).join(`
92
+ `):wn(e)&&Array.isArray(e.parts)?e.parts.map(o=>{var r;return(r=o.text)!=null?r:""}).filter(Boolean).join(`
93
+ `):String(e):""}a(wM,"extractSystemInstruction");function bM(t){return t.replace(/^You are an agent\. Your internal name is "[^"]*"\.\s*/m,"").replace(/^The description about you is "[^"]*"\s*/m,"").trimStart()}a(bM,"stripAdkIdentityPreamble");function RM(t){return wn(t)&&t.name==="AbortError"}a(RM,"isAbortError");function xu(t){return{content:{role:"model",parts:[{text:t}]},turnComplete:!0}}a(xu,"finalText");function kM(t){let e=wn(t)?t:{},n=typeof e.name=="string"?e.name:"UnknownError",o=typeof e.message=="string"?e.message:String(t);return n==="QuotaExceededError"?{errorCode:n,errorMessage:`Prompt exceeded the context window (requested ${e.requested} of ${e.quota} tokens).`,turnComplete:!0}:{errorCode:n,errorMessage:o,turnComplete:!0}}a(kM,"errorResponse");var MI=class MI extends Error{constructor(n){super(n==="missing-api"?"This browser does not expose the Prompt API (globalThis.LanguageModel is undefined).":`Chrome's built-in model is not available (availability: "${n}").`);this.availability=n;this.name="ChromeModelUnavailableError"}};a(MI,"ChromeModelUnavailableError");var Eu=MI,Wf=class Wf extends Yn{constructor(e={}){var n;super({model:(n=e.model)!=null?n:"chrome-on-device"}),this.params=e}get api(){var n;let e=(n=this.params.languageModel)!=null?n:globalThis.LanguageModel;if(!e)throw new Eu("missing-api");return e}async availability(){try{return await this.api.availability({expectedInputs:this.params.expectedInputs,expectedOutputs:this.params.expectedOutputs})}catch(e){return"unavailable"}}diagnostic(e){var n,o;(o=(n=this.params).onDiagnostic)==null||o.call(n,e)}async acquireSession(e,n){var i,s;let o=JSON.stringify([e,this.params.temperature,this.params.topK,this.params.expectedInputs]);(this.baseSessionKey!==o||!this.baseSessionPromise)&&((s=(i=this.baseSession)==null?void 0:i.destroy)==null||s.call(i),this.baseSession=void 0,this.baseSessionKey=o,this.baseSessionPromise=this.createBaseSession(e));let r;try{r=await this.baseSessionPromise}catch(u){throw this.baseSessionPromise=void 0,this.baseSessionKey=void 0,u}return r.clone({signal:n})}async createBaseSession(e){var s,u;let n=await this.availability();if(n==="unavailable")throw new Eu(n);let o={};this.params.onDownloadProgress&&(o.monitor=c=>{c.addEventListener("downloadprogress",l=>{this.params.onDownloadProgress(l.loaded)})}),e&&(o.initialPrompts=[{role:"system",content:e}]),this.params.expectedInputs&&(o.expectedInputs=this.params.expectedInputs),this.params.expectedOutputs&&(o.expectedOutputs=this.params.expectedOutputs),this.params.temperature!==void 0&&(o.temperature=this.params.temperature,o.topK=(s=this.params.topK)!=null?s:3);let r=performance.now(),i;try{i=await this.api.create(o)}catch(c){if(this.params.temperature===void 0)throw c;delete o.temperature,delete o.topK,i=await this.api.create(o)}return this.diagnostic({phase:"create",ms:performance.now()-r}),(u=i.addEventListener)==null||u.call(i,"contextoverflow",()=>{this.diagnostic({phase:"context-overflow",note:"history truncated by the browser",contextUsage:i.contextUsage,contextWindow:i.contextWindow})}),this.baseSession=i,i}async*generateContentAsync(e,n=!1,o){var d,g,h,v;let r=TM(e),i=r.length>0,s=wM(e),u=[this.params.normalizeSystemPrompt?this.params.normalizeSystemPrompt(s):s];i&&u.push(IM(r));let c=u.filter(Boolean).join(`
94
+
95
+ `);this.maybeAppendUserContent(e);let l=AM((d=e.contents)!=null?d:[]),p;try{p=await this.acquireSession(c,o);let y=(g=e.config)==null?void 0:g.responseJsonSchema,_=(h=e.config)==null?void 0:h.responseSchema,x;if(i?x=CM(r):wn(y)?x=y:_&&(x=Sn(_)),n&&!x){yield*this.streamText(p,l,o);return}let E=await this.promptOnce(p,l,x,o);yield i?this.parseToolChoice(E,r):xu(E)}catch(y){if(RM(y))throw y;yield kM(y)}finally{p&&p!==this.baseSession&&((v=p.destroy)==null||v.call(p))}}async promptOnce(e,n,o,r){let i=performance.now(),s=await e.prompt(n,{signal:r,...o?{responseConstraint:o,omitResponseConstraintInput:!0}:{}});return this.diagnostic({phase:"prompt",ms:performance.now()-i,contextUsage:e.contextUsage,contextWindow:e.contextWindow}),s}async*streamText(e,n,o){let r=e.promptStreaming(n,{signal:o}).getReader(),i="";try{for(;;){let{done:s,value:u}=await r.read();if(s)break;i+=u,yield{content:{role:"model",parts:[{text:u}]},partial:!0}}}finally{await r.cancel(),r.releaseLock()}yield{content:{role:"model",parts:[{text:i}]},turnComplete:!0}}parseToolChoice(e,n){let o;try{o=JSON.parse(e)}catch(r){let i=e.match(/\{[\s\S]*\}/);if(i)try{o=JSON.parse(i[0])}catch(s){}}if(!wn(o))return this.diagnostic({phase:"parse-fallback",note:"unparseable JSON; treated as text"}),xu(e);if(o.kind==="tool"&&typeof o.name=="string"){let r=o.name;if(!n.some(s=>s.name===r))return xu(`The model requested an unknown tool "${r}".`);let i=wn(o.args)?o.args:{};return{content:{role:"model",parts:[{functionCall:{id:bt(),name:r,args:i}}]},turnComplete:!0}}return xu(typeof o.text=="string"?o.text:e)}async connect(e){throw new Error("Chrome's Prompt API has no bidirectional live mode, so connect() is not supported by ChromeBuiltInLlm.")}destroy(){var e,n;(n=(e=this.baseSession)==null?void 0:e.destroy)==null||n.call(e),this.baseSession=void 0,this.baseSessionPromise=void 0,this.baseSessionKey=void 0}};a(Wf,"ChromeBuiltInLlm"),Wf.supportedModels=[/chrome-on-device/,/chrome\/.*/];var Su=Wf;var FI=class FI{constructor(e){this.maxSize=e,this.cache=new Map}get(e){let n=this.cache.get(e);return n&&(this.cache.delete(e),this.cache.set(e,n)),n}set(e,n){if(this.cache.size>=this.maxSize&&!this.cache.has(e)){let o=this.cache.keys().next().value;o!==void 0&&this.cache.delete(o)}this.cache.set(e,n)}};a(FI,"LRUCache");var UI=FI,Ot=class Ot{static newLlm(e){return new(Ot.resolve(e))({model:e})}static _register(e,n){Ot.llmRegistryDict.has(e)&&N.info(`Updating LLM class for ${e} from ${Ot.llmRegistryDict.get(e)} to ${n}`),Ot.llmRegistryDict.set(e,n)}static register(e){for(let n of e.supportedModels)Ot._register(n,e)}static resolve(e){let n=Ot.resolveCache.get(e);if(n)return n;for(let[o,r]of Ot.llmRegistryDict.entries())if(new RegExp(`^${o instanceof RegExp?o.source:o}$`,o instanceof RegExp?o.flags:void 0).test(e))return Ot.resolveCache.set(e,r),r;throw new Error(`Model ${e} not found.`)}};a(Ot,"LLMRegistry"),Ot.llmRegistryDict=new Map,Ot.resolveCache=new UI(32);var Or=Ot;Or.register(uo);Or.register(_u);Or.register(Su);function _s(t){return xf()==="VERTEX_AI"&&Qn(t)}a(_s,"canUseOutputSchemaWithTools");var GI=class GI{};a(GI,"BaseLlmRequestProcessor");var De=GI,BI=class BI{};a(BI,"BaseLlmResponseProcessor");var zI=BI;function xs(t){if(Array.isArray(t))return t.map(xs);if(t!==null&&typeof t=="object"&&t.constructor===Object){let e=t,n={};for(let o of Object.keys(e)){let r=o.replace(/_([a-z])/g,(i,s)=>s.toUpperCase());n[r]=xs(e[o])}return n}return t}a(xs,"camelCaseKeys");var w3="_adk_toolset_auth_";function b3(t,e,n){let o=new Map;for(let r of t)if(r.author===n)for(let i of le(r)){if(!i.id||!e.has(i.id)||i.name!==qe)continue;let s=xs(i.args);s!=null&&s.authConfig&&o.set(i.id,{config:s.authConfig,args:s})}return o}a(b3,"requestedAuthConfigs");async function R3(t,e,n,o,r){var u;let i=b3(t,e,r),s=new Set;for(let c of e){let l=i.get(c);if(!l){N.warn(`Ignoring credential response '${c}': no matching request from this agent.`);continue}let p=bf(l.config,n[c]);if(!p){N.warn(`Ignoring credential response '${c}': it carries no credential for the request this agent raised.`);continue}await new Ht(p).parseAndStoreAuthResponse(o);let d=(u=l.args)==null?void 0:u.functionCallId;d&&!d.startsWith(w3)&&s.add(d)}return s}a(R3,"storeAuthAndCollectResumeTargets");var VI=class VI extends De{async*runAsync(e){let n=e.agent;if(!te(n))return;let o=e.session.events;if(!o||o.length===0)return;let r=null;for(let p=o.length-1;p>=0;p--){let d=o[p];if(d.content!==void 0){r=d;break}}if(!r||r.author!=="user")return;let i=fe(r);if(!i||i.length===0)return;let s=new Set,u={};for(let p of i)p.name===qe&&p.id&&(s.add(p.id),u[p.id]=p.response);if(s.size===0)return;let c=new me(e.session.state),l=await R3(o,s,u,c,n.name);if(l.size!==0)for(let p=o.length-2;p>=0;p--){let d=o[p],g=le(d);if(!g||g.length===0)continue;if(g.some(v=>v.id?l.has(v.id):!1)){let v=await n.canonicalTools(new Ie(e)),y={};for(let x of v)y[x.name]=x;let _=await fu({invocationContext:e,functionCallEvent:d,toolsDict:y,beforeToolCallbacks:n.canonicalBeforeToolCallbacks,afterToolCallbacks:n.canonicalAfterToolCallbacks,filters:l});_&&(yield _);return}}}};a(VI,"AuthPreprocessor");var jf=VI,qI=new jf;var ZI=class ZI extends De{constructor(){super(...arguments);this.toolName="transfer_to_agent"}buildTool(n){return new Dt({name:this.toolName,description:"Transfer the question to another agent. This tool hands off control to another agent when it is more suitable to answer the user question according to the agent description.",parameters:pe.object({agent_name:pe.enum(n).describe("the agent name to transfer to.")}),execute:a((o,r)=>{if(!r)throw new Error("toolContext is required.");return r.actions.transferToAgent=o.agent_name,"Transfer queued"},"execute")})}async*runAsync(n,o){if(!te(n.agent))return;let r=this.getTransferTargets(n.agent);if(!r.length)return;Ve(o,[this.buildTargetAgentsInstructions(n.agent,r)]);let i=new Le({invocationContext:n}),s=r.map(u=>u.name);await this.buildTool(s).processLlmRequest({toolContext:i,llmRequest:o})}buildTargetAgentsInfo(n){return`
96
+ Agent name: ${n.name}
97
+ Agent description: ${n.description}
98
+ `}buildTargetAgentsInstructions(n,o){let r=`
99
+ You have a list of other agents to transfer to:
100
+
101
+ ${o.map(i=>this.buildTargetAgentsInfo(i)).join(`
102
+ `)}
103
+
104
+ If you are the best to answer the question according to your description, you
105
+ can answer it.
106
+
107
+ If another agent is better for answering the question according to its
108
+ description, call \`${this.toolName}\` function to transfer the
109
+ question to that agent. When transferring, do not generate any text other than
110
+ the function call.
111
+ `;return n.parentAgent&&!n.disallowTransferToParent&&(r+=`
112
+ Your parent agent is ${n.parentAgent.name}. If neither the other agents nor
113
+ you are best for answering the question according to the descriptions, transfer
114
+ to your parent agent.
115
+ `),r}getTransferTargets(n){let o=[];return o.push(...n.subAgents),!n.parentAgent||!te(n.parentAgent)||(n.disallowTransferToParent||o.push(n.parentAgent),n.disallowTransferToPeers||o.push(...n.parentAgent.subAgents.filter(r=>r.name!==n.name))),o}};a(ZI,"AgentTransferLlmRequestProcessor");var Yf=ZI,PM=new Yf;var JI=class JI extends De{async*runAsync(e,n){var r,i;let o=e.agent;te(o)&&(n.model=o.canonicalModel.model,n.config={...(r=o.generateContentConfig)!=null?r:{}},o.outputSchema&&o.mode!=="task"&&(!((i=o.tools)!=null&&i.length)||_s(o.canonicalModel.model))&&ML(n,o.outputSchema),e.runConfig&&(n.liveConnectConfig.responseModalities=e.runConfig.responseModalities,n.liveConnectConfig.speechConfig=e.runConfig.speechConfig,n.liveConnectConfig.outputAudioTranscription=e.runConfig.outputAudioTranscription,n.liveConnectConfig.inputAudioTranscription=e.runConfig.inputAudioTranscription,n.liveConnectConfig.realtimeInputConfig=e.runConfig.realtimeInputConfig,n.liveConnectConfig.enableAffectiveDialog=e.runConfig.enableAffectiveDialog,n.liveConnectConfig.proactivity=e.runConfig.proactivity))}};a(JI,"BasicLlmRequestProcessor");var HI=JI,NM=new HI;var KI=Symbol.for("google.adk.baseCodeExecutor");function Xf(t){return typeof t=="object"&&t!==null&&KI in t&&t[KI]===!0}a(Xf,"isBaseCodeExecutor");var $M;$M=KI;var WI=class WI{constructor(){this[$M]=!0;this.optimizeDataFile=!1;this.stateful=!1;this.errorRetryAttempts=2;this.codeBlockDelimiters=[["```tool_code\n","\n```"],["```python\n","\n```"],["```javascript\n","\n```"],["```typescript\n","\n```"],["```bash\n","\n```"],["```sh\n","\n```"]];this.executionResultDelimiters=["```tool_output\n","\n```"]}};a(WI,"BaseCodeExecutor");var Tu=WI;var jI=Symbol.for("google.adk.builtInCodeExecutor");function Iu(t){return typeof t=="object"&&t!==null&&jI in t&&t[jI]===!0}a(Iu,"isBuiltInCodeExecutor");var DM,OM,YI=class YI extends(OM=Tu,DM=jI,OM){constructor(){super(...arguments);this[DM]=!0}executeCode(n){return Promise.resolve({stdout:"",stderr:"",outputFiles:[]})}processLlmRequest(n){if(n.model&&Qn(n.model)){n.config=n.config||{},n.config.tools=n.config.tools||[],n.config.tools.push({codeExecution:{}});return}throw new Error(`Gemini code execution tool is not supported for model ${n.model}`)}};a(YI,"BuiltInCodeExecutor");var Cu=YI;var LM=(n=>(n.UTF8="utf-8",n.BASE64="base64",n))(LM||{}),XI=(u=>(u.UNSPECIFIED="unspecified",u.PYTHON="python",u.JAVASCRIPT="javascript",u.TYPESCRIPT="typescript",u.SHELL="shell",u.POWERSHELL="powershell",u.WINDOWS_CMD="cmd",u))(XI||{});function MM(t,e){var p;if(!((p=t.parts)!=null&&p.length))return"";for(let d=0;d<t.parts.length;d++){let g=t.parts[d];if(g.executableCode&&(d===t.parts.length-1||!t.parts[d+1].codeExecutionResult))return t.parts=t.parts.slice(0,d+1),g.executableCode.code||""}let n=t.parts.filter(d=>d.text);if(!n.length)return"";let o=ze(n[0]),r=n.map(d=>d.text).join(`
116
+ `),i=e.map(d=>d[0]).join("|"),s=e.map(d=>d[1]).join("|"),u=new RegExp(`(?<prefix>.*?)(${i})(?<codeStr>.*?)(${s})(?<suffix>.*?)$`,"s").exec(r),{prefix:c,codeStr:l}=(u==null?void 0:u.groups)||{};return l?(t.parts=[],c&&(o.text=c,t.parts.push(o)),t.parts.push(QI(l)),l):""}a(MM,"extractCodeAndTruncateContent");function QI(t){return{text:t,executableCode:{code:t,language:Rl.PYTHON}}}a(QI,"buildExecutableCodePart");function UM(t){if(t.stderr)return{text:t.stderr,codeExecutionResult:{outcome:mn.OUTCOME_FAILED}};let e=[];return(t.stdout||!t.outputFiles)&&e.push(`Code execution result:
117
+ ${t.stdout}
118
+ `),t.outputFiles&&e.push(`Saved artifacts:
119
+ `+t.outputFiles.map(n=>n.name).join(", ")),{text:e.join(`
120
+
121
+ `),codeExecutionResult:{outcome:mn.OUTCOME_OK}}}a(UM,"buildCodeExecutionResultPart");function FM(t,e,n){var r;if(!((r=t.parts)!=null&&r.length))return;let o=t.parts[t.parts.length-1];o.executableCode?t.parts[t.parts.length-1]={text:e[0]+(o.executableCode.code||"")+e[1]}:t.parts.length==1&&o.codeExecutionResult&&(t.parts[t.parts.length-1]={text:n[0]+o.codeExecutionResult.output+n[1]},t.role="user")}a(FM,"convertCodeExecutionParts");var eA="_code_execution_context",tA="execution_session_id",lo="processed_input_files",co="_code_executor_input_files",fo="_code_executor_error_counts",nA="_code_execution_results",rA=class rA{constructor(e){this.sessionState=e;var n;this.context=(n=e.get(eA))!=null?n:{},this.sessionState=e}getStateDelta(){return{[eA]:ze(this.context)}}getExecutionId(){if(tA in this.context)return this.context[tA]}setExecutionId(e){this.context[tA]=e}getProcessedFileNames(){return lo in this.context?this.context[lo]:[]}addProcessedFileNames(e){lo in this.context||(this.context[lo]=[]),this.context[lo].push(...e)}getInputFiles(){return this.sessionState.has(co)?this.sessionState.get(co):[]}addInputFiles(e){this.sessionState.has(co)||this.sessionState.set(co,[]),this.sessionState.get(co).push(...e)}clearInputFiles(){this.sessionState.has(co)&&this.sessionState.set(co,[]),lo in this.context&&(this.context[lo]=[])}getErrorCount(e){return this.sessionState.has(fo)&&this.sessionState.get(fo)[e]||0}incrementErrorCount(e){this.sessionState.has(fo)||this.sessionState.set(fo,{}),this.sessionState.get(fo)[e]=this.getErrorCount(e)+1}resetErrorCount(e){if(!this.sessionState.has(fo))return;let n=this.sessionState.get(fo);e in n&&delete n[e]}updateCodeExecutionResult({invocationId:e,code:n,resultStdout:o,resultStderr:r}){this.sessionState.has(nA)||this.sessionState.set(nA,{});let i=this.sessionState.get(nA);e in i||(i[e]=[]),i[e].push({code:n,resultStdout:o,resultStderr:r,timestamp:Date.now()})}getCodeExecutionContext(){return this.sessionState.get(eA)||{}}};a(rA,"CodeExecutorContext");var Au=rA;var sA=class sA extends De{async*runAsync(e,n){if(te(e.agent)&&e.agent.codeExecutor){for await(let o of P3(e,n))yield o;if(Xf(e.agent.codeExecutor))for(let o of n.contents){let r=e.agent.codeExecutor.codeBlockDelimiters.length?e.agent.codeExecutor.codeBlockDelimiters[0]:["",""];FM(o,r,e.agent.codeExecutor.executionResultDelimiters)}}}};a(sA,"CodeExecutionRequestProcessor");var oA=sA,Qf={"text/csv":{extension:".csv",loaderCodeTemplate:"pd.read_csv('{filename}')"}},k3=`
122
+ import pandas as pd
123
+
124
+ def explore_df(df: pd.DataFrame) -> None:
125
+ """Prints some information about a pandas DataFrame."""
126
+
127
+ with pd.option_context(
128
+ 'display.max_columns', None, 'display.expand_frame_repr', False
129
+ ):
130
+ # Print the column names to never encounter KeyError when selecting one.
131
+ df_dtypes = df.dtypes
132
+
133
+ # Obtain information about data types and missing values.
134
+ df_nulls = (len(df) - df.isnull().sum()).apply(
135
+ lambda x: f'{x} / {df.shape[0]} non-null'
136
+ )
137
+
138
+ # Explore unique total values in columns using \`.unique()\`.
139
+ df_unique_count = df.apply(lambda x: len(x.unique()))
140
+
141
+ # Explore unique values in columns using \`.unique()\`.
142
+ df_unique = df.apply(lambda x: crop(str(list(x.unique()))))
143
+
144
+ df_info = pd.concat(
145
+ (
146
+ df_dtypes.rename('Dtype'),
147
+ df_nulls.rename('Non-Null Count'),
148
+ df_unique_count.rename('Unique Values Count'),
149
+ df_unique.rename('Unique Values'),
150
+ ),
151
+ axis=1,
152
+ )
153
+ df_info.index.name = 'Columns'
154
+ print(f"""Total rows: {df.shape[0]}
155
+ Total columns: {df.shape[1]}
156
+
157
+ {df_info}""")
158
+ `,aA=class aA{async*runAsync(e,n){if(!n.partial)for await(let o of N3(e,n))yield o}};a(aA,"CodeExecutionResponseProcessor");var iA=aA,_Ie=new iA;async function*P3(t,e){let n=t.agent;if(!te(n))return;let o=n.codeExecutor;if(!o||!Xf(o))return;if(Iu(o)){o.processLlmRequest(e);return}if(!o.optimizeDataFile)return;let r=new Au(new me(t.session.state));if(r.getErrorCount(t.invocationId)>=o.errorRetryAttempts)return;let i=$3(r,e),s=new Set(r.getProcessedFileNames()),u=i.filter(c=>!s.has(c.name));for(let c of u){let l=D3(c);if(!l)return;let p={role:"model",parts:[{text:`Processing input file: \`${c.name}\``},QI(l)]};e.contents.push(ze(p)),yield J({invocationId:t.invocationId,author:n.name,branch:t.branch,content:p});let d=zM(t,r),g=await o.executeCode({invocationContext:t,codeExecutionInput:{code:l,language:"python",inputFiles:[c],executionId:d}});r.updateCodeExecutionResult({invocationId:t.invocationId,code:l,resultStdout:g.stdout,resultStderr:g.stderr}),r.addProcessedFileNames([c.name]);let h=await GM(t,r,g);yield h,e.contents.push(ze(h.content))}}a(P3,"runPreProcessor");async function*N3(t,e){let n=t.agent;if(!te(n))return;let o=n.codeExecutor;if(!o||!Xf(o)||!e||!e.content||Iu(o))return;let r=new Au(new me(t.session.state));if(r.getErrorCount(t.invocationId)>=o.errorRetryAttempts)return;let i=e.content,s=MM(i,o.codeBlockDelimiters);if(!s)return;yield J({invocationId:t.invocationId,author:n.name,branch:t.branch,content:i});let u=zM(t,r),c=await o.executeCode({invocationContext:t,codeExecutionInput:{code:s,language:"python",inputFiles:r.getInputFiles(),executionId:u}});r.updateCodeExecutionResult({invocationId:t.invocationId,code:s,resultStdout:c.stdout,resultStderr:c.stderr}),yield await GM(t,r,c),e.content=void 0}a(N3,"runPostProcessor");function $3(t,e){var r;let n=t.getInputFiles(),o=new Set(n.map(i=>i.name));for(let i=0;i<e.contents.length;i++){let s=e.contents[i];if(!(s.role!=="user"||!s.parts))for(let u=0;u<s.parts.length;u++){let c=s.parts[u],l=(r=c.inlineData)==null?void 0:r.mimeType;if(!l||!c.inlineData||!Qf[l])continue;let p=`data_${i+1}_${u+1}${Qf[l].extension}`;c.text=`
159
+ Available file: \`${p}\`
160
+ `;let d={name:p,content:lR(c.inlineData.data),mimeType:l};o.has(p)||(t.addInputFiles([d]),n.push(d))}}return n}a($3,"extractAndReplaceInlineFiles");function zM(t,e){var r;let n=t.agent;if(!te(n)||!((r=n.codeExecutor)!=null&&r.stateful))return;let o=e.getExecutionId();return o||(o=t.session.id,e.setExecutionId(o)),o}a(zM,"getOrSetExecutionId");async function GM(t,e,n){if(!t.artifactService)throw new Error("Artifact service is not initialized.");let o={role:"model",parts:[UM(n)]},r=Ft({stateDelta:e.getStateDelta()});n.stderr?e.incrementErrorCount(t.invocationId):e.resetErrorCount(t.invocationId);for(let i of n.outputFiles){let s=await t.artifactService.saveArtifact({filename:i.name,artifact:{inlineData:{data:i.content,mimeType:i.mimeType}}});r.artifactDelta[i.name]=s}return J({invocationId:t.invocationId,author:We(t).name,branch:t.branch,content:o,actions:r})}a(GM,"postProcessCodeExecutionResult");function D3(t){function e(r){let[i]=r.split("."),s=i.replace(/[^a-zA-Z0-9_]/g,"_");return/^\d/.test(s)&&(s="_"+s),s}if(a(e,"getNormalizedFileName"),!Qf[t.mimeType])return;let n=e(t.name),o=Qf[t.mimeType].loaderCodeTemplate.replace("{filename}",t.name);return`
161
+ ${k3}
162
+
163
+ # Load the dataframe.
164
+ ${n} = ${o}
165
+
166
+ # Use \`explore_df\` to guide my analysis.
167
+ explore_df(${n})
168
+ `}a(D3,"getDataFilePreprocessingCode");var BM=new oA;function dn(t){return"isCompacted"in t&&t.isCompacted===!0}a(dn,"isCompactedEvent");function Es(t){return dn(t)&&t.isScratchpad===!0}a(Es,"isScratchpadEvent");function qM(t={}){return{...J(t),isCompacted:t.isCompacted||!0,startTime:t.startTime,endTime:t.endTime,compactedContent:t.compactedContent,isScratchpad:t.isScratchpad}}a(qM,"createCompactedEvent");function po(t,e){let n=t.filter(r=>Wt(r,e)),o=n.filter(dn).pop();return o?[o,...n.filter(r=>!dn(r)&&r.timestamp>o.endTime)]:n}a(po,"getActiveEvents");function Wt(t,e){return t.isolationScope===void 0||t.isolationScope===e}a(Wt,"isEventVisibleInIsolationScope");function Ss(t,e){let n=Math.max(0,t.length-e);for(;n>0;){let o=t[n],r=t[n-1];if(fe(o).length>0&&le(r).length>0)n--;else break}return n}a(Ss,"calculateRetainStartIndex");function ep(t,e){return!e||e===t||!!t&&t.startsWith(`${e}.`)}a(ep,"isSegmentPrefix");function O3(t){var e,n,o,r,i;for(let s of(e=t==null?void 0:t.parts)!=null?e:[])(o=(n=s.functionCall)==null?void 0:n.id)!=null&&o.startsWith(Hs)&&(s.functionCall.id=void 0),(i=(r=s.functionResponse)==null?void 0:r.id)!=null&&i.startsWith(Hs)&&(s.functionResponse.id=void 0)}a(O3,"removeClientFunctionCallId");function wu(t,e,n,o){let r=[];for(let u of t)if(Wt(u,o)){if(dn(u)){r.push(q3(u));continue}ZM(u,n,o)&&r.push(JM(e,u)?z3(u):u)}let i=G3(r);i=B3(i);let s=[];for(let u of i){let c=ze(u.content);O3(c),s.push(c)}return s}a(wu,"getContents");function ZM(t,e,n){var o,r,i;return!((o=t.content)!=null&&o.role)||((i=(r=t.content.parts)==null?void 0:r[0])==null?void 0:i.text)===""||e&&t.branch&&!ep(e,t.branch)||!Wt(t,n)?!1:!U3(t)&&!F3(t)&&!L3(t)}a(ZM,"shouldIncludeEventInContext");function L3(t){var e,n,o;if(!((e=t.content)!=null&&e.parts))return!1;for(let r of t.content.parts)if(((n=r.functionCall)==null?void 0:n.name)===Me||((o=r.functionResponse)==null?void 0:o.name)===Me)return!0;return!1}a(L3,"isRequestInputEvent");function HM(t,e,n,o){for(let r=t.length-1;r>=0;r--){let i=t[r];if(ZM(i,n,o)&&(i.author==="user"||JM(e,i)))return wu(t.slice(M3(t,r)),e,n,o)}return[]}a(HM,"getCurrentTurnContents");function M3(t,e){var r,i,s,u,c;let n=new Set;for(let l of t.slice(e))for(let p of(i=(r=l.content)==null?void 0:r.parts)!=null?i:[])(s=p.functionResponse)!=null&&s.id&&n.add(p.functionResponse.id);if(n.size===0)return e;let o=e;for(let l=e-1;l>=0;l--)((c=(u=t[l].content)==null?void 0:u.parts)!=null?c:[]).some(d=>{var g;return(g=d.functionCall)!=null&&g.id?n.has(d.functionCall.id):!1})&&(o=l);return o}a(M3,"turnStart");function U3(t){var e,n,o;if(!((e=t.content)!=null&&e.parts))return!1;for(let r of t.content.parts)if(((n=r.functionCall)==null?void 0:n.name)===qe||((o=r.functionResponse)==null?void 0:o.name)===qe)return!0;return!1}a(U3,"isAuthEvent");function F3(t){var e,n,o;if(!((e=t.content)!=null&&e.parts))return!1;for(let r of t.content.parts)if(((n=r.functionCall)==null?void 0:n.name)===je||((o=r.functionResponse)==null?void 0:o.name)===je)return!0;return!1}a(F3,"isToolConfirmationEvent");function JM(t,e){return!!t&&e.author!==t&&e.author!=="user"}a(JM,"isEventFromAnotherAgent");function z3(t){var n,o,r,i,s,u;if(!((o=(n=t.content)==null?void 0:n.parts)!=null&&o.length))return t;let e={role:"user",parts:[{text:"For context:"}]};for(let c of t.content.parts)c.text&&!c.thought?(r=e.parts)==null||r.push({text:`[${t.author}] said: ${c.text}`}):c.functionCall?(i=e.parts)==null||i.push({text:`[${t.author}] called tool \`${c.functionCall.name}\` with parameters: ${VM(c.functionCall.args)}`}):c.functionResponse?(s=e.parts)==null||s.push({text:`[${t.author}] tool \`${c.functionResponse.name}\` returned result: ${VM(c.functionResponse.response)}`}):(u=e.parts)==null||u.push(ze(c));return J({invocationId:t.invocationId,author:"user",content:e,branch:t.branch,timestamp:t.timestamp})}a(z3,"convertForeignEvent");function KM(t){var r;if(t.length===0)throw new Error("Cannot merge an empty list of events.");let e=J({...t[0],content:t[0].content?ze(t[0].content):void 0}),n=(r=e.content)==null?void 0:r.parts;if(!n||n.length===0)throw new Error("There should be at least one function_response part.");let o={};for(let i=0;i<n.length;i++){let s=n[i];s.functionResponse&&s.functionResponse.id&&(o[s.functionResponse.id]=i)}for(let i of t.slice(1)){if(!i.content||!i.content.parts)throw new Error("There should be at least one function_response part.");for(let s of i.content.parts){let u=ze(s);if(u.functionResponse&&u.functionResponse.id){let c=u.functionResponse.id;c in o?n[o[c]]=u:(n.push(u),o[c]=n.length-1)}else n.push(u)}}return e}a(KM,"mergeFunctionResponseEvents");function G3(t){if(t.length===0)return t;let e=t[t.length-1],n=fe(e);if(!(n!=null&&n.length))return t;let o=new Set(n.filter(l=>!!l.id).map(l=>l.id)),r=t.at(-2);if(r){let l=le(r);if(l){for(let p of l)if(p.id&&o.has(p.id))return t}}let i;for(let l=t.length-2;l>=0;l--){let p=t[l],d=le(p);if(!(d!=null&&d.length))continue;let g=!1;for(let h of d)if(h.id&&o.has(h.id)){let v=new Set(d.map(_=>_.id).filter(_=>!!_));if(!Array.from(o).every(_=>v.has(_)))throw new Error(`Last response event should only contain the responses for the function calls in the same function call event. Function call ids found : ${Array.from(v).join(", ")}, function response ids provided: ${Array.from(o).join(", ")}`);i={eventIdx:l,responseIds:v},g=!0;break}if(g)break}if(!i)throw new Error(`No function call event found for function responses ids: ${Array.from(o).join(", ")}`);let s=[],u=i.responseIds;for(let l=i.eventIdx+1;l<t.length-1;l++){let p=t[l],d=fe(p);d&&d.some(g=>g.id&&u.has(g.id))&&s.push(p)}s.push(t[t.length-1]);let c=t.slice(0,i.eventIdx+1);return c.push(KM(s)),c}a(G3,"rearrangeEventsForLatestFunctionResponse");function B3(t){let e=new Map;for(let o=0;o<t.length;o++){let r=t[o],i=fe(r);if(i!=null&&i.length)for(let s of i)s.id&&e.set(s.id,o)}let n=[];for(let o of t){if(fe(o).length>0)continue;let r=le(o);if(r!=null&&r.length){let i=new Set;for(let s of r){let u=s.id;u&&e.has(u)&&i.add(e.get(u))}if(n.push(o),i.size===0)continue;if(i.size===1){let[s]=Array.from(i);n.push(t[s])}else{let u=Array.from(i).sort((c,l)=>c-l).map(c=>t[c]);n.push(KM(u))}}else n.push(o)}return n}a(B3,"rearrangeEventsForAsyncFunctionResponsesInHistory");function VM(t){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch(e){return String(t)}}a(VM,"safeStringify");function q3(t){let e=uc(`[Previous Context Summary]:
169
+ ${t.compactedContent}`);return J({invocationId:t.invocationId,author:"user",content:e,branch:t.branch,timestamp:t.timestamp})}a(q3,"convertCompactedEvent");var uA=class uA{async*runAsync(e,n){let o=e.agent;if(!o||!te(o))return;let r=po(e.session.events,e.isolationScope);o.includeContents==="default"?n.contents=wu(r,o.name,e.branch,e.isolationScope):n.contents=HM(r,o.name,e.branch,e.isolationScope)}};a(uA,"ContentRequestProcessor");var tp=uA,np=new tp;var rp=new Set;function tt(t,e,n){var o;if(e===void 0){let r=t.name,i=(o=class extends t{constructor(...u){rp.has(r)||(N.warn(`Class ${r} is experimental and may change in the future.`),rp.add(r)),super(...u)}},a(o,"newConstructor"),o);return Object.defineProperty(i,"name",{value:r,configurable:!0}),i}if(e!==void 0&&n!==void 0){let r=typeof t=="function"?t.name:t.constructor.name,i=String(e),s=`${r}.${i}`,u=n.value;return n.value=function(...c){return rp.has(s)||(N.warn(`Method ${s} is experimental and may change in the future.`),rp.add(s)),u.apply(this,c)},n}throw new Error("Invalid decorator usage")}a(tt,"experimental");var op=(o=>(o.Manual="Manual",o.Auto="Auto",o.AgentControlled="AgentControlled",o))(op||{}),Ts=class Ts{constructor(e){this.name=e}async onUserMessageCallback(e){}async beforeRunCallback(e){}async onEventCallback(e){}async afterRunCallback(e){}async beforeAgentCallback(e){}async afterAgentCallback(e){}async beforeNodeCallback(e){}async afterNodeCallback(e){}async beforeModelCallback(e){}async afterModelCallback(e){}async onModelErrorCallback(e){}async beforeToolSelection(e){}async beforeContextCompaction(e){}async afterContextCompaction(e){}async beforeToolCallback(e){}async afterToolCallback(e){}async onToolErrorCallback(e){}};a(Ts,"BasePlugin"),Re([tt],Ts.prototype,"beforeToolSelection",1),Re([tt],Ts.prototype,"beforeContextCompaction",1),Re([tt],Ts.prototype,"afterContextCompaction",1);var Lt=Ts;var lA=class lA{constructor(e){this.compactors=e}async*runAsync(e,n){var o;for(let r of this.compactors)if(await Promise.resolve(r.shouldCompact(e))){let s=(o=r.trigger)!=null?o:"Auto";await e.pluginManager.runBeforeContextCompaction({invocationContext:e,trigger:s});let u=new Set(e.session.events);await Promise.resolve(r.compact(e)),await e.pluginManager.runAfterContextCompaction({invocationContext:e,trigger:s});let c=e.session.events.filter(l=>!u.has(l));for(let l of c)yield l;return}}};a(lA,"ContextCompactorRequestProcessor");var Cs=lA;var dA=class dA extends De{async*runAsync(e,n){let o=We(e);if(te(o)&&o.disallowTransferToParent&&o.disallowTransferToPeers&&o.subAgents.length===0)return;let r=[`You are an agent. Your internal name is "${o.name}".`];o.description&&r.push(`The description about you is "${o.description}"`),Ve(n,r)}};a(dA,"IdentityLlmRequestProcessor");var cA=dA,WM=new cA;var fA="artifact.",YM=/^[A-Za-z_]\w*\.[A-Za-z_]\w*$/,V3=/<\s*[A-Za-z_]\w*\.([A-Za-z_]\w*)\s+from\s+([A-Za-z_]\w*)\s*>/g;function Z3(t,e,n,o){var i;let r=(i=o.outputsByNode)==null?void 0:i[n];return r&&typeof r=="object"&&e in r?ip(r[e],!1):t}a(Z3,"resolveSourceNode");async function H3(t,e,n,o){let r=o.invocationContext;if(t.startsWith(fA)){let s=t.substring(fA.length);if(r.artifactService===void 0)throw new Error("Artifact service is not initialized.");let u=await r.artifactService.loadArtifact({filename:s});if(!u){if(e)return"";throw new Error(`Artifact ${s} not found.`)}return ip(u,!0)}if(XM(t)){if(t in r.session.state)return ip(r.session.state[t],!1);if(e)return"";throw new Error(`Context variable not found: \`${t}\`.`)}let i=r.workflowInstructionScope;if(i&&YM.test(t)){let s=t.slice(t.indexOf(".")+1),u=i.input;if(u&&typeof u=="object"&&s in u)return ip(u[s],!1);if(e)return""}return n}a(H3,"resolveKey");function ip(t,e=!1){if(typeof t=="string")return t;if(typeof t=="object"&&t!==null){if(e&&"text"in t&&typeof t.text=="string")return t.text;try{let n=JSON.stringify(t);if(n!==void 0)return n}catch(n){throw new Error(`Failed to serialize value for instruction template: ${n instanceof Error?n.message:String(n)}`)}}return String(t)}a(ip,"formatValue");async function bu(t,e){let n=e.invocationContext.workflowInstructionScope,o=n?Array.from(t.matchAll(V3)).map(g=>({raw:g[0],index:g.index,resolved:Z3(g[0],g[1],g[2],n)})):[],r=/\{+[^{}]*}+/g,i=Array.from(t.matchAll(r));if(i.length===0&&o.length===0)return t;let s=i.map(g=>{let h=g[0],v=h.replace(/^\{+/,"").replace(/\}+$/,"").trim(),y=v.endsWith("?");y&&(v=v.slice(0,-1));let _=v.startsWith(fA)||XM(v)||!!n&&YM.test(v);return{raw:h,key:v,isOptional:y,isValid:_,index:g.index}}),u=new Map;for(let g of s){if(!g.isValid)continue;let h=u.get(g.key);h?h.isOptional&&!g.isOptional&&(h.isOptional=!1):u.set(g.key,{key:g.key,isOptional:g.isOptional,raw:g.raw})}let c=new Map;for(let g of u.values())c.set(g.key,H3(g.key,g.isOptional,g.raw,e));await Promise.all(c.values());let l=[...s,...o].sort((g,h)=>g.index-h.index),p=[],d=0;for(let g of l){if(p.push(t.slice(d,g.index)),"resolved"in g)p.push(g.resolved);else if(g.isValid){let h=await c.get(g.key);p.push(h)}else p.push(g.raw);d=g.index+g.raw.length}return p.push(t.slice(d)),p.join("")}a(bu,"injectSessionState");var J3=/^[a-zA-Z_][a-zA-Z0-9_]*$/;function jM(t){return t===""||t===void 0?!1:J3.test(t)}a(jM,"isIdentifier");var K3=[me.APP_PREFIX,me.USER_PREFIX,me.TEMP_PREFIX];function XM(t){let e=t.split(":");return e.length===0||e.length>2?!1:e.length===1?jM(t):K3.includes(e[0]+":")?jM(e[1]):!1}a(XM,"isValidStateName");var mA=class mA extends De{async*runAsync(e,n){var i;let o=e.agent;if(!te(o))return;let r=o.rootAgent;if(te(r)&&r.globalInstruction){let{instruction:s,requireStateInjection:u}=await r.canonicalGlobalInstruction(new Ie(e)),c=s;u&&(c=await bu(s,new Ie(e))),Ve(n,[c])}if(o.instruction){let{instruction:s,requireStateInjection:u}=await o.canonicalInstruction(new Ie(e)),c=s;u&&(c=await bu(s,new Ie(e))),Ve(n,[c])}o.outputSchema&&((i=o.tools)!=null&&i.length)&&!_s(o.canonicalModel.model)&&Ve(n,['To output the final result, you must call the "set_model_response" function with the appropriate values. Do not output anything else.'])}};a(mA,"InstructionsLlmRequestProcessor");var pA=mA,QM=new pA;var hA=class hA{async*runAsync(e,n){let o=e.agent;if(!o||!te(o))return;let r=o.canonicalModel;if(yM(r)&&r.useInteractionsApi){let i=e.session.events;for(let s=i.length-1;s>=0;s--){let u=i[s];if(u.branch===e.branch&&u.author===o.name&&u.interactionId){n.previousInteractionId=u.interactionId;break}}}}};a(hA,"InteractionsRequestProcessor");var sp=hA,gA=new sp;var yA=class yA extends De{async*runAsync(e){var h;let n=e.agent;if(!te(n))return;let o=W3(e);if(o.length===0)return;let r=e.runConfig;if(r!=null&&r.remoteDelivered&&!r.allowRemoteToolConfirmation){N.warn("Ignoring tool confirmation(s) delivered over A2A: a remote peer cannot answer a human-in-the-loop gate. Set `allowRemoteToolConfirmation` on the run config if the peer relays a real operator decision.");return}let i=j3(o,(h=r==null?void 0:r.plainTextToolConfirmation)!=null?h:!1,n.name);if(i.size===0)return;let s=X3(o,i,n.name);if(s.length===0)return;let u=await n.canonicalTools(new Ie(e)),c=Object.fromEntries(u.map(v=>[v.name,v])),l=await Q3({candidates:s,events:o,toolsDict:c,agentName:n.name,invocationContext:e}),p=await kr({invocationContext:e,functionCalls:[...l.values()].map(v=>v.call),toolsDict:c,beforeToolCallbacks:n.canonicalBeforeToolCallbacks,afterToolCallbacks:n.canonicalAfterToolCallbacks,filters:new Set(l.keys()),toolConfirmationDict:Object.fromEntries([...l].map(([v,y])=>[v,y.confirmation]))});if(!p)return;let d=e.session.events,g=d.findIndex(v=>v.id===p.id);g>=0?d[g]=p:d.push(p),yield p}};a(yA,"RequestConfirmationLlmRequestProcessor");var vA=yA;function W3(t){let e=t.session.events,n=t.branch;return n?e.filter(o=>!o.branch||ep(n,o.branch)):e}a(W3,"eventsInScope");function j3(t,e,n){let o=new Map,r=o5(t);if(!r)return o;for(let i of fe(r))i.name===je&&(!i.id||!i.response||o.set(i.id,Y3(i.response)));return o.size===0&&e?a5(t,n):o}a(j3,"collectApprovals");function Y3(t){let e=Object.keys(t).length===1&&"response"in t?JSON.parse(t.response):t;return new Rr({hint:e.hint,payload:e.payload,confirmed:e.confirmed===!0})}a(Y3,"parseToolConfirmation");function X3(t,e,n){let o=[];for(let[r,i]of t.entries())for(let s of le(i)){let u=s.id?e.get(s.id):void 0;if(!u||s.name!==je)continue;if(i.author!==n){if(i.author==="user")throw new io({reason:"untrusted_request",functionCallId:s.id});N.debug(`Skipping tool confirmation from event ${i.id}: authored by ${i.author}, not by ${n}.`);continue}let c=n5(s);if(c){if(!c.id||!c.name)throw new io({reason:"malformed_request",functionCallId:s.id});r5(t,c.id,r,n)||o.push({pinned:c,confirmation:u})}}return o}a(X3,"collectGateCandidates");async function Q3(t){var l,p,d;let{candidates:e,events:n,toolsDict:o,agentName:r,invocationContext:i}=t,s=e5(n,r),u=t5(n,r),c=new Map;for(let{pinned:g,confirmation:h}of e){let v=g.id,y=a(T=>new io({reason:T,functionCallId:v}),"refuse"),_=s.get(v);if(!_)throw y("unknown_original_call");let x=o[g.name];if(!x)throw y("unregistered_tool");if(_.name!==g.name)throw y("tool_name_mismatch");if(!Xp((l=_.args)!=null?l:{},(p=g.args)!=null?p:{}))throw y("arguments_mismatch");if(!await x.checkRequireConfirmation((d=_.args)!=null?d:{},new Le({invocationContext:i,functionCallId:v}))&&!u.has(v))throw y("confirmation_not_required");c.set(v,{call:g,confirmation:h})}return c}a(Q3,"bindApprovedCalls");function e5(t,e){let n=new Map;for(let o of t)if(o.author===e)for(let r of le(o))r.id&&r.name!==je&&n.set(r.id,r);return n}a(e5,"agentAuthoredCalls");function t5(t,e){var o;let n=new Set;for(let r of t)if(r.author===e)for(let i of Object.keys((o=r.actions.requestedToolConfirmations)!=null?o:{}))n.add(i);return n}a(t5,"dynamicallyRequestedCallIds");function n5(t){let e=t.args;if(!e||!("originalFunctionCall"in e))return;let n=e.originalFunctionCall;if(!(typeof n!="object"||n===null||Array.isArray(n)))return n}a(n5,"pinnedCall");function r5(t,e,n,o){return t.slice(n+1).some(r=>r.author===o&&fe(r).some(i=>i.id===e))}a(r5,"hasRespondedAfter");function o5(t){for(let e=t.length-1;e>=0;e--)if(t[e].author==="user")return t[e]}a(o5,"findLatestUserEvent");var i5=new Set(["yes","y","true","approve","approved","ok","okay","confirm","confirmed"]),s5=new Set(["no","n","false","reject","rejected","deny","denied","cancel","cancelled"]);function a5(t,e){var l,p;let n=new Map,o=-1,r="";for(let d=t.length-1;d>=0;d--){let g=t[d];if(g.author!=="user")continue;let h=(p=(l=g.content)==null?void 0:l.parts)!=null?p:[];h.length>0&&h.every(y=>typeof y.text=="string")&&(o=d,r=h.map(y=>y.text).join(""));break}if(o<0)return n;let i=new Set;for(let d of t)if(d.author==="user")for(let g of fe(d))g.id&&i.add(g.id);let s;for(let d=o-1;d>=0;d--){let g=t[d];if(g.author==="user")break;if(g.author===e){for(let h of le(g))if(h.name===je&&h.id&&!i.has(h.id)){s=h.id;break}if(s)break}}if(!s)return n;let u=r.trim().toLowerCase(),c;if(i5.has(u))c=!0;else if(s5.has(u))c=!1;else return n;return new Map([[s,new Rr({confirmed:c})]])}a(a5,"mapPlainTextConfirmation");var eU=new vA;function _A(t){var n,o,r,i,s,u,c,l;let e=[];for(let p of(o=(n=t.content)==null?void 0:n.parts)!=null?o:[]){let d=p.functionCall;if(!(d!=null&&d.name))continue;let g=l5(d.name,d.args),h=(i=(r=d.id)!=null?r:Ru(g.interruptId))!=null?i:Ru(g.functionCallId);if(!h)continue;let v={interruptId:h,functionCallName:d.name,author:t.author};switch(d.name){case Me:e.push({...v,kind:"input",message:Ru(g.message),payload:(s=g.payload)!=null?s:void 0,responseSchema:(u=g.response_schema)!=null?u:void 0});break;case qe:e.push({...v,kind:"credential",message:Ru(g.message),authConfig:(c=g.authConfig)!=null?c:void 0});break;case je:{let y=g.toolConfirmation,_=g.originalFunctionCall;e.push({...v,kind:"confirmation",message:c5(y==null?void 0:y.hint),payload:(l=y==null?void 0:y.payload)!=null?l:void 0,toolName:Ru(_==null?void 0:_.name)});break}default:break}}return e}a(_A,"getUserInputRequests");function xA(t){return _A(t).length>0}a(xA,"requiresUserInput");function u5(t){var r,i,s;let e=new Set;for(let u of t)for(let c of(i=(r=u.content)==null?void 0:r.parts)!=null?i:[]){let l=(s=c.functionResponse)==null?void 0:s.id;l&&e.add(l)}let n=[],o=new Set;for(let u of t)for(let c of _A(u))e.has(c.interruptId)||o.has(c.interruptId)||(o.add(c.interruptId),n.push(c));return n}a(u5,"getPendingUserInputRequests");function l5(t,e){return e?t===qe?xs(e):e:{}}a(l5,"normalizeArgs");function Ru(t){return typeof t=="string"?t:void 0}a(Ru,"asString");function c5(t){return typeof t=="string"&&t.trim()?t:void 0}a(c5,"asNonEmptyString");var tU="result";function Is(t,e){var s;let n=[],o=t.length,r;for(let u=0;u<t.length;u++){let c=t[u],l=c.invocationId||r;if(c.invocationId&&(r=c.invocationId),l===e){o===t.length&&(o=u);continue}if(!((s=c.nodeInfo)!=null&&s.path))continue;let p=n[n.length-1];(!p||p.invocationId!==l)&&(p={start:u,invocationId:l,paused:!1},n.push(p)),d5(c)&&(p.paused=!0)}let i=o;for(let u=n.length-1;u>=0&&n[u].paused;u--)i=n[u].start;return t.slice(i)}a(Is,"eventsForCurrentRun");function d5(t){return xA(t)}a(d5,"raisedInterrupt");function nU(t,e){return e?EA(t,n=>{var o;return(o=n.nodeInfo)!=null&&o.path?uU(n.nodeInfo.path,e):void 0}):EA(t,n=>{var o;return(o=n.nodeInfo)!=null&&o.path?aU(n.nodeInfo.path):n.author})}a(nU,"reconstructNodeStates");function rU(t){return EA(t,e=>{var n,o;return(o=(n=e.nodeInfo)==null?void 0:n.path)!=null?o:e.author})}a(rU,"reconstructNodeStatesByPath");function SA(t){var s,u;let e=Rf(t),n=h5(t),o=new Set,r=new Set,i=new Map;for(let c of t){if(c.author==="user"&&((s=c.content)!=null&&s.parts)){for(let l of c.content.parts){let p=l.functionResponse;if(!(p!=null&&p.id))continue;if(!r.has(p.id)){if(p.name===Me&&c===n)throw new Error(o.has(p.id)?p5(p.id,r):f5(p.id,r));continue}let d=e.get(p.id),g=lp(p.response,d),h=pu(p.id,g,d);if(h){if(c===n)throw new Error(h);continue}r.delete(p.id),i.set(p.id,g)}continue}for(let l of(u=c.longRunningToolIds)!=null?u:[])o.add(l),r.add(l)}return i}a(SA,"resolvedInterruptResponses");function oU(t){return t.size?`Still waiting: ${[...t].map(e=>`'${e}'`).join(", ")}.`:"This run has no interrupt waiting for an answer."}a(oU,"waitingList");function f5(t,e){return`The reply carries interrupt id '${t}', which does not match any interrupt this run raised. ${oU(e)} A reply must use the id from the 'adk_request_input' function call it answers. Nothing was resolved, so any waiting interrupt can still be answered.`}a(f5,"unroutableReplyMessage");function p5(t,e){return`Interrupt '${t}' has already been answered, so this reply resolves nothing. Sending it again does not change the earlier answer, and it would otherwise be served as a new message, restarting the node that asked. ${oU(e)}`}a(p5,"alreadyAnsweredMessage");function iU(t,e){return sU(t,m5(e))}a(iU,"reconstructNodeRuns");function m5(t){return t?e=>{var n;return(n=e.nodeInfo)!=null&&n.path?uU(e.nodeInfo.path,t):void 0}:e=>{var n;return(n=e.nodeInfo)!=null&&n.path?aU(e.nodeInfo.path):e.author}}a(m5,"keyFn");function g5(t){return t.output!==void 0||t.route!==void 0||t.interruptIds.size>0}a(g5,"isRunClosed");function EA(t,e){let n=new Map;for(let[o,r]of sU(t,e)){let i={interruptIds:new Set,resolvedResponses:new Map};for(let s of r){s.output!==void 0&&(i.output=s.output,i.branch=s.branch),s.route!==void 0&&(i.route=s.route),s.input!==void 0&&(i.input=s.input);for(let u of s.interruptIds)i.interruptIds.add(u);for(let[u,c]of s.resolvedResponses)i.resolvedResponses.set(u,c)}n.set(o,i)}return n}a(EA,"reconstruct");function sU(t,e){var s,u,c;let n=new Map,o=new Map,r=SA(t),i=a(l=>{let p=n.get(l);p||(p=[],n.set(l,p));let d=p[p.length-1];if(d&&!g5(d))return d;let g={interruptIds:new Set,resolvedResponses:new Map};return p.push(g),g},"currentRun");for(let l of t){if(l.author==="user"&&((s=l.content)!=null&&s.parts)){for(let h of l.content.parts){let v=h.functionResponse;v!=null&&v.id&&o.has(v.id)&&r.has(v.id)&&o.get(v.id).resolvedResponses.set(v.id,r.get(v.id))}continue}let p=e(l);if(!p)continue;let d=i(p);l.output!==void 0&&(d.output=l.output,d.branch=l.branch),l.route!==void 0&&(d.route=l.route);for(let h of(u=l.longRunningToolIds)!=null?u:[])d.interruptIds.add(h),o.set(h,d);let g=(c=l.actions)==null?void 0:c.agentState;lU(g)&&"input"in g&&(d.input=g.input)}return n}a(sU,"reconstructRuns");function h5(t){for(let e=t.length-1;e>=0;e--)if(t[e].author==="user")return t[e]}a(h5,"lastUserEvent");function ap(t){if(t.output===void 0&&t.route===void 0)return!1;for(let e of t.interruptIds)if(!t.resolvedResponses.has(e))return!1;return!0}a(ap,"isFastForwardable");function up(t,e){var n;return{output:e.output,route:e.route,branch:(n=e.branch)!=null?n:t.branch,interruptIds:[]}}a(up,"makeFastForwardResult");function aU(t){var n;return((n=t.split(/[./]/).pop())!=null?n:t).split("@")[0]}a(aU,"nodeNameFromPath");function uU(t,e){let n=`${e}.`;if(!t.startsWith(n))return;let o=t.slice(n.length);if(!o.includes("."))return o.split("@")[0]}a(uU,"directChildName");function lU(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(lU,"isRecord");function lp(t,e){if(t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===1&&tU in t){let n=t[tU];return typeof n!="string"||cU(e)?n:v5(n)}return t}a(lp,"unwrapResponse");function cU(t){if(!lU(t))return!1;let e=t.type;if(e==="string"||Array.isArray(e)&&e.includes("string"))return!0;for(let n of["anyOf","oneOf"]){let o=t[n];if(Array.isArray(o)&&o.some(cU))return!0}return!1}a(cU,"acceptsString");function v5(t){try{return JSON.parse(t)}catch(e){return t}}a(v5,"parseJsonIfPossible");var CA=class CA extends De{async*runAsync(e){let n=e.agent;if(!te(n))return;let o=e.session.events;if(!o||o.length===0)return;let r=y5(o);if(Object.keys(r).length===0)return;let i=await n.canonicalTools(new Ie(e)),s=Object.fromEntries(i.map(v=>[v.name,v])),u=new Set(i.filter(v=>rM(v)).map(v=>v.name));if(u.size===0)return;let c=new Set;for(let v of o)for(let y of fe(v))y.id&&c.add(y.id);let l={};for(let v of o)if(v.author===n.name)for(let y of le(v))y.id&&y.name&&u.has(y.name)&&!c.has(y.id)&&(l[y.id]=y);if(Object.keys(l).length===0)return;let p={};for(let v of Object.keys(l))p[v]=r;let d=new cn;e.eventQueue=d;let g=(async()=>{try{return await kr({invocationContext:e,functionCalls:Object.values(l),toolsDict:s,beforeToolCallbacks:n.canonicalBeforeToolCallbacks,afterToolCallbacks:n.canonicalAfterToolCallbacks,filters:new Set(Object.keys(l)),resumeInputsDict:p})}finally{d.close()}})();for await(let v of d)yield v;let h=await g;e.eventQueue=void 0,h&&(yield h)}};a(CA,"RequestInputLlmRequestProcessor");var TA=CA;function y5(t){var l,p;let e=Rf(t),n=!0;for(let d=t.length-1;d>=0;d--){let g=t[d];if(g.author!=="user")continue;let h={},v=!1;for(let y of fe(g))if(y.name===Me&&y.id){let _=e.get(y.id),x=lp(y.response,_),E=pu(y.id,x,_);if(E){if(n)throw new Error(E);continue}h[y.id]=x,v=!0}if(v)return h;n=!1}let o=_5(t,e);if(o.size===0)return{};let r=[...t].reverse().find(d=>d.author==="user"),i=(p=(l=r==null?void 0:r.content)==null?void 0:l.parts)!=null?p:[];if(!(i.length>0&&i.every(d=>typeof d.text=="string")))return{};let u=i.map(d=>d.text).join(""),c={};for(let d of o)c[d]=u;return c}a(y5,"collectResumeInputs");function _5(t,e){let n=new Set;for(let r of t)if(r.author==="user")for(let i of fe(r)){if(!i.id)continue;let s=e.get(i.id);pu(i.id,lp(i.response,s),s)||n.add(i.id)}let o=new Set;for(let r of t)if(r.author!=="user")for(let i of le(r))i.name===Me&&i.id&&!n.has(i.id)&&o.add(i.id);return o}a(_5,"pendingInterruptIds");var dU=new TA;var AA=class AA extends De{async*runAsync(e,n){let o=e.agent;if(!te(o))return;let r=await o.canonicalTools(new Ie(e));if(r.length===0)return;let i={};for(let c of r)i[c.name]=c;let s=new Le({invocationContext:e}),u=await e.pluginManager.runBeforeToolSelection({callbackContext:s,tools:i});u!==void 0&&(n.allowedTools=Object.keys(u))}};a(AA,"ToolFilterRequestProcessor");var IA=AA,fU=new IA;var wA=(o=>(o.NONE="none",o.SSE="sse",o.BIDI="bidi",o))(wA||{});function bA(t={}){var e;return x5(t.streamingMode),{saveInputBlobsAsArtifacts:!1,supportCfc:!1,enableAffectiveDialog:!1,streamingMode:"none",pauseOnToolCalls:!1,...t,maxLlmCalls:E5((e=t.maxLlmCalls)!=null?e:500)}}a(bA,"createRunConfig");function x5(t){if(t==="bidi")throw new Error("StreamingMode.BIDI is not supported; use StreamingMode.SSE.")}a(x5,"validateStreamingMode");function E5(t){if(t>Number.MAX_SAFE_INTEGER)throw new Error(`maxLlmCalls should be less than ${Number.MAX_SAFE_INTEGER}.`);return t<=0&&N.warn("maxLlmCalls is less than or equal to 0. This will result in no enforcement on total number of llm calls that will be made for a run. This may not be ideal, as this could result in a never ending communication between the model and the agent in certain cases."),t}a(E5,"validateMaxLlmCalls");var pU=5,mU=1e3,PA=class PA extends Error{constructor(n){super(`live reconnect requested: ${n}`);this.reason=n;this.name="LiveReconnectSignal"}};a(PA,"LiveReconnectSignal");var ku=PA;function gU(t){var o;if(t instanceof ku)return!0;if(!(t instanceof Error))return!1;let e=t.code;if(e===1006||e===1011||e===1012)return!0;let n=(o=t.message)!=null?o:"";return/ConnectionClosed|connection closed|ECONNRESET|socket hang up/i.test(n)}a(gU,"isRecoverableLiveError");function hU(t){return new Promise(e=>setTimeout(e,t))}a(hU,"sleep");var S5=["responseModalities","speechConfig","outputAudioTranscription","inputAudioTranscription","realtimeInputConfig","contextWindowCompression","proactivity","enableAffectiveDialog"];function T5(t,e){var o;if(!t)return;let n=(o=e.liveConnectConfig)!=null?o:e.liveConnectConfig={};for(let r of S5)t[r]!==void 0&&(n[r]=t[r])}a(T5,"applyLiveRunConfig");var vU="adk_agent_name";async function RA(t,e){return uu(t)?[t]:mu(t)?[new gs(t)]:await t.getTools(e)}a(RA,"convertToolUnionToTools");var kA=Symbol.for("google.adk.llmAgent");function te(t){return typeof t=="object"&&t!==null&&kA in t&&t[kA]===!0}a(te,"isLlmAgent");var yU,_U,mo=class mo extends(_U=$t,yU=kA,_U){constructor(n){var r,i,s,u,c,l,p,d,g,h,v,y;super({...n,rerunOnResume:(r=n.rerunOnResume)!=null?r:!0,waitForOutput:(i=n.waitForOutput)!=null?i:n.mode==="task"});this[yU]=!0;if(this.model=n.model,this.instruction=(s=n.instruction)!=null?s:"",this.globalInstruction=(u=n.globalInstruction)!=null?u:"",this.tools=(c=n.tools)!=null?c:[],this.generateContentConfig=n.generateContentConfig,this.disallowTransferToParent=(l=n.disallowTransferToParent)!=null?l:!1,this.disallowTransferToPeers=(p=n.disallowTransferToPeers)!=null?p:!1,this.includeContents=(d=n.includeContents)!=null?d:"default",this.includeContentsExplicit=n.includeContents!==void 0,this.inputSchemaSource=n.inputSchema,this.outputSchemaSource=n.outputSchema,this.inputSchema=Tn(n.inputSchema)?br(n.inputSchema):n.inputSchema,this.outputSchema=Tn(n.outputSchema)?br(n.outputSchema):n.outputSchema,this.mode=n.mode,this.outputKey=n.outputKey,this.beforeModelCallback=n.beforeModelCallback,this.afterModelCallback=n.afterModelCallback,this.beforeToolCallback=n.beforeToolCallback,this.afterToolCallback=n.afterToolCallback,this.codeExecutor=n.codeExecutor,this.requestProcessors=(g=n.requestProcessors)!=null?g:[NM,qI,WM,QM,eU,dU,np,gA,BM,fU],!n.requestProcessors&&n.contextCompactors&&n.contextCompactors.length>0){let _=this.requestProcessors.indexOf(np);_!==-1?this.requestProcessors.splice(_,0,new Cs(n.contextCompactors)):this.requestProcessors.push(new Cs(n.contextCompactors))}if(this.responseProcessors=(h=n.responseProcessors)!=null?h:[],this.disallowTransferToParent&&this.disallowTransferToPeers&&!((v=this.subAgents)!=null&&v.length)||this.requestProcessors.push(PM),n.generateContentConfig){if(n.generateContentConfig.tools)throw new Error("All tools must be set via LlmAgent.tools.");if(n.generateContentConfig.systemInstruction)throw new Error("System instruction must be set via LlmAgent.instruction.");if(n.generateContentConfig.responseSchema)throw new Error("Response schema must be set via LlmAgent.output_schema.")}else this.generateContentConfig={};this.outputSchema&&((n.disallowTransferToParent===!1||n.disallowTransferToPeers===!1||(y=this.subAgents)!=null&&y.length)&&N.warn(`Invalid config for agent ${this.name}: outputSchema cannot co-exist with agent transfer configurations. Setting disallowTransferToParent=true, disallowTransferToPeers=true`),this.disallowTransferToParent=!0,this.disallowTransferToPeers=!0)}get canonicalModel(){if(fI(this.model))return this.model;if(typeof this.model=="string"&&this.model)return Or.newLlm(this.model);let n=this.parentAgent;for(;n;){if(te(n))return n.canonicalModel;n=n.parentAgent}throw new Error(`No model found for ${this.name}.`)}get finishTaskTool(){return this._finishTaskTool||(this._finishTaskTool=new hu(this.outputSchema)),this._finishTaskTool}async canonicalInstruction(n){return typeof this.instruction=="string"?{instruction:this.instruction,requireStateInjection:!0}:{instruction:await this.instruction(n),requireStateInjection:!1}}async canonicalGlobalInstruction(n){return typeof this.globalInstruction=="string"?{instruction:this.globalInstruction,requireStateInjection:!0}:{instruction:await this.globalInstruction(n),requireStateInjection:!1}}async canonicalTools(n){let o=[];for(let r of this.tools){let i=await RA(r,n);o.push(...i)}return o}static normalizeCallbackArray(n){return n?Array.isArray(n)?n:[n]:[]}get canonicalBeforeModelCallbacks(){return mo.normalizeCallbackArray(this.beforeModelCallback)}get canonicalAfterModelCallbacks(){return mo.normalizeCallbackArray(this.afterModelCallback)}get canonicalBeforeToolCallbacks(){return mo.normalizeCallbackArray(this.beforeToolCallback)}get canonicalAfterToolCallbacks(){return mo.normalizeCallbackArray(this.afterToolCallback)}maybeSaveOutputToState(n){var i,s;if(n.author!==this.name){N.debug(`Skipping output save for agent ${this.name}: event authored by ${n.author}`);return}if(!this.outputKey){N.debug(`Skipping output save for agent ${this.name}: outputKey is not set`);return}if(!ar(n)){N.debug(`Skipping output save for agent ${this.name}: event is not a final response`);return}if(!((s=(i=n.content)==null?void 0:i.parts)!=null&&s.length)){N.debug(`Skipping output save for agent ${this.name}: event content is empty`);return}let o=n.content.parts.map(u=>u.text?u.text:"").join(""),r=o;if(this.outputSchema){if(!o.trim())return;let u;try{u=JSON.parse(o)}catch(c){N.error(`Error parsing output for agent ${this.name}`,c),n.actions.stateDelta[this.outputKey]=o;return}try{r=this.validateOutput(u)}catch(c){N.error(`Output for agent ${this.name} does not satisfy its output schema`,c),r=u}}n.actions.stateDelta[this.outputKey]=r}validateOutput(n){var o;return su((o=this.outputSchemaSource)!=null?o:this.outputSchema,n)}async*runImpl(n,o){yield*oM(this,n,o)}async*runAsyncImpl(n){var o,r;for(;;){let i,s=!1;for await(let c of this.runOneStepAsync(n)){if((o=n.abortSignal)!=null&&o.aborted)return;i=c,(le(c).length>0||fe(c).length>0)&&(s=!0),this.maybeSaveOutputToState(c),yield c}if(!i)break;let u=i.author===this.name&&!i.partial&&(!((r=i.content)!=null&&r.parts)||i.content.parts.length===0)&&vl(i.actions);if(ar(i)&&!(u&&s))break;if(i.partial){N.warn("The last event is partial, which is not expected.");break}}}async*runLiveImpl(n){var o;for await(let r of this.runLiveFlow(n)){if((o=n.abortSignal)!=null&&o.aborted)return;this.maybeSaveOutputToState(r),yield r}n.endInvocation}async*runLiveFlow(n){var s,u,c,l;if(!n.liveRequestQueue)throw new Error("liveRequestQueue is required for LlmAgent.runLiveFlow.");let o={contents:[],toolsDict:{},liveConnectConfig:{}};for await(let p of this.runLivePreprocess(n,o))yield p;if(n.endInvocation||(s=n.abortSignal)!=null&&s.aborted)return;T5(n.runConfig,o);let r=this.canonicalModel,i=0;for(;;){if((u=n.abortSignal)!=null&&u.aborted)return;let p=n.liveSessionResumptionHandle;p&&((c=o.liveConnectConfig)!=null||(o.liveConnectConfig={}),o.liveConnectConfig.sessionResumption={handle:p,transparent:!0});let d;try{d=await r.connect(o)}catch(x){if(gU(x)&&n.liveSessionResumptionHandle){if(i+=1,i>pU)throw N.error(`Max live reconnection attempts reached (${i}).`,x),x;N.info(`Live connect failed (attempt ${i}); retrying with session handle.`,x);continue}throw x}o.contents.length>0&&!n.liveSessionResumptionHandle&&await d.sendHistory(o.contents);let g,h=new AbortController,v=n.abortSignal?AbortSignal.any([n.abortSignal,h.signal]):h.signal,y=this.runSendLoop(d,n.liveRequestQueue,v,n.abortSignal);y.catch(x=>{N.error("Error in live send loop:",x),g=x,h.abort(x),d.close().catch(E=>{N.warn("Error closing connection after send loop failure:",E)})});let _=!1;try{yield*this.runReceiveLoop(n,d,o,h)}catch(x){if(!!n.liveSessionResumptionHandle&&(x instanceof ku||gU(x)))_=!0,N.info("Live connection closed; will reconnect with session handle.",x);else throw await this.teardownLiveConnection(h,d,y),x}if(await this.teardownLiveConnection(h,d,y),(l=n.abortSignal)!=null&&l.aborted)return;if(g)throw g;if(!_)return;if(i+=1,i>pU)throw new Error(`Max live reconnection attempts reached (${i}).`)}}async*runLivePreprocess(n,o){var r,i;for(let s of this.requestProcessors)for await(let u of s.runAsync(n,o)){if((r=n.abortSignal)!=null&&r.aborted)return;yield u}for(let s of this.tools){let u=new Le({invocationContext:n}),c=(await RA(s,new Ie(n))).filter(l=>!o.allowedTools||o.allowedTools.includes(l.name));for(let l of c)if(await l.processLlmRequest({toolContext:u,llmRequest:o}),(i=n.abortSignal)!=null&&i.aborted)return}}async runSendLoop(n,o,r,i){for(;;){if(r!=null&&r.aborted||i!=null&&i.aborted)return;let s;try{s=await o.get(r)}catch(u){if(r!=null&&r.aborted||i!=null&&i.aborted)return;throw u}try{await this.dispatchLiveRequest(n,s)}catch(u){if(r!=null&&r.aborted||i!=null&&i.aborted){N.debug("Send failed after teardown:",u);return}throw N.error("Error dispatching live request to model:",u),u}if(await Promise.resolve(),s.close)return}}async dispatchLiveRequest(n,o){var r,i;if(o.close){await n.close();return}if(o.activityStart){await((r=n.sendActivityStart)==null?void 0:r.call(n));return}if(o.activityEnd){await((i=n.sendActivityEnd)==null?void 0:i.call(n));return}if(o.blob){await n.sendRealtime(o.blob);return}o.content&&await n.sendContent(o.content)}async teardownLiveConnection(n,o,r){n.abort();try{await o.close()}catch(i){N.warn("Error closing live connection:",i)}await r.catch(()=>{})}async*runReceiveLoop(n,o,r,i){var s,u,c,l;for await(let p of o.receive()){if((s=n.abortSignal)!=null&&s.aborted||i.signal.aborted)return;if((u=p.liveSessionResumptionUpdate)!=null&&u.newHandle&&(n.liveSessionResumptionHandle=p.liveSessionResumptionUpdate.newHandle),p.goAway)throw N.info("Received goAway from live server; triggering reconnect."),new ku("goAway");let d=p.inputTranscription||((c=p.content)==null?void 0:c.role)==="user"?"user":this.name,g=J({invocationId:n.invocationId,author:d,branch:n.branch});for await(let h of this.postprocessLive(n,r,p,g)){if(yield h,h.content&&fe(h).length>0&&await o.sendContent(h.content),fe(h).some(_=>_.name==="task_completed")){await hU(mU);return}let y=(l=h.actions)==null?void 0:l.transferToAgent;if(y){await hU(mU),i.abort(),await o.close();let x=We(n).rootAgent.findAgent(y);if(x){let E=n.agent;n.agent=x;let T=n.liveSessionResumptionHandle;n.liveSessionResumptionHandle=void 0;try{for await(let S of x.runLive(n))yield S}finally{n.agent=E,n.liveSessionResumptionHandle=T}}return}}}}async*postprocessLive(n,o,r,i){for(let p of this.responseProcessors)for await(let d of p.runAsync(n,r))yield d;if(!r.content&&!r.errorCode&&!r.interrupted&&!r.turnComplete&&!r.inputTranscription&&!r.outputTranscription&&!r.usageMetadata&&!r.liveSessionResumptionUpdate)return;if(r.liveSessionResumptionUpdate){yield J({...i,liveSessionResumptionUpdate:r.liveSessionResumptionUpdate});return}if(r.inputTranscription){yield J({...i,inputTranscription:r.inputTranscription,partial:r.partial});return}if(r.outputTranscription){yield J({...i,outputTranscription:r.outputTranscription,partial:r.partial});return}let s=J({...i,...r}),u=le(s);if(s.content&&u.length&&(Js(s),s.longRunningToolIds=Array.from(DC(u,o.toolsDict))),yield s,!u.length)return;let c=await fu({invocationContext:n,functionCallEvent:s,toolsDict:o.toolsDict,beforeToolCallbacks:this.canonicalBeforeToolCallbacks,afterToolCallbacks:this.canonicalAfterToolCallbacks});if(!c)return;let l=Af(n,c);l&&(yield l),yield c}async*runOneStepAsync(n){var c,l,p;let o={contents:[],toolsDict:{},liveConnectConfig:{}};for(let d of this.requestProcessors)for await(let g of d.runAsync(n,o)){if((c=n.abortSignal)!=null&&c.aborted)return;yield g}let r=[...this.tools];if(this.mode==="task")r.push(this.finishTaskTool);else if(this.outputSchema&&r.length>0&&!_s(this.canonicalModel.model)){let d=new Dt({name:"set_model_response",description:"Call this tool to submit your final response conforming to the output schema. Use this tool only when you have collected all the information and are ready to return the final answer.",parameters:this.outputSchema,execute:a(async(g,h)=>(h&&(h.actions.skipSummarization=!0),JSON.stringify(g)),"execute")});r.push(d)}let i=J({invocationId:n.invocationId,author:this.name,branch:n.branch});for(let d of r){let g=new Le({invocationContext:n,eventActions:i.actions}),h=(await RA(d,new Ie(n))).filter(v=>!o.allowedTools||o.allowedTools.includes(v.name)||v.name==="set_model_response");for(let v of h)if(await v.processLlmRequest({toolContext:g,llmRequest:o}),(l=n.abortSignal)!=null&&l.aborted)return}if(n.endInvocation||(p=n.abortSignal)!=null&&p.aborted)return;let s=Ze.startSpan("call_llm"),u=$e.setSpan(Ue.active(),s);yield*ur(u,this,async function*(){let d=a(async function*(){var g,h;for await(let v of this.callLlmAsync(n,o,i)){if((g=n.abortSignal)!=null&&g.aborted)return;for await(let y of this.postprocess(n,o,v,i)){if((h=n.abortSignal)!=null&&h.aborted)return;i.id=rm(),i.timestamp=new Date().getTime(),yield y}}},"responsesGenerator");yield*this.runAndHandleError(d.call(this),n,o,i)}),s.end()}async*postprocess(n,o,r,i){var y,_,x,E,T,S;for(let I of this.responseProcessors)for await(let w of I.runAsync(n,r)){if((y=n.abortSignal)!=null&&y.aborted)return;yield w}let s=!r.content&&!!r.usageMetadata;if((!r.content||((_=r.content.parts)==null?void 0:_.length)===0)&&!r.errorCode&&!r.interrupted&&!s)return;let u=J({...i,...r});if(u.content){let I=le(u),w=I.find(b=>b.name==="set_model_response");if(w){let b=w.args;u.content.parts=[{text:JSON.stringify(b)}],u.actions.skipSummarization=!0}else I&&I.length&&(Js(u),u.longRunningToolIds=Array.from(DC(I,o.toolsDict)))}if(yield u,!((x=le(u))!=null&&x.length))return;if((E=n.runConfig)!=null&&E.pauseOnToolCalls){n.endInvocation=!0;return}let c=new cn;n.eventQueue=c;let l=(async()=>{try{return{event:await fu({invocationContext:n,functionCallEvent:u,toolsDict:o.toolsDict,beforeToolCallbacks:this.canonicalBeforeToolCallbacks,afterToolCallbacks:this.canonicalAfterToolCallbacks})}}catch(I){return{event:null,error:I}}finally{c.close()}})();for await(let I of c)yield I;let{event:p,error:d}=await l;if(n.eventQueue=void 0,d)throw d;if(!p||(T=n.abortSignal)!=null&&T.aborted)return;let g=Af(n,p);g&&(yield g);let h=OC({invocationContext:n,functionCallEvent:u,functionResponseEvent:p});if(h){yield h,n.endInvocation=!0;return}yield p;let v=p.actions.transferToAgent;if(v){let I=this.getAgentByName(n,v);for await(let w of I.runAsync(n)){if((S=n.abortSignal)!=null&&S.aborted)return;yield w}}}getAgentByName(n,o){let i=We(n).rootAgent.findAgent(o);if(!i)throw new Error(`Agent ${o} not found in the agent tree.`);return i}async*callLlmAsync(n,o,r){var u,c,l,p,d,g,h,v;let i=await this.handleBeforeModelCallback(n,o,r);if((u=n.abortSignal)!=null&&u.aborted)return;if(i){yield i;return}(c=o.config)!=null||(o.config={}),(p=(l=o.config).labels)!=null||(l.labels={}),o.config.labels[vU]||(o.config.labels[vU]=this.name);let s=this.canonicalModel;if((d=n.runConfig)!=null&&d.supportCfc)throw new Error("CFC is not yet supported in callLlmAsync");{n.incrementLlmCallCount();let y=s.generateContentAsync(o,((g=n.runConfig)==null?void 0:g.streamingMode)==="sse",n.abortSignal);for await(let _ of y){if(vP({invocationContext:n,eventId:r.id,llmRequest:o,llmResponse:_}),(h=n.abortSignal)!=null&&h.aborted)return;let x=await this.handleAfterModelCallback(n,_,r);if((v=n.abortSignal)!=null&&v.aborted)return;yield x!=null?x:_}}}async handleBeforeModelCallback(n,o,r){var u,c;let i=new Le({invocationContext:n,eventActions:r.actions}),s=await n.pluginManager.runBeforeModelCallback({callbackContext:i,llmRequest:o});if(!((u=n.abortSignal)!=null&&u.aborted)){if(s)return s;for(let l of this.canonicalBeforeModelCallbacks){let p=await l({context:i,request:o});if((c=n.abortSignal)!=null&&c.aborted)return;if(p)return p}}}async handleAfterModelCallback(n,o,r){var u;let i=new Le({invocationContext:n,eventActions:r.actions}),s=await n.pluginManager.runAfterModelCallback({callbackContext:i,llmResponse:o});if(s)return s;for(let c of this.canonicalAfterModelCallbacks){let l=await c({context:i,response:o});if((u=n.abortSignal)!=null&&u.aborted)return;if(l)return l}}async*runAndHandleError(n,o,r,i){var s;try{for await(let u of n){if((s=o.abortSignal)!=null&&s.aborted)return;yield u}}catch(u){let c=new Le({invocationContext:o,eventActions:i.actions});if(u instanceof Error){let l=await o.pluginManager.runOnModelErrorCallback({callbackContext:c,llmRequest:r,error:u});if(l)yield l;else{let p="UNKNOWN_ERROR",d=u.message;try{let g=JSON.parse(u.message);g!=null&&g.error&&(p=String(g.error.code||"UNKNOWN_ERROR"),d=g.error.message||d)}catch(g){}i.actions?yield J({invocationId:o.invocationId,author:this.name,errorCode:p,errorMessage:d}):yield{errorCode:p,errorMessage:d}}}else throw N.error("Unknown error during response generation",u),u}}};a(mo,"LlmAgent");var cp=mo;var xU=new Set;function As(t){return function(e){var r;let n=e.name,o=(r=class extends e{constructor(...s){xU.has(n)||(N.warn(t),xU.add(n)),super(...s)}},a(r,"wrapped"),r);return Object.defineProperty(o,"name",{value:n,configurable:!0}),o}}a(As,"deprecated");var NA=Symbol.for("google.adk.loopAgent");function C5(t){return typeof t=="object"&&t!==null&&NA in t&&t[NA]===!0}a(C5,"isLoopAgent");var EU,SU,go=class extends(SU=$t,EU=NA,SU){constructor(n){var o;super(n);this[EU]=!0;this.maxIterations=(o=n.maxIterations)!=null?o:Number.MAX_SAFE_INTEGER}async*runAsyncImpl(n){var r;let o=0;for(;o<this.maxIterations;){for(let i of this.subAgents){let s=!1;for await(let u of i.runAsync(n)){if((r=n.abortSignal)!=null&&r.aborted)return;yield u,u.actions.escalate&&(s=!0)}if(s)return}o++}}async*runLiveImpl(n){var o,r;for(let i=0;i<this.maxIterations;i++)for(let s of this.subAgents)for await(let u of s.runLive(n))if((o=n.abortSignal)!=null&&o.aborted||(yield u,(r=u.actions)!=null&&r.escalate))return}};a(go,"LoopAgent"),go=Re([As("LoopAgent is deprecated in favor of Workflow and will be removed in a future version. Workflow cannot yet be used as an LlmAgent sub-agent.")],go);var $A=Symbol.for("google.adk.parallelAgent");function I5(t){return typeof t=="object"&&t!==null&&$A in t&&t[$A]===!0}a(I5,"isParallelAgent");var TU,CU,ho=class extends(CU=$t,TU=$A,CU){constructor(){super(...arguments);this[TU]=!0}async*runAsyncImpl(n){var r;let o=this.subAgents.map(i=>i.runAsync(A5(this,i,n)));for await(let i of w5(o)){if((r=n.abortSignal)!=null&&r.aborted)return;yield i}}async*runLiveImpl(n){throw new Error("This is not supported yet for ParallelAgent.")}};a(ho,"ParallelAgent"),ho=Re([As("ParallelAgent is deprecated in favor of Workflow and will be removed in a future version. Workflow cannot yet be used as an LlmAgent sub-agent.")],ho);function A5(t,e,n){let o=new Jt(n),r=`${t.name}.${e.name}`;return o.branch=o.branch?`${o.branch}.${r}`:r,o}a(A5,"createBranchCtxForSubAgent");async function*w5(t){let e=new Map;for(let[n,o]of t.entries()){let r=o.next().then(i=>({result:i,index:n}));e.set(n,r)}for(;e.size>0;){let{result:n,index:o}=await Promise.race(e.values());if(n.done){e.delete(o);continue}yield n.value;let r=t[o].next().then(i=>({result:i,index:o}));e.set(o,r)}}a(w5,"mergeAgentRuns");async function*ws(t,e,n,o){let r=await n(t,e);if(!r)throw new Error("Initial routing failed, no item selected.");let i=r;N.debug(`Router selected initial key: ${i}`);let s=t[i];if(!s)throw new Error(`Item not found for key: ${i}`);let u=new Set([i]);for(;;){let c=o(s),l=!1;try{if(b5(c)){for await(let d of c)yield d,l=!0;return}yield await c;return}catch(p){if(l)throw p;{let d=await n(t,e,{failedKeys:u,lastError:p});if(N.debug(`Router selected next key: ${d}`),d===void 0||u.has(d))throw p;if(i=d,s=t[i],!s)throw new Error(`Item not found for key: ${i}`);u.add(i)}}}}a(ws,"runWithRouting");function b5(t){return typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function"}a(b5,"isAsyncGenerator");var DA=Symbol.for("google.adk.routedAgent");function R5(t){return typeof t=="object"&&t!==null&&DA in t&&t[DA]===!0}a(R5,"isRoutedAgent");var IU,AU,LA=class LA extends(AU=$t,IU=DA,AU){constructor(n){let o=Array.isArray(n.agents)?n.agents:Object.values(n.agents);super({...n,subAgents:o});this[IU]=!0;Array.isArray(n.agents)?this.agents=Object.fromEntries(n.agents.map(r=>[r.name,r])):this.agents=n.agents,this.router=n.router}clone(n){let o={...n};return"agents"in o||(o.agents=k5(this.config.agents)),super.clone(o)}async*runAsyncImpl(n){yield*ws(this.agents,n,this.router,o=>o.runAsync(n))}async*runLiveImpl(n){yield*ws(this.agents,n,this.router,o=>o.runLive(n))}};a(LA,"RoutedAgent");var OA=LA;function k5(t){return Array.isArray(t)?t.map(e=>e.clone()):Object.fromEntries(Object.entries(t).map(([e,n])=>[e,n.clone()]))}a(k5,"cloneRoutingTargets");var MA="task_completed",UA=Symbol.for("google.adk.sequentialAgent");function P5(t){return typeof t=="object"&&t!==null&&UA in t&&t[UA]===!0}a(P5,"isSequentialAgent");var wU,bU,vo=class extends(bU=$t,wU=UA,bU){constructor(){super(...arguments);this[wU]=!0}async*runAsyncImpl(n){for(let o of this.subAgents)for await(let r of o.runAsync(n))yield r}async*runLiveImpl(n){for(let o of this.subAgents)te(o)&&((await o.canonicalTools(new Ie(n))).some(s=>s.name===MA)||(o.tools.push(new Dt({name:MA,description:"Signals that the model has successfully completed the user's question or task.",execute:a(()=>"Task completion signaled.","execute")})),o.instruction+=`If you finished the user's request according to its description, call the ${MA} function to exit so the next agents can take over. When calling this function, do not generate any text other than the function call.`));for(let o of this.subAgents)for await(let r of o.runLive(n))yield r}};a(vo,"SequentialAgent"),vo=Re([As("SequentialAgent is deprecated in favor of Workflow and will be removed in a future version. Workflow cannot yet be used as an LlmAgent sub-agent.")],vo);function N5(t={}){return{isResumable:!1,...t}}a(N5,"createResumabilityConfig");var FA=class FA{constructor(){this.artifacts={}}saveArtifact({appName:e,userId:n,sessionId:o,filename:r,artifact:i,customMetadata:s}){if(!i.inlineData&&!i.text&&!i.fileData)return Promise.reject(new Error("Artifact must have either inlineData or text content."));let u=bs(e,n,o,r);this.artifacts[u]||(this.artifacts[u]=[]);let c=this.artifacts[u].length,l={version:c,customMetadata:s};if(!i.inlineData&&i.text===void 0){let p=i.fileData;l.mimeType=p.mimeType}return this.artifacts[u].push({part:i,metadata:l}),Promise.resolve(c)}loadArtifact({appName:e,userId:n,sessionId:o,filename:r,version:i}){let s=bs(e,n,o,r),u=this.artifacts[s];return u?(i===void 0&&(i=u.length-1),u[i]?Promise.resolve(u[i].part):(N.warn(`[InMemoryArtifactService] loadArtifact: Artifact ${r} version ${i} not found`),Promise.resolve(void 0))):Promise.resolve(void 0)}listArtifactKeys({appName:e,userId:n,sessionId:o}){let r=dp("session",e,n,o),i=dp("user",e,n),s=[];for(let u in this.artifacts)u.startsWith(r)?s.push(decodeURIComponent(u.slice(r.length))):u.startsWith(i)&&s.push(decodeURIComponent(u.slice(i.length)));return Promise.resolve(s.sort())}deleteArtifact({appName:e,userId:n,sessionId:o,filename:r}){let i=bs(e,n,o,r);return this.artifacts[i]&&delete this.artifacts[i],Promise.resolve()}listVersions({appName:e,userId:n,sessionId:o,filename:r}){let i=bs(e,n,o,r),s=this.artifacts[i];if(!s)return Promise.resolve([]);let u=[];for(let c=0;c<s.length;c++)u.push(c);return Promise.resolve(u)}listArtifactVersions({appName:e,userId:n,sessionId:o,filename:r}){let i=bs(e,n,o,r),s=this.artifacts[i];return s?Promise.resolve(s.map(u=>u.metadata)):Promise.resolve([])}getArtifactVersion({appName:e,userId:n,sessionId:o,filename:r,version:i}){let s=bs(e,n,o,r),u=this.artifacts[s];return u?(i===void 0&&(i=u.length-1),u[i]?Promise.resolve(u[i].metadata):Promise.resolve(void 0)):Promise.resolve(void 0)}};a(FA,"InMemoryArtifactService");var Pu=FA;function bs(t,e,n,o){return $5(o)?`${dp("user",t,e)}${encodeURIComponent(o)}`:`${dp("session",t,e,n)}${encodeURIComponent(o)}`}a(bs,"artifactPath");function dp(t,...e){return`${[t,...e].map(encodeURIComponent).join("/")}/`}a(dp,"artifactPrefix");function $5(t){return t.startsWith("user:")}a($5,"fileHasUserNamespace");var D5=Symbol.for("google.adk.sessionArtifactService"),RU;RU=D5;var zA=class zA{constructor(e,n,o,r){this.delegate=e;this.appName=n;this.userId=o;this.sessionId=r;this[RU]=!0}async saveArtifact(e){return this.delegate.saveArtifact({appName:this.appName,userId:this.userId,sessionId:this.sessionId,...e})}async loadArtifact(e){return this.delegate.loadArtifact({appName:this.appName,userId:this.userId,sessionId:this.sessionId,...e})}async listArtifactKeys(){return this.delegate.listArtifactKeys({appName:this.appName,userId:this.userId,sessionId:this.sessionId})}async deleteArtifact(e){return this.delegate.deleteArtifact({appName:this.appName,userId:this.userId,sessionId:this.sessionId,filename:e})}async listVersions(e){return this.delegate.listVersions({appName:this.appName,userId:this.userId,sessionId:this.sessionId,filename:e})}async listArtifactVersions(e){return this.delegate.listArtifactVersions({appName:this.appName,userId:this.userId,sessionId:this.sessionId,filename:e})}async getArtifactVersion(e){return this.delegate.getArtifactVersion({appName:this.appName,userId:this.userId,sessionId:this.sessionId,...e})}};a(zA,"ScopedArtifactService");var Rs=zA;var kU=Symbol.for("google.adk.sessionArtifactService");function fp(t){return typeof t=="object"&&t!==null&&kU in t&&t[kU]===!0}a(fp,"isSessionArtifactService");var BA=class BA{constructor(){this.providers=new Map}register(e,n){this.providers.set(e,n)}getProvider(e){return this.providers.get(e.type)}};a(BA,"AuthProviderRegistry");var GA=BA;var VA=class VA{constructor(){this.credentials=Object.create(null)}loadCredential(e,n){let o=this.getBucketForCurrentContext(n);return Promise.resolve(o[e.credentialKey])}async saveCredential(e,n){let o=this.getBucketForCurrentContext(n);e.exchangedAuthCredential&&(o[e.credentialKey]=e.exchangedAuthCredential)}getBucketForCurrentContext(e){let{appName:n,userId:o}=e.invocationContext.session;return this.credentials[n]||(this.credentials[n]=Object.create(null)),this.credentials[n][o]||(this.credentials[n][o]=Object.create(null)),this.credentials[n][o]}};a(VA,"InMemoryCredentialService");var qA=VA;var HA=class HA{loadCredential(e,n){return Promise.resolve(n.state.get(e.credentialKey))}async saveCredential(e,n){e.exchangedAuthCredential&&n.state.set(e.credentialKey,e.exchangedAuthCredential)}};a(HA,"SessionStateCredentialService");var ZA=HA;var KA=class KA{constructor(){this.refreshers={apiKey:void 0,http:void 0,oauth2:void 0,openIdConnect:void 0,serviceAccount:void 0}}register(e,n){this.refreshers[e]=n}getRefresher(e){return this.refreshers[e]}};a(KA,"CredentialRefresherRegistry");var JA=KA;var jA=class jA{constructor(e){this.trigger="AgentControlled";this.summarizer=e.summarizer}shouldCompact(e){return e.session.state["temp:consolidate_context"]===!0}async compact(e){var u;let n=e.session.events,o=po(n,e.isolationScope),r=o.reduce((c,l,p)=>{var d,g;return(g=(d=l.content)==null?void 0:d.parts)!=null&&g.some(h=>{var v;return((v=h.functionCall)==null?void 0:v.name)==="consolidate_context"})?p:c},-1);if(r<=0){this.clearFlags(e);return}let i=o.slice(0,r),s=e.session.state["temp:consolidate_context_detail"];s&&i.push(J({author:"system",timestamp:i[i.length-1].timestamp,content:{role:"user",parts:[{text:`CRITICAL INSTRUCTION FOR SUMMARY: Please summarize the history. Focus especially on: ${s}`}]}}));try{let c=await this.summarizer.summarize(i);(u=c.isolationScope)!=null||(c.isolationScope=e.isolationScope),e.session.events.push(c)}catch(c){console.error("Compaction failed:",c)}finally{this.clearFlags(e)}}clearFlags(e){delete e.session.state["temp:consolidate_context"],delete e.session.state["temp:consolidate_context_detail"]}};a(jA,"AgentControlledContextCompactor");var WA=jA;var XA=class XA{constructor(e){this.tokenThreshold=e.tokenThreshold,this.eventRetentionSize=e.eventRetentionSize,this.summarizer=e.summarizer}getActiveEvents(e,n){let o=e.filter(s=>Wt(s,n)),r;for(let s=o.length-1;s>=0;s--){let u=o[s];if(Es(u)){r=u;break}}if(!r)return o;let i=o.filter(s=>s.timestamp>r.endTime&&!Es(s));return[r,...i]}shouldCompact(e){let n=e.session.events,o=this.getActiveEvents(n,e.isolationScope),i=o.length>0&&Es(o[0])?o.slice(1):o;return i.length<=this.eventRetentionSize||Ss(i,this.eventRetentionSize)===0?!1:o.reduce((c,l)=>c+sP(l),0)>this.tokenThreshold}async compact(e){let n=e.session.events,o=this.getActiveEvents(n,e.isolationScope),r=o.length>0&&Es(o[0]),i=r?o.slice(1):o;if(i.length<=this.eventRetentionSize)return;let s=Ss(i,this.eventRetentionSize);if(s===0)return;let u=i.slice(0,s),c,l=r?o[0]:void 0,p=l&&(l.isolationScope===void 0||l.isolationScope===e.isolationScope)?l:void 0;p?c=await this.summarizer.summarize([p,...u]):c=await this.summarizer.summarize(u);let d={...c,isScratchpad:!0,author:"system",...e.isolationScope===void 0?{}:{isolationScope:e.isolationScope}},g=a(x=>e.isolationScope===void 0||x.isolationScope===e.isolationScope,"shouldReplaceEvent"),h=new Set([...p&&g(p)?[p]:[],...u.filter(g)]),v=n.findIndex(x=>h.has(x)),y=[],_=!1;for(let x=0;x<n.length;x++){let E=n[x];x===v&&(y.push(d),_=!0),h.has(E)||y.push(E)}_||y.push(d),n.length=0,n.push(...y)}};a(XA,"AnchoredContextCompactor");var YA=XA;var O5="The following is a conversation history between a user and an AI agent. Please summarize the conversation, focusing on key information and decisions made, as well as any unresolved questions or tasks. The summary should be concise and capture the essence of the interaction.",ew=class ew{constructor(e){this.llm=e.llm,this.prompt=e.prompt||O5}async summarize(e){var p,d,g,h,v,y;if(e.length===0)throw new Error("Cannot summarize an empty list of events.");let n=e[0].timestamp,o=e[e.length-1].timestamp,r="";for(let _=0;_<e.length;_++)r+=`[Event ${_+1} - Author: ${e[_].author}]
170
+ `,r+=`${yl(e[_])}
171
+
172
+ `;let s={contents:[{role:"user",parts:[{text:`${this.prompt}
173
+
174
+ ${r}`}]}],toolsDict:{},liveConnectConfig:{}},u=this.llm.generateContentAsync(s,!1),c="",l=await u.next();if(l.done||!((g=(d=(p=l.value.content)==null?void 0:p.parts)==null?void 0:d[0])!=null&&g.text))throw new Error("LLM failed to return a valid summary.");c+=l.value.content.parts[0].text;for await(let _ of u)(y=(v=(h=_.content)==null?void 0:h.parts)==null?void 0:v[0])!=null&&y.text&&(c+=_.content.parts[0].text);return qM({author:"system",content:{role:"model",parts:[{text:c}]},startTime:n,endTime:o,compactedContent:c})}};a(ew,"LlmSummarizer");var QA=ew;var L5=4,nw=class nw{constructor(e){this.tokenThreshold=e.tokenThreshold,this.eventRetentionSize=e.eventRetentionSize,this.summarizer=e.summarizer}shouldCompact(e){let n=e.session.events,o=po(n,e.isolationScope),r=o.filter(u=>!dn(u));if(r.length<=this.eventRetentionSize||Ss(r,this.eventRetentionSize)===0)return!1;let s=M5(o,e);return s===void 0?!1:s>this.tokenThreshold}async compact(e){var p;let n=e.session.events,o=po(n,e.isolationScope),r=o.filter(d=>!dn(d));if(r.length<=this.eventRetentionSize)return;let i=Ss(r,this.eventRetentionSize);if(i===0)return;let s=r.slice(0,i),u=o.find(dn),c=u?[u,...s]:s,l=await this.summarizer.summarize(c);l.actions||(l.actions={stateDelta:{},artifactDelta:{},requestedAuthConfigs:{},requestedToolConfirmations:{}}),(p=l.isolationScope)!=null||(l.isolationScope=e.isolationScope),e.session.events.push(l)}};a(nw,"TokenBasedContextCompactor");var tw=nw;function M5(t,e){var n;for(let o=t.length-1;o>=0;o--){let r=(n=t[o].usageMetadata)==null?void 0:n.promptTokenCount;if(r!==void 0)return r}return U5(t,e)}a(M5,"latestPromptTokenCount");function U5(t,e){var r;let n=wu(t,We(e).name,e.branch),o=0;for(let i of n)for(let s of(r=i.parts)!=null?r:[])s.text&&(o+=s.text.length),s.functionCall&&(o+=JSON.stringify(s.functionCall).length),s.functionResponse&&(o+=JSON.stringify(s.functionResponse).length);if(!(o<=0))return Math.ceil(o/L5)}a(U5,"estimatePromptTokenCount");var ow=class ow{constructor(e){if(e.eventRetentionSize<0)throw new Error("eventRetentionSize must be a non-negative integer.");this.eventRetentionSize=e.eventRetentionSize}shouldCompact(e){let n=e.session.events,o=n.flatMap((i,s)=>Wt(i,e.isolationScope)?[s]:[]);return o.length<=this.eventRetentionSize?!1:o.slice(0,o.length-this.eventRetentionSize).map(i=>n[i]).some(i=>_l(i))}compact(e){let n=e.session.events,o=n.flatMap((i,s)=>Wt(i,e.isolationScope)?[s]:[]);if(o.length<=this.eventRetentionSize)return;let r=o.slice(0,o.length-this.eventRetentionSize);for(let i of r){let s=n[i];_l(s)&&(n[i]=nm(s))}}};a(ow,"TrajectoryThoughtPruningCompactor");var rw=ow;var sw=class sw{constructor(e){var n;this.threshold=e.threshold,this.preserveLeadingEvents=(n=e.preserveLeadingEvents)!=null?n:0}shouldCompact(e){return e.session.events.filter(o=>Wt(o,e.isolationScope)).length>this.threshold+Math.max(0,this.preserveLeadingEvents)}compact(e){let n=e.session.events,o=n.flatMap((u,c)=>Wt(u,e.isolationScope)?[c]:[]),r=o.length-this.threshold-Math.max(0,this.preserveLeadingEvents);if(r<=0)return;let i=Math.max(0,this.preserveLeadingEvents),s=o.slice(i,i+r);for(let u of s.reverse())n.splice(u,1)}};a(sw,"TruncatingContextCompactor");var iw=sw;var yo=class{constructor(){this.initialized=!1}get isInitialized(){return this.initialized}async initialize(){}async close(){}assertInitialized(){if(!this.initialized)throw new Error("Environment is not initialized. Call initialize() first.")}};a(yo,"BaseEnvironment"),yo=Re([tt],yo);var uw=class uw extends Error{constructor(e="The resource already exists."){super(e),this.name="AlreadyExistsError"}};a(uw,"AlreadyExistsError");var aw=uw;var cw=class cw extends Error{constructor(e="Invalid input."){super(e),this.name="InputValidationError"}};a(cw,"InputValidationError");var lw=cw;var fw=class fw extends Error{constructor(e="The requested item was not found."){super(e),this.name="NotFoundError"}};a(fw,"NotFoundError");var dw=fw;var mw=class mw extends Error{constructor(e="Session not found."){super(e),this.name="SessionNotFoundError"}};a(mw,"SessionNotFoundError");var pw=mw;var PU=(l=>(l.BAD_REQUEST="BAD_REQUEST",l.UNAUTHORIZED="UNAUTHORIZED",l.FORBIDDEN="FORBIDDEN",l.NOT_FOUND="NOT_FOUND",l.REQUEST_TIMEOUT="REQUEST_TIMEOUT",l.INTERNAL_SERVER_ERROR="INTERNAL_SERVER_ERROR",l.BAD_GATEWAY="BAD_GATEWAY",l.SERVICE_UNAVAILABLE="SERVICE_UNAVAILABLE",l.GATEWAY_TIMEOUT="GATEWAY_TIMEOUT",l))(PU||{}),hw=class hw extends Error{constructor(n,o){super(n);this.errorType=o;this.name="ToolExecutionError"}};a(hw,"ToolExecutionError");var gw=hw;var NU=(p=>(p.THOUGHT="thought",p.CONTENT="content",p.TOOL_CALL="tool_call",p.TOOL_RESULT="tool_result",p.CALL_CODE="call_code",p.CODE_RESULT="code_result",p.ERROR="error",p.ACTIVITY="activity",p.TOOL_CONFIRMATION="tool_confirmation",p.FINISHED="finished",p))(NU||{});function F5(t){var n,o;let e=[];if(t.errorCode)return e.push({type:"error",error:new Error(t.errorMessage||t.errorCode)}),e;for(let r of(o=(n=t.content)==null?void 0:n.parts)!=null?o:[])r.functionCall&&!rt(r.functionCall)?e.push({type:"tool_call",call:r.functionCall}):r.functionResponse&&!rt(r.functionResponse)?e.push({type:"tool_result",result:r.functionResponse}):r.executableCode&&!rt(r.executableCode)?e.push({type:"call_code",code:r.executableCode}):r.codeExecutionResult&&!rt(r.codeExecutionResult)?e.push({type:"code_result",result:r.codeExecutionResult}):r.text&&(r.thought?e.push({type:"thought",content:r.text}):e.push({type:"content",content:r.text}));return t.actions.requestedToolConfirmations&&!rt(t.actions.requestedToolConfirmations)&&e.push({type:"tool_confirmation",confirmations:t.actions.requestedToolConfirmations}),ar(t)&&e.push({type:"finished",output:void 0}),e}a(F5,"toStructuredEvents");var vw=Symbol.for("google.adk.baseExampleProvider");function _w(t){return typeof t=="object"&&t!==null&&vw in t&&t[vw]===!0}a(_w,"isBaseExampleProvider");var $U;$U=vw;var xw=class xw{constructor(){this[$U]=!0}};a(xw,"BaseExampleProvider");var yw=xw;var Ew=class Ew{constructor(){this.memories=[];this.sessionEvents=Object.create(null)}async addSessionToMemory(e){let n=DU(e.appName,e.userId);this.sessionEvents[n]||(this.sessionEvents[n]=Object.create(null)),this.sessionEvents[n][e.id]=e.events.filter(o=>{var r,i,s;return((s=(i=(r=o.content)==null?void 0:r.parts)==null?void 0:i.length)!=null?s:0)>0})}async searchMemory(e){var i,s;let n=DU(e.appName,e.userId);if(!this.sessionEvents[n])return Promise.resolve({memories:[]});let o=e.query.toLowerCase().split(/\s+/),r={memories:[]};for(let u of Object.values(this.sessionEvents[n]))for(let c of u){if(!((s=(i=c.content)==null?void 0:i.parts)!=null&&s.length))continue;let l=c.content.parts.map(g=>g.text).filter(g=>!!g).join(" "),p=z5(l);if(!p.size)continue;o.some(g=>p.has(g))&&r.memories.push({content:c.content,author:c.author,timestamp:G5(c.timestamp)})}return r}};a(Ew,"InMemoryMemoryService");var _o=Ew;function DU(t,e){return`${t}/${e}`}a(DU,"getUserKey");function z5(t){return new Set([...t.matchAll(/[A-Za-z]+/g)].map(e=>e[0].toLowerCase()))}a(z5,"extractWordsLower");function G5(t){return new Date(t).toISOString()}a(G5,"formatTimestamp");var Tw=class Tw extends Yn{constructor({models:e,router:n,modelName:o="routed-llm"}){let r=Array.isArray(e)?Object.fromEntries(e.map(u=>[u.model,u])):e,s=`RoutedLlm[${Object.entries(r).map(([u,c])=>`${u} (${c.model})`).join(", ")}]`;super({model:o==="routed-llm"?s:o}),this.models=r,this.router=n}async*generateContentAsync(e,n){N.info(`Routing request via ${this.model}`),yield*ws(this.models,e,this.router,o=>o.generateContentAsync(e,n))}async connect(e){let o=await ws(this.models,e,this.router,r=>r.connect(e)).next();if(o.done||o.value===void 0)throw new Error("Failed to establish connection: No connection yielded.");return o.value}};a(Tw,"RoutedLlm");var Sw=Tw;var Eo="ERROR_HANDLED_BY_REFLECT_AND_RETRY_PLUGIN",OU="__global_reflect_and_retry_scope__",pp=(n=>(n.INVOCATION="invocation",n.GLOBAL="global",n))(pp||{});function Nu(t,e){if(t==="invocation"){if(!e)throw new Error("invocation_id must be provided for INVOCATION scope");return e}else if(t==="global")return OU;throw new Error(`Unknown scope: ${t}`)}a(Nu,"resolveScopeKey");var Cw=class Cw{constructor(){this.scopedFailureCounters=new Map;this.lockPromise=Promise.resolve()}async acquireLock(){let e,n=new Promise(r=>{e=r}),o=this.lockPromise;return this.lockPromise=this.lockPromise.then(()=>n),await o,e}async increment(e,n){var r;let o=await this.acquireLock();try{let i=this.scopedFailureCounters.get(e);i||(i=new Map,this.scopedFailureCounters.set(e,i));let s=((r=i.get(n))!=null?r:0)+1;return i.set(n,s),s}finally{o()}}async reset(e,n){let o=await this.acquireLock();try{let r=this.scopedFailureCounters.get(e);r&&(r.delete(n),r.size===0&&this.scopedFailureCounters.delete(e))}finally{o()}}async getCount(e,n){var r,i;let o=await this.acquireLock();try{return(i=(r=this.scopedFailureCounters.get(e))==null?void 0:r.get(n))!=null?i:0}finally{o()}}};a(Cw,"ScopedFailureTracker");var xo=Cw;var Aw=class Aw extends Lt{constructor(e,n="global_instruction"){super(n),this.globalInstruction=e}async beforeModelCallback(e){if(!this.globalInstruction)return;let n=new Ie(e.callbackContext.invocationContext),o=await this.resolveGlobalInstruction(n);if(!o)return;e.llmRequest.config||(e.llmRequest.config={});let r=e.llmRequest.config.systemInstruction;if(!r||Array.isArray(r)&&r.length===0){e.llmRequest.config.systemInstruction=o;return}typeof r=="string"?e.llmRequest.config.systemInstruction=`${o}
175
+
176
+ ${r}`:Array.isArray(r)?e.llmRequest.config.systemInstruction=[o,...r]:e.llmRequest.config.systemInstruction=[o,r]}async resolveGlobalInstruction(e){return typeof this.globalInstruction=="string"?await bu(this.globalInstruction,e):await this.globalInstruction(e)}};a(Aw,"GlobalInstructionPlugin");var Iw=Aw;var bw=class bw extends Lt{constructor(e="logging_plugin"){super(e)}async onUserMessageCallback({invocationContext:e,userMessage:n}){var o,r;this.log("\u{1F680} USER MESSAGE RECEIVED"),this.log(` Invocation ID: ${e.invocationId}`),this.log(` Session ID: ${e.session.id}`),this.log(` User ID: ${e.userId}`),this.log(` App Name: ${e.appName}`),this.log(` Root Agent: ${(r=(o=e.agent)==null?void 0:o.name)!=null?r:"Unknown"}`),this.log(` User Content: ${this.formatContent(n)}`),e.branch&&this.log(` Branch: ${e.branch}`)}async beforeRunCallback({invocationContext:e}){var n,o;this.log("\u{1F3C3} INVOCATION STARTING"),this.log(` Invocation ID: ${e.invocationId}`),this.log(` Starting Agent: ${(o=(n=e.agent)==null?void 0:n.name)!=null?o:"Unknown"}`)}async onEventCallback({event:e}){this.log("\u{1F4E2} EVENT YIELDED"),this.log(` Event ID: ${e.id}`),this.log(` Author: ${e.author}`),this.log(` Content: ${this.formatContent(e.content)}`),this.log(` Final Response: ${ar(e)}`);let n=le(e);if(n.length>0){let r=n.map(i=>i.name);this.log(` Function Calls: ${r}`)}let o=fe(e);if(o.length>0){let r=o.map(i=>i.name);this.log(` Function Responses: ${r}`)}e.longRunningToolIds&&e.longRunningToolIds.length>0&&this.log(` Long Running Tools: ${[...e.longRunningToolIds]}`)}async afterRunCallback({invocationContext:e}){var n,o;this.log("\u2705 INVOCATION COMPLETED"),this.log(` Invocation ID: ${e.invocationId}`),this.log(` Final Agent: ${(o=(n=e.agent)==null?void 0:n.name)!=null?o:"Unknown"}`)}async beforeAgentCallback({callbackContext:e}){this.log("\u{1F916} AGENT STARTING"),this.log(` Agent Name: ${e.agentName}`),this.log(` Invocation ID: ${e.invocationId}`),e.invocationContext.branch&&this.log(` Branch: ${e.invocationContext.branch}`)}async afterAgentCallback({callbackContext:e}){this.log("\u{1F916} AGENT COMPLETED"),this.log(` Agent Name: ${e.agentName}`),this.log(` Invocation ID: ${e.invocationId}`)}async beforeModelCallback({callbackContext:e,llmRequest:n}){var o;if(this.log("\u{1F9E0} LLM REQUEST"),this.log(` Model: ${(o=n.model)!=null?o:"default"}`),this.log(` Agent: ${e.agentName}`),n.config&&n.config.systemInstruction){let r=n.config.systemInstruction;r.length>200&&(r=r.substring(0,200)+"..."),this.log(` System Instruction: '${r}'`)}if(n.toolsDict){let r=Object.keys(n.toolsDict);this.log(` Available Tools: ${r}`)}}async afterModelCallback({callbackContext:e,llmResponse:n}){this.log("\u{1F9E0} LLM RESPONSE"),this.log(` Agent: ${e.agentName}`),n.errorCode?(this.log(` \u274C ERROR - Code: ${n.errorCode}`),this.log(` Error Message: ${n.errorMessage}`)):(this.log(` Content: ${this.formatContent(n.content)}`),n.partial&&this.log(` Partial: ${n.partial}`),n.turnComplete!==void 0&&this.log(` Turn Complete: ${n.turnComplete}`)),n.usageMetadata&&this.log(` Token Usage - Input: ${n.usageMetadata.promptTokenCount}, Output: ${n.usageMetadata.candidatesTokenCount}`)}async beforeToolCallback({tool:e,toolArgs:n,toolContext:o}){this.log("\u{1F527} TOOL STARTING"),this.log(` Tool Name: ${e.name}`),this.log(` Agent: ${o.agentName}`),this.log(` Function Call ID: ${o.functionCallId}`),this.log(` Arguments: ${this.formatArgs(n)}`)}async afterToolCallback({tool:e,toolContext:n,result:o}){this.log("\u{1F527} TOOL COMPLETED"),this.log(` Tool Name: ${e.name}`),this.log(` Agent: ${n.agentName}`),this.log(` Function Call ID: ${n.functionCallId}`),this.log(` Result: ${this.formatArgs(o)}`)}async onModelErrorCallback({callbackContext:e,error:n}){this.log("\u{1F9E0} LLM ERROR"),this.log(` Agent: ${e.agentName}`),this.log(` Error: ${n}`)}async onToolErrorCallback({tool:e,toolArgs:n,toolContext:o,error:r}){this.log("\u{1F527} TOOL ERROR"),this.log(` Tool Name: ${e.name}`),this.log(` Agent: ${o.agentName}`),this.log(` Function Call ID: ${o.functionCallId}`),this.log(` Arguments: ${this.formatArgs(n)}`),this.log(` Error: ${r}`)}log(e){let n=`\x1B[90m[${this.name}] ${e}\x1B[0m`;N.info(n)}formatContent(e,n=200){if(!e||!e.parts)return"None";let o=[];for(let r of e.parts)if(r.text){let i=r.text.trim();i.length>n&&(i=i.substring(0,n)+"..."),o.push(`text: '${i}'`)}else r.functionCall?o.push(`function_call: ${r.functionCall.name}`):r.functionResponse?o.push(`function_response: ${r.functionResponse.name}`):r.codeExecutionResult?o.push("code_execution_result"):o.push("other_part");return o.join(" | ")}formatArgs(e,n=300){if(!e)return"{}";let o=JSON.stringify(e);return o.length>n&&(o=o.substring(0,n)+"...}"),o}};a(bw,"LoggingPlugin");var ww=bw;var Rw=class Rw{constructor(e){this.plugins=new Set;if(e)for(let n of e)this.registerPlugin(n)}get hasPlugins(){return this.plugins.size>0}registerPlugin(e){if(this.plugins.has(e))throw new Error(`Plugin '${e.name}' already registered.`);if(Array.from(this.plugins).some(n=>n.name===e.name))throw new Error(`Plugin with name '${e.name}' already registered.`);this.plugins.add(e),N.info(`Plugin '${e.name}' registered.`)}getPlugin(e){return Array.from(this.plugins).find(n=>n.name===e)}async runCallbacks(e,n,o){for(let r of e)try{let i=await n(r);if(i!==void 0)return N.debug(`Plugin '${r.name}' returned a value for callback '${o}', exiting early.`),i}catch(i){let s=`Error in plugin '${r.name}' during '${o}' callback: ${i}`;throw N.error(s),new Error(s)}}async runOnUserMessageCallback({userMessage:e,invocationContext:n}){return await this.runCallbacks(this.plugins,o=>o.onUserMessageCallback({userMessage:e,invocationContext:n}),"onUserMessageCallback")}async runBeforeRunCallback({invocationContext:e}){return await this.runCallbacks(this.plugins,n=>n.beforeRunCallback({invocationContext:e}),"beforeRunCallback")}async runAfterRunCallback({invocationContext:e}){await this.runCallbacks(this.plugins,n=>n.afterRunCallback({invocationContext:e}),"afterRunCallback")}async runOnEventCallback({invocationContext:e,event:n}){return await this.runCallbacks(this.plugins,o=>o.onEventCallback({invocationContext:e,event:n}),"onEventCallback")}async runBeforeAgentCallback({agent:e,callbackContext:n}){return await this.runCallbacks(this.plugins,o=>o.beforeAgentCallback({agent:e,callbackContext:n}),"beforeAgentCallback")}async runAfterAgentCallback({agent:e,callbackContext:n}){return await this.runCallbacks(this.plugins,o=>o.afterAgentCallback({agent:e,callbackContext:n}),"afterAgentCallback")}async runBeforeNodeCallback({node:e,nodeContext:n,input:o}){return this.runCallbacks(this.plugins,r=>r.beforeNodeCallback({node:e,nodeContext:n,input:o}),"beforeNodeCallback")}async runAfterNodeCallback({node:e,nodeContext:n,output:o}){return this.runCallbacks(this.plugins,r=>r.afterNodeCallback({node:e,nodeContext:n,output:o}),"afterNodeCallback")}async runBeforeToolSelection({callbackContext:e,tools:n}){return await this.runCallbacks(this.plugins,o=>o.beforeToolSelection({callbackContext:e,tools:n}),"beforeToolSelection")}async runBeforeContextCompaction({invocationContext:e,trigger:n}){await this.runCallbacks(this.plugins,o=>o.beforeContextCompaction({invocationContext:e,trigger:n}),"beforeContextCompaction")}async runAfterContextCompaction({invocationContext:e,trigger:n}){await this.runCallbacks(this.plugins,o=>o.afterContextCompaction({invocationContext:e,trigger:n}),"afterContextCompaction")}async runBeforeToolCallback({tool:e,toolArgs:n,toolContext:o}){return await this.runCallbacks(this.plugins,r=>r.beforeToolCallback({tool:e,toolArgs:n,toolContext:o}),"beforeToolCallback")}async runAfterToolCallback({tool:e,toolArgs:n,toolContext:o,result:r}){return await this.runCallbacks(this.plugins,i=>i.afterToolCallback({tool:e,toolArgs:n,toolContext:o,result:r}),"afterToolCallback")}async runOnModelErrorCallback({callbackContext:e,llmRequest:n,error:o}){return await this.runCallbacks(this.plugins,r=>r.onModelErrorCallback({callbackContext:e,llmRequest:n,error:o}),"onModelErrorCallback")}async runBeforeModelCallback({callbackContext:e,llmRequest:n}){return await this.runCallbacks(this.plugins,o=>o.beforeModelCallback({callbackContext:e,llmRequest:n}),"beforeModelCallback")}async runAfterModelCallback({callbackContext:e,llmResponse:n}){return await this.runCallbacks(this.plugins,o=>o.afterModelCallback({callbackContext:e,llmResponse:n}),"afterModelCallback")}async runOnToolErrorCallback({tool:e,toolArgs:n,toolContext:o,error:r}){return await this.runCallbacks(this.plugins,i=>i.onToolErrorCallback({tool:e,toolArgs:n,toolContext:o,error:r}),"onToolErrorCallback")}};a(Rw,"PluginManager");var $u=Rw;var Ye=[];for(let t=0;t<256;++t)Ye.push((t+256).toString(16).slice(1));function LU(t,e=0){return(Ye[t[e+0]]+Ye[t[e+1]]+Ye[t[e+2]]+Ye[t[e+3]]+"-"+Ye[t[e+4]]+Ye[t[e+5]]+"-"+Ye[t[e+6]]+Ye[t[e+7]]+"-"+Ye[t[e+8]]+Ye[t[e+9]]+"-"+Ye[t[e+10]]+Ye[t[e+11]]+Ye[t[e+12]]+Ye[t[e+13]]+Ye[t[e+14]]+Ye[t[e+15]]).toLowerCase()}a(LU,"unsafeStringify");var kw,B5=new Uint8Array(16);function Pw(){if(!kw){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");kw=crypto.getRandomValues.bind(crypto)}return kw(B5)}a(Pw,"rng");var q5=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Nw={randomUUID:q5};function V5(t,e,n){var r,i,s;if(Nw.randomUUID&&!e&&!t)return Nw.randomUUID();t=t||{};let o=(s=(i=t.random)!=null?i:(r=t.rng)==null?void 0:r.call(t))!=null?s:Pw();if(o.length<16)throw new Error("Random bytes length must be >= 16");if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,e){if(n=n||0,n<0||n+16>e.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let u=0;u<16;++u)e[n+u]=o[u];return e}return LU(o)}a(V5,"v4");var $w=V5;var Dw="RESERVED_TOOL_CALL",So="adk_handle_model_error",Lw=class Lw extends Lt{constructor(e={}){var o,r,i,s,u;super((o=e.name)!=null?o:"reflect_retry_model_plugin");let n=(r=e.maxRetries)!=null?r:3;if(n<0)throw new Error("maxRetries must be a non-negative integer.");this.maxRetries=n,this.throwExceptionIfRetryExceeded=(i=e.throwExceptionIfRetryExceeded)!=null?i:!0,this.scope=(s=e.trackingScope)!=null?s:"invocation",this.onModelErrors=(u=e.onModelErrors)!=null?u:[gn.MALFORMED_FUNCTION_CALL],this.tracker=new xo}adkHandleModelError({retryCount:e}){return{reflection_guidance:`
177
+ The call to the model failed.
178
+
179
+ **Reflection Guidance:**
180
+ - This is retry attempt **${e!=null?e:1}** of **${this.maxRetries}**
181
+ - Analyze the error and the arguments you provided. Do not repeat the exact same call.
182
+
183
+ Formulate a new plan based on your analysis and try a corrected or different approach.
184
+ `.trim()}}checkForModelError(e){return!e.errorCode&&!e.finishReason?!1:!!(e.finishReason&&this.onModelErrors.includes(e.finishReason))}getModelNameFromContext(e){return e.agentName||"default_model"}async beforeModelCallback({llmRequest:e}){this.provideReflectionTool(e)}async afterModelCallback({callbackContext:e,llmResponse:n}){if(this.hasReservedToolCall(n))return await this.handleReservedToolCall(e,n);if(this.checkForModelError(n))return await this.handleModelError(e,n);let o=this.getModelScopeKey(e),r=this.getModelNameFromContext(e);await this.resetModelFailureCount(o,r)}provideReflectionTool(e){e.toolsDict||(e.toolsDict={}),e.toolsDict[So]=new Dt({name:So,description:"A tool that triggers reflection. Reserved for internal framework use only. Do not call directly.",execute:a(n=>this.adkHandleModelError(n),"execute")})}hasReservedToolCall(e){var n;if(!((n=e.content)!=null&&n.parts))return!1;for(let o of e.content.parts)if(o.functionCall&&o.functionCall.name===So)return!0;return!1}async handleReservedToolCall(e,n){let o=await this.handleModelRetry(e,Dw,`Model attempted to call reserved tool ${So} directly. This tool is reserved for framework use only. Do not call it.`,gn.OTHER);return o!==void 0?o:{errorCode:Dw,errorMessage:"Model attempted to call reserved tool and retry limit was exceeded."}}async handleModelError(e,n){var r,i,s;let o=await this.handleModelRetry(e,(r=n.errorCode)!=null?r:"MODEL_ERROR",(i=n.errorMessage)!=null?i:"Model error encountered.",(s=n.finishReason)!=null?s:gn.OTHER);return o!==void 0?o:n}async handleModelRetry(e,n,o,r){let i=this.getModelScopeKey(e),s=this.getModelNameFromContext(e),u=await this.incrementModelFailureCount(i,s);if(u<=this.maxRetries)return{content:{role:"model",parts:[this.generateModelRetryPart(u,n,o,r)]}};if(this.throwExceptionIfRetryExceeded)throw new Error(`The model has failed consecutively ${this.maxRetries} times and the retry limit has been exceeded.`)}generateModelRetryPart(e,n,o,r){return{functionCall:{id:this.getModelRetryUuid(),name:So,args:{response_type:Eo,error_type:n,error_details:o,finish_reason:r,retry_count:e}}}}getModelRetryUuid(){return`${So}_${$w()}`}getModelScopeKey(e){return Nu(this.scope,e.invocationId)}async incrementModelFailureCount(e,n){return await this.tracker.increment(e,n)}async resetModelFailureCount(e,n){await this.tracker.reset(e,n)}};a(Lw,"ReflectAndRetryModelPlugin");var Ow=Lw;var Uw=class Uw extends Lt{constructor(e={}){var o,r,i,s;super((o=e.name)!=null?o:"reflect_retry_tool_plugin");let n=(r=e.maxRetries)!=null?r:3;if(n<0)throw new Error("maxRetries must be a non-negative integer.");this.maxRetries=n,this.throwExceptionIfRetryExceeded=(i=e.throwExceptionIfRetryExceeded)!=null?i:!0,this.scope=(s=e.trackingScope)!=null?s:"invocation",this.tracker=new xo}async afterToolCallback({tool:e,toolArgs:n,toolContext:o,result:r}){if(r&&typeof r=="object"&&r.response_type===Eo)return;let i=await this.extractErrorFromResult({tool:e,toolArgs:n,toolContext:o,result:r});if(i!=null)return await this.handleToolError(e,n,o,i);await this.resetFailuresForTool(o,e.name)}async extractErrorFromResult(e){}async onToolErrorCallback({tool:e,toolArgs:n,toolContext:o,error:r}){return await this.handleToolError(e,n,o,r)}async handleToolError(e,n,o,r){if(this.maxRetries===0){if(this.throwExceptionIfRetryExceeded)throw this.ensureException(r);return this.getToolRetryExceedMsg(e,n,r)}let i=this.getScopeKey(o),s=await this.tracker.increment(i,e.name);if(s<=this.maxRetries)return this.createToolReflectionResponse(e,n,r,s);if(this.throwExceptionIfRetryExceeded)throw this.ensureException(r);return this.getToolRetryExceedMsg(e,n,r)}getScopeKey(e){return Nu(this.scope,e.invocationId)}async resetFailuresForTool(e,n){let o=this.getScopeKey(e);await this.tracker.reset(o,n)}ensureException(e){return e instanceof Error?e:new Error(String(e))}formatErrorDetails(e){return e instanceof Error?`${e.name||"Error"}: ${e.message}`:String(e)}createToolReflectionResponse(e,n,o,r){let i=JSON.stringify(n!=null?n:{},null,2),s=this.formatErrorDetails(o),u=`
185
+ The call to tool \`${e.name}\` failed.
186
+
187
+ **Error Details:**
188
+ \`\`\`
189
+ ${s}
190
+ \`\`\`
191
+
192
+ **Tool Arguments Used:**
193
+ \`\`\`json
194
+ ${i}
195
+ \`\`\`
196
+
197
+ **Reflection Guidance:**
198
+ This is retry attempt **${r} of ${this.maxRetries}**. Analyze the error and the arguments you provided. Do not repeat the exact same call. Consider the following before your next attempt:
199
+
200
+ 1. **Invalid Parameters**: Does the error suggest that one or more arguments are incorrect, badly formatted, or missing? Review the tool's schema and your arguments.
201
+ 2. **State or Preconditions**: Did a previous step fail or not produce the necessary state/resource for this tool to succeed?
202
+ 3. **Alternative Approach**: Is this the right tool for the job? Could another tool or a different sequence of steps achieve the goal?
203
+ 4. **Simplify the Task**: Can you break the problem down into smaller, simpler steps?
204
+ 5. **Wrong Function Name**: Does the error indicates the tool is not found? Please check again and only use available tools.
205
+
206
+ Formulate a new plan based on your analysis and try a corrected or different approach.
207
+ `.trim();return{response_type:Eo,error_type:o instanceof Error?o.name||"Error":"ToolError",error_details:o instanceof Error?o.message:String(o),retry_count:r,reflection_guidance:u}}getToolRetryExceedMsg(e,n,o){let r=this.formatErrorDetails(o),i=JSON.stringify(n!=null?n:{},null,2),s=`
208
+ The tool \`${e.name}\` has failed consecutively ${this.maxRetries} times and the retry limit has been exceeded.
209
+
210
+ **Last Error:**
211
+ \`\`\`
212
+ ${r}
213
+ \`\`\`
214
+
215
+ **Last Arguments Used:**
216
+ \`\`\`json
217
+ ${i}
218
+ \`\`\`
219
+
220
+ **Final Instruction:**
221
+ **Do not attempt to use the \`${e.name}\` tool again for this task.** You must now try a different approach. Acknowledge the failure and devise a new strategy, potentially using other available tools or informing the user that the task cannot be completed.
222
+ `.trim();return{response_type:Eo,error_type:o instanceof Error?o.name||"Error":"ToolError",error_details:o instanceof Error?o.message:String(o),retry_count:this.maxRetries,reflection_guidance:s}}};a(Uw,"ReflectAndRetryToolPlugin");var Mw=Uw;var Fw="orcas_tool_call_security_check_states",MU="This tool call needs external confirmation before completion.",UU=(o=>(o.DENY="DENY",o.CONFIRM="CONFIRM",o.ALLOW="ALLOW",o))(UU||{}),Gw=class Gw{async evaluate(e){return Promise.resolve({outcome:"ALLOW",reason:"For prototyping purpose, all tool calls are allowed."})}};a(Gw,"InMemoryPolicyEngine");var mp=Gw,Bw=class Bw extends Lt{constructor(e){var n;super("security_plugin"),this.policyEngine=(n=e==null?void 0:e.policyEngine)!=null?n:new mp}async beforeToolCallback({tool:e,toolArgs:n,toolContext:o}){let r=this.getToolCallCheckState(o);if(!r)return this.checkToolCallPolicy({tool:e,toolArgs:n,toolContext:o});if(r==="CONFIRM"){if(!o.toolConfirmation)return{partial:MU};if(this.setToolCallCheckState(o,o.toolConfirmation),!o.toolConfirmation.confirmed)return{error:"Tool call rejected from confirmation flow."};o.toolConfirmation=void 0}}getToolCallCheckState(e){var r;let{functionCallId:n}=e;return n?((r=e.state.get(Fw))!=null?r:{})[n]:void 0}setToolCallCheckState(e,n){var i;let{functionCallId:o}=e;if(!o)return;let r=(i=e.state.get(Fw))!=null?i:{};r[o]=n,e.state.set(Fw,r)}async checkToolCallPolicy({tool:e,toolArgs:n,toolContext:o}){let r=await this.policyEngine.evaluate({tool:e,toolArgs:n});switch(this.setToolCallCheckState(o,r.outcome),r.outcome){case"DENY":return{error:`This tool call is rejected by policy engine. Reason: ${r.reason}`};case"CONFIRM":return o.requestConfirmation({hint:`Policy engine requires confirmation calling tool: ${e.name}. Reason: ${r.reason}`}),{partial:MU};case"ALLOW":return;default:return}}};a(Bw,"SecurityPlugin");var zw=Bw;function Z5(t){if(!t.content||!t.content.parts)return[];let e=[];for(let n of t.content.parts)n&&n.functionCall&&n.functionCall.name===je&&e.push(n.functionCall);return e}a(Z5,"getAskUserConfirmationFunctionCalls");var Vw=class Vw{async getOrCreateSession(e){if(!e.sessionId)return this.createSession(e);let n=await this.getSession({appName:e.appName,userId:e.userId,sessionId:e.sessionId});return n||this.createSession(e)}async appendEvent({session:e,event:n}){if(n.partial)return n;n=H5(n),this.updateSessionState({session:e,event:n});let o=e.events.findIndex(r=>r.id===n.id);return o>=0?e.events[o]=n:e.events.push(n),n}updateSessionState({session:e,event:n}){if(!(!n.actions||!n.actions.stateDelta))for(let[o,r]of Object.entries(n.actions.stateDelta))o.startsWith(me.TEMP_PREFIX)||tP(e.state,n.actions.stateDelta,o)&&Object.defineProperty(e.state,o,{value:r,writable:!0,enumerable:!0,configurable:!0})}};a(Vw,"BaseSessionService");var Du=Vw;function H5(t){if(!t.actions||!t.actions.stateDelta)return t;let e=t.actions.stateDelta,n=Object.create(null);for(let[o,r]of Object.entries(e))o.startsWith(me.TEMP_PREFIX)||(n[o]=r);return hl(e,n),t.actions.stateDelta=n,t}a(H5,"trimTempDeltaState");function FU(t){let e=Object.create(null);for(let[n,o]of Object.entries(t))n.startsWith(me.TEMP_PREFIX)||(e[n]=o);return e}a(FU,"trimTempState");function qw(t={},e={},n={}){let o=ze(n);for(let[r,i]of Object.entries(t))o[me.APP_PREFIX+r]=i;for(let[r,i]of Object.entries(e))o[me.USER_PREFIX+r]=i;return o}a(qw,"mergeStates");function gp(t){return{id:t.id,appName:t.appName,userId:t.userId||"",state:t.state||{},events:t.events||[],lastUpdateTime:t.lastUpdateTime||0}}a(gp,"createSession");var Zw=class Zw extends Du{constructor(){super(...arguments);this.sessions=Object.create(null);this.userState=Object.create(null);this.appState=Object.create(null)}async createSession({appName:n,userId:o,state:r,sessionId:i}){var l;let s=r?FU(r):void 0,u=gp({id:i||fn(),appName:n,userId:o,state:s,events:[],lastUpdateTime:Date.now()});this.sessions[n]||(this.sessions[n]=Object.create(null)),this.sessions[n][o]||(this.sessions[n][o]=Object.create(null)),this.sessions[n][o][u.id]=u;let c=ze(u);return c.state=qw(this.appState[n],(l=this.userState[n])==null?void 0:l[o],c.state),c}async getSession({appName:n,userId:o,sessionId:r,config:i}){var c;if(!this.sessions[n]||!this.sessions[n][o]||!this.sessions[n][o][r])return Promise.resolve(void 0);let s=this.sessions[n][o][r],u=ze(s);if(i&&(i.numRecentEvents&&(u.events=u.events.slice(-i.numRecentEvents)),i.afterTimestamp)){let l=u.events.length-1;for(;l>=0&&!(u.events[l].timestamp<i.afterTimestamp);)l--;l>=0&&(u.events=u.events.slice(l+1))}return u.state=qw(this.appState[n],(c=this.userState[n])==null?void 0:c[o],u.state),u}listSessions({appName:n,userId:o,limit:r,offset:i,page:s,order:u}){let c=this.sessions[n],l=c===void 0?[]:o===void 0?Object.values(c):c[o]?[c[o]]:[];if(l.length===0){if(r!==void 0){let _=s!==void 0?(s-1)*r:i!=null?i:0,x=s!==void 0?s:r===0?1:Math.floor(_/r)+1;return Promise.resolve({sessions:[],page:x,limit:r,totalItems:0,totalPages:0})}return Promise.resolve({sessions:[],page:1,limit:0,totalItems:0,totalPages:0})}let p=l.flatMap(_=>Object.values(_).map(x=>gp({id:x.id,appName:x.appName,userId:x.userId,state:{},events:[],lastUpdateTime:x.lastUpdateTime})));if(u==="asc"?p.sort((_,x)=>_.lastUpdateTime-x.lastUpdateTime||_.id.localeCompare(x.id)):u==="desc"&&p.sort((_,x)=>x.lastUpdateTime-_.lastUpdateTime||_.id.localeCompare(x.id)),r===void 0){let _=p.length,x=i?p.slice(i):p;return Promise.resolve({sessions:x,page:1,limit:_,totalItems:_,totalPages:_===0?0:1})}let d=p.length,g=r===0?0:Math.ceil(d/r),h,v;s!==void 0?(h=(s-1)*r,v=s):(h=i!=null?i:0,v=r===0?1:Math.floor(h/r)+1);let y=p.slice(h,h+r);return Promise.resolve({sessions:y,page:v,limit:r,totalItems:d,totalPages:g})}async deleteSession({appName:n,userId:o,sessionId:r}){await this.getSession({appName:n,userId:o,sessionId:r})&&delete this.sessions[n][o][r]}async appendEvent({session:n,event:o}){await super.appendEvent({session:n,event:o}),n.lastUpdateTime=o.timestamp;let r=n.appName,i=n.userId,s=n.id,u=a(l=>{N.warn(`Failed to append event to session ${s}: ${l}`)},"warning");if(!this.sessions[r])return u(`appName ${r} not in sessions`),o;if(!this.sessions[r][i])return u(`userId ${i} not in sessions[appName]`),o;if(!this.sessions[r][i][s])return u(`sessionId ${s} not in sessions[appName][userId]`),o;if(o.actions&&o.actions.stateDelta)for(let l of Object.keys(o.actions.stateDelta))l.startsWith(me.APP_PREFIX)&&(this.appState[r]=this.appState[r]||Object.create(null),this.appState[r][l.replace(me.APP_PREFIX,"")]=o.actions.stateDelta[l]),l.startsWith(me.USER_PREFIX)&&(this.userState[r]=this.userState[r]||Object.create(null),this.userState[r][i]=this.userState[r][i]||Object.create(null),this.userState[r][i][l.replace(me.USER_PREFIX,"")]=o.actions.stateDelta[l]);let c=this.sessions[r][i][s];return await super.appendEvent({session:c,event:o}),c.lastUpdateTime=o.timestamp,o}};a(Zw,"InMemorySessionService");var To=Zw;var Hw=Symbol.for("google.adk.baseToolset");function Kw(t){return typeof t=="object"&&t!==null&&Hw in t&&t[Hw]===!0}a(Kw,"isBaseToolset");var zU;zU=Hw;var Ww=class Ww{constructor(e,n){this.toolFilter=e;this.prefix=n;this[zU]=!0}isToolSelected(e,n){return!this.toolFilter||Array.isArray(this.toolFilter)&&this.toolFilter.length===0?!0:typeof this.toolFilter=="function"?this.toolFilter(e,n):Array.isArray(this.toolFilter)?this.toolFilter.includes(e.name):!1}async processLlmRequest(e,n){}};a(Ww,"BaseToolset");var Jw=Ww;function GU(t){return JSON.stringify(t,(e,n)=>e==="inlineData"&&typeof n=="object"&&n!==null&&"data"in n&&typeof n.data=="string"?{...n,data:`<redacted ${n.data.length} chars>`}:n)}a(GU,"stringifyWithRedactedInlineData");var jw=class jw{constructor(e,n){this.state=e;this.abortSignal=n}async schedule(e,n,o,r){let i=await this.scheduleRun(e,n,o,r);for(let s of i.interruptIds)e.interruptIds.includes(s)||e.interruptIds.push(s);return i}async scheduleRun(e,n,o,r){var l,p,d;let i=(l=r.nodeName)!=null?l:n.name,s=r.runId,u=e.nodePath?`${e.nodePath}.${i}@${s}`:`${i}@${s}`,c=this.state.runs.get(u);if(c!=null&&c.task)return c.task;if(c!=null&&c.result)return this.handBack(e,c.result,r);if(!this.state.runs.has(u)){let g=rU(Is((d=(p=e.session)==null?void 0:p.events)!=null?d:[],e.invocationId)).get(u);if(g&&ap(g))return this.completeWithoutRunning(e,{nodePath:u,runId:s,options:r},up(e,g));let h=this.resumeHandoff(e,n,g);if(h)return this.completeWithoutRunning(e,{nodePath:u,runId:s,options:r},h)}return this.runFresh(e,n,o,i,s,u,r)}completeWithoutRunning(e,n,o){return this.state.runs.set(n.nodePath,{state:jn({status:3,runId:n.runId,parentRunId:e.runId}),output:o.output,result:o}),this.handBack(e,o,n.options)}handBack(e,n,o){return o.useAsOutput&&(e.output=n.output,e.route=n.route),n}resumeHandoff(e,n,o){var i;if(!o||n.rerunOnResume||o.output!==void 0||o.interruptIds.size===0)return;let r=[...o.interruptIds].map(s=>e.resumeInputs[s]);if(r.every(s=>s!==void 0))return{output:r.length===1?r[0]:r,route:void 0,branch:(i=o.branch)!=null?i:e.branch,interruptIds:[]}}async runFresh(e,n,o,r,i,s,u){let c={state:jn({status:2,input:o,runId:i,parentRunId:e.runId})};this.state.runs.set(s,c),c.task=Nr({parent:e,node:n,input:o,abortSignal:this.abortSignal,options:{nodeName:r,runId:i,overrideNodePath:s,useAsOutput:u.useAsOutput,useSubBranch:u.useSubBranch,overrideBranch:u.overrideBranch,overrideIsolationScope:u.overrideIsolationScope}});let l;try{l=await c.task}catch(p){if(ls(p)||hf(p))throw p;c.state.status=5;let d=p instanceof Error?p:new Error(String(p));throw new lf({message:`Dynamic node ${r} failed: ${d.message}`,error:d,errorNodePath:s})}return this.recordResult(c,l,n),l}recordResult(e,n,o){n.interruptIds.length>0?(e.state.status=4,e.state.interrupts=[...n.interruptIds],n.interruptIds.forEach(r=>this.state.interruptIds.add(r))):o.waitForOutput&&n.output===void 0&&n.route===void 0?e.state.status=4:(e.state.status=3,e.output=n.output)}};a(jw,"DynamicNodeScheduler");var hp=jw;function J5(t){return/^-?\d+$/.test(t)?Number(t):t==="true"||t==="false"?t==="true":t}a(J5,"normalizeRouteKey");function K5(t,e){let n=Object.keys(e);if(n.length===0)throw new Error("Routing map must not be empty. Provide at least one route -> node mapping.");let o=[];for(let r of n){let i=J5(r),s=e[r];if(Array.isArray(s)){for(let u of s)if(!yu(u))throw new Error(`Invalid node in fan-out tuple for route ${String(r)}.`)}else if(!yu(s))throw new Error(`Invalid routing map value for route ${String(r)}.`);o.push([t,s,i])}return o}a(K5,"expandRoutingMap");function W5(t){let e=[];for(let n of Object.values(t))Array.isArray(n)?e.push(...n):e.push(n);return e}a(W5,"nodesFromRoutingMap");function vp(t){return Mf(t)?W5(t):Array.isArray(t)?[...t]:[t]}a(vp,"flattenElement");function ks(t,e){if(t==="START")return Kt("START");if(typeof t=="object"||typeof t=="function"){let n=e.get(t);if(n)return n;let o=Kt(t);return e.set(t,o),o}return Kt(t)}a(ks,"getOrBuildNode");function j5({edge:t,nodeMap:e,out:n}){n.push(new Lr(ks(t.fromNode,e),ks(t.toNode,e),t.route))}a(j5,"processExplicitEdge");function Y5({fromEl:t,toEl:e,nodeMap:n,out:o}){if(Mf(t))throw new Error("Consecutive routing maps are not allowed in a chain. Split them into separate edge items.");for(let[r,i,s]of K5(t,e))for(let u of vp(r))for(let c of vp(i))o.push(new Lr(ks(u,n),ks(c,n),s))}a(Y5,"processRoutingMapEdge");function X5({fromEl:t,toEl:e,nodeMap:n,out:o}){for(let r of vp(t))for(let i of vp(e))o.push(new Lr(ks(r,n),ks(i,n),null))}a(X5,"processUnconditionalEdge");function Q5({chain:t,nodeMap:e,out:n}){for(let o=0;o<t.length-1;o++){let r=t[o],i=t[o+1];Mf(i)?Y5({fromEl:r,toEl:i,nodeMap:e,out:n}):X5({fromEl:r,toEl:i,nodeMap:e,out:n})}}a(Q5,"processChain");function BU(t){let e=new Map,n=[];for(let o of t)if(qU(o))j5({edge:o,nodeMap:e,out:n});else if(Array.isArray(o))Q5({chain:o,nodeMap:e,out:n});else throw new Error(`Invalid edge item type: ${typeof o}`);return n}a(BU,"parseEdgeItems");function eQ(t){var o;let e=new Map;for(let r of t)e.set(r.name,((o=e.get(r.name))!=null?o:0)+1);let n=[...e.entries()].filter(([,r])=>r>1).map(([r])=>r).sort();if(n.length>0)throw new Error(`Graph validation failed. Duplicate node names found: ${JSON.stringify(n)}. Pass the exact same object instance to reuse a node, or give distinct nodes unique names.`);return new Set(e.keys())}a(eQ,"validateDuplicateNodeNames");function tQ(t){if(!t.has(ln.name))throw new Error(`Graph validation failed. START node (name: '${ln.name}') not found in graph nodes.`)}a(tQ,"validateStartNode");function nQ(t){for(let e of t)if(e.fromNode.name===ln.name&&e.route!==null)throw new Error(`Graph validation failed. Edges from START must not have routes (edge to ${e.toNode.name} has route ${String(e.route)}).`)}a(nQ,"validateStartEdges");function rQ(t,e){var u;let n=new Map;for(let c of e)n.set(c,new Set);let o=new Set;for(let c of t)n.get(c.fromNode.name).add(c.toNode.name),o.add(c.toNode.name);let r=new Set,i=[ln.name];for(;i.length>0;){let c=i.pop();if(!r.has(c)){r.add(c);for(let l of(u=n.get(c))!=null?u:[])r.has(l)||i.push(l)}}let s=[...e].filter(c=>!r.has(c)).sort();if(s.length>0)throw new Error(`Graph validation failed. The following nodes are unreachable from START: ${JSON.stringify(s)}`);if(o.has(ln.name))throw new Error("Graph validation failed. START node must not have incoming edges.")}a(rQ,"validateConnectivity");function oQ(t){let e=new Set;for(let n of t){let o=n.route===null||n.route===void 0,r=o?[null]:(Array.isArray(n.route)?n.route:[n.route]).map(String);for(let i of r){let s=JSON.stringify([n.fromNode.name,n.toNode.name,i]);if(e.has(s))throw new Error(`Graph validation failed. Duplicate edge found: from=${n.fromNode.name}, to=${n.toNode.name}${o?"":`, route=${JSON.stringify(i)}`}. ${o?"The same pair is already connected unconditionally":"That route already points at this node"}, so the target would be triggered twice.`);e.add(s)}}}a(oQ,"validateDuplicateEdges");function iQ(t){let e=new Map;for(let n of t){if(Array.isArray(n.route)&&n.route.includes(Ps))throw new Error(`Graph validation failed. DEFAULT_ROUTE cannot be combined with other routes in a list (edge from=${n.fromNode.name}, to=${n.toNode.name}). Use a separate edge for DEFAULT_ROUTE.`);if(n.route===Ps){let o=n.fromNode.name;if(e.has(o))throw new Error(`Graph validation failed. Multiple DEFAULT_ROUTE edges found from node ${o} to ${e.get(o)} and ${n.toNode.name}`);e.set(o,n.toNode.name)}}}a(iQ,"validateDefaultRoutes");function sQ(t,e){let n=new Map;for(let s of e)n.set(s,[]);for(let s of t)s.route===null&&n.get(s.fromNode.name).push(s.toNode.name);let o=new Set,r=new Set,i=a((s,u)=>{var c;o.add(s),u.push(s);for(let l of(c=n.get(s))!=null?c:[]){if(o.has(l)){let p=u.indexOf(l),d=[...u.slice(p),l];throw new Error(`Graph validation failed. Unconditional cycle detected: ${d.join(" -> ")}. An unconditional cycle has no exit and would loop forever; break it with at least one conditional (routed) edge so a node can leave the cycle by not emitting that route. (A routed cycle can still loop if a node keeps emitting the route \u2014 bounding that is the node's responsibility, not this validator's.)`)}r.has(l)||i(l,u)}u.pop(),o.delete(s),r.add(s)},"dfs");for(let s of e)r.has(s)||i(s,[])}a(sQ,"detectUnconditionalCycles");function aQ(t,e){let n=new Set(e.map(o=>o.fromNode.name));return new Set(t.filter(o=>o.name!==ln.name&&!n.has(o.name)).map(o=>o.name))}a(aQ,"computeTerminalNodes");function VU(t,e){let n=eQ(t);return tQ(n),nQ(e),rQ(e,n),oQ(e),iQ(e),sQ(e,n),aQ(t,e)}a(VU,"validateGraph");var Yw=Symbol.for("google.adk.workflow.edge"),Ps="__DEFAULT__",ZU;ZU=Yw;var Xw=class Xw{constructor(e,n,o=null){this.fromNode=e;this.toNode=n;this.route=o;this[ZU]=!0}};a(Xw,"Edge");var Lr=Xw;function qU(t){return typeof t=="object"&&t!==null&&Yw in t&&t[Yw]===!0}a(qU,"isEdge");var Qw=class Qw{constructor(e){this._terminalNodeNames=new Set;this.edges=e;let n=new Set,o=[];for(let r of e)for(let i of[r.fromNode,r.toNode])n.has(i)||(n.add(i),o.push(i));this.nodes=o}get terminalNodeNames(){return this._terminalNodeNames}getNextPendingNodes(e,n){let o=[],r=!1,i,s=[];for(let u of this.edges){if(u.fromNode.name!==e)continue;if(u.route===null||u.route===void 0){o.push(u.toNode.name);continue}if(u.route===Ps){i=u.toNode.name;continue}let c=new Set((Array.isArray(u.route)?u.route:[u.route]).map(String));s.push(...c);let l=!1;Array.isArray(n)?l=n.some(p=>c.has(String(p))):n!=null&&(l=c.has(String(n))),l&&(o.push(u.toNode.name),r=!0)}if(!r&&i&&o.push(i),o.length===0&&s.length>0){let u=n==null?[]:Array.isArray(n)?n:[n],c=s.includes("true")&&u.length>0&&u.every(l=>String(l)==="false");if(u.length>0&&!c){let l=u.map(d=>JSON.stringify(d)).join(", "),p=[...new Set(s)].map(d=>JSON.stringify(d)).join(", ");N.debug(`Node '${e}' emitted route ${l}, which matches no outgoing edge, so this branch stops here. Edges from this node are keyed to: ${p}.`)}}return o}validate(){this._terminalNodeNames=VU(this.nodes,this.edges)}};a(Qw,"Graph");var Ou=Qw;function HU(t){let e=new Ou(BU(t));return e.validate(),e}a(HU,"createGraphFromEdgeItems");var eb=class eb{constructor(){this.runs=new Map;this.interruptIds=new Set}getDynamicTasks(){return[...this.runs.values()].map(e=>e.task).filter(e=>e!==void 0)}};a(eb,"DynamicNodeState");var yp=eb;var tb=Symbol.for("google.adk.workflow.workflow"),rb=class rb{constructor(){this.nodes=new Map;this.nodeOutputs=new Map;this.nodeBranches=new Map;this.triggerBuffer=new Map;this.pending=new Map;this.interruptIds=new Set;this.rehydrated=new Map;this.activated=new Set;this.errorShutDown=!1}};a(rb,"LoopState");var nb=rb,JU,KU,bn=class extends(KU=Fe,JU=tb,KU){constructor(n){var r;super({...n,rerunOnResume:(r=n.rerunOnResume)!=null?r:!0});this[JU]=!0;let o=!!n.edges&&n.edges.length>0;if(o&&n.dynamicEntry)throw new Error(`Workflow "${this.name}": "edges" and "dynamicEntry" are mutually exclusive.`);if(!o&&!n.dynamicEntry)throw new Error(`Workflow "${this.name}" requires either "edges" or "dynamicEntry".`);if(n.maxConcurrency!==void 0&&(!Number.isInteger(n.maxConcurrency)||n.maxConcurrency<1))throw new Error(`Workflow "${this.name}": "maxConcurrency" must be a positive integer (got ${n.maxConcurrency}).`);this.maxConcurrency=n.maxConcurrency,this.dynamicEntry=n.dynamicEntry,n.edges&&n.edges.length>0&&(this.graph=HU(n.edges))}async*runImpl(n,o){let r=new yp,i=uQ(n.invocationContext.abortSignal);n.scheduler=new hp(r,i.controller.signal);let s=Ze.startSpan(`invoke_workflow ${this.name}`);try{await Ue.with($e.setSpan(Ue.active(),s),()=>(mP({workflowName:this.name,nodePath:n.nodePath,sessionId:n.invocationContext.session.id}),this.orchestrate(n,o,r,i.controller)))}finally{i.dispose(),s.end()}}async orchestrate(n,o,r,i){var l,p;let s=Is((p=(l=n.session)==null?void 0:l.events)!=null?p:[],n.invocationId),u=iU(s,n.nodePath||void 0);if(this.applyResumeInputs(n,s),this.dynamicEntry){await this.runDynamicEntry(n,o,r);return}let c=new nb;if(c.rehydrated=u,c.abortSignal=i.signal,this.seedStartTriggers(c,o),await this.runLoop(c,n,i),!c.errorShutDown){this.collectRemainingInterrupts(c);for(let d of r.interruptIds)c.interruptIds.add(d);this.finalize(c,n)}}async runDynamicEntry(n,o,r){let i=await this.dynamicEntry(n,o);if(r.interruptIds.size>0){n.interruptIds=[...r.interruptIds];return}i!==void 0&&(n.output=i)}applyResumeInputs(n,o){for(let[r,i]of SA(o))n.resumeInputs[r]=i}seedStartTriggers(n,o){let r=this.graph.edges.filter(s=>s.fromNode.name==="__START__"),i=r.length>1;for(let s of r)this.pushTrigger(n,s.toNode.name,{input:o,useSubBranch:i})}async runLoop(n,o,r){for(;this.scheduleReadyNodes(n,o),n.pending.size!==0;){let i=await Promise.race(n.pending.values());if(n.pending.delete(i.name),i.error){let s=n.nodes.get(i.name);throw s&&(s.status=5),this.reportNodeError(n,o,i.name,i.error),n.errorShutDown=!0,await this.cleanupPending(n,r),i.error}await this.handleCompletion(n,i.name,i.childCtx)}}reportNodeError(n,o,r,i){var s,u,c;vf(i)||(s=n.abortSignal)!=null&&s.aborted||Of(i,o.invocationId)&&o.emit(Lf({error:i,attemptCount:(c=(u=n.nodes.get(r))==null?void 0:u.attemptCount)!=null?c:1,author:r,invocationId:o.invocationId,nodeInfo:{path:o.nodePath?`${o.nodePath}.${r}`:r},branch:o.branch,isolationScope:o.isolationScope}))}scheduleReadyNodes(n,o){for(let r of[...n.triggerBuffer.keys()]){if(n.pending.has(r))continue;let i=n.nodes.get(r);if(i&&(i.status===2||i.status===4&&i.interrupts.length>0))continue;if(this.atConcurrencyLimit(n))break;let s=this.popTrigger(n,r);s&&(this.prepareNodeStateForStarting(n,r,s),this.startNodeTask(n,o,r,s))}}atConcurrencyLimit(n){return this.maxConcurrency!==void 0&&n.pending.size>=this.maxConcurrency}prepareNodeStateForStarting(n,o,r){var u;let i=n.nodes.get(o),s=jn({runCounter:(u=i==null?void 0:i.runCounter)!=null?u:0});s.input=r.input,s.status=2,n.nodes.set(o,s)}startNodeTask(n,o,r,i){var v,y;let s=this.getStaticNode(r),u=n.nodes.get(r),c=n.activated.has(r);n.activated.add(r);let l=(v=n.rehydrated.get(r))==null?void 0:v.shift();if(l&&ap(l)){n.pending.set(r,Promise.resolve({name:r,childCtx:up(o,l)}));return}if(l&&!s.rerunOnResume&&l.output===void 0&&l.interruptIds.size>0){let _=[...l.interruptIds].map(x=>o.resumeInputs[x]);if(_.every(x=>x!==void 0)){let E={output:_.length===1?_[0]:_,route:void 0,branch:(y=l.branch)!=null?y:o.branch,interruptIds:[]};n.pending.set(r,Promise.resolve({name:r,childCtx:E}));return}}let p=u.runId;p||(u.runCounter+=1,p=String(u.runCounter),u.runId=p);let g=l!==void 0&&l.interruptIds.size>0&&l.input!==void 0?l.input:i.input,h=Nr({parent:o,node:s,input:g,abortSignal:n.abortSignal,nodeState:u,resumeInputs:c?{}:void 0,options:{runId:p,useSubBranch:i.useSubBranch,overrideBranch:i.branch,overrideIsolationScope:i.isolationScope}}).then(_=>({name:r,childCtx:_}),_=>({name:r,error:_}));n.pending.set(r,h)}async handleCompletion(n,o,r){var u;let i=n.nodes.get(o),s=this.getStaticNode(o);if(r.interruptIds.length>0){i.status=4,i.interrupts=[...r.interruptIds],r.interruptIds.forEach(c=>n.interruptIds.add(c));return}if(s.waitForOutput&&r.output===void 0&&r.route===void 0){i.status=4;return}i.status=3,r.output!==void 0&&n.nodeOutputs.set(o,r.output),n.nodeBranches.set(o,(u=r.branch)!=null?u:""),this.bufferDownstreamTriggers(n,o,r.output,r.route,r.branch)}bufferDownstreamTriggers(n,o,r,i,s){let u=this.graph.getNextPendingNodes(o,i!=null?i:null),c=u.length>1;for(let l of u)if(this.getStaticNode(l).requiresAllPredecessors){let d=new Set(this.graph.edges.filter(h=>h.toNode.name===l).map(h=>h.fromNode.name));if([...d].every(h=>{var v;return((v=n.nodes.get(h))==null?void 0:v.status)===3})){let h={};for(let _ of d)h[_]=n.nodeOutputs.get(_);let v=[...d].map(_=>{var x;return(x=n.nodeBranches.get(_))!=null?x:""}),y=$f(v);this.pushTrigger(n,l,{input:h,useSubBranch:!1,branch:y||void 0})}}else this.pushTrigger(n,l,{input:r,useSubBranch:c,branch:s})}collectRemainingInterrupts(n){for(let o of n.nodes.values())o.status===4&&o.interrupts.length>0&&o.interrupts.forEach(r=>n.interruptIds.add(r))}finalize(n,o){if(n.interruptIds.size>0){o.interruptIds=[...n.interruptIds];return}let r=[...this.graph.terminalNodeNames].filter(i=>n.nodeOutputs.has(i)).map(i=>n.nodeOutputs.get(i));if(r.length===1)o.output=r[0];else if(r.length>1)throw new Error(`Workflow ${this.name}: multiple terminal nodes produced output (${r.length}). A workflow must have at most one terminal output.`)}pushTrigger(n,o,r){let i=n.triggerBuffer.get(o);i?i.push(r):n.triggerBuffer.set(o,[r])}popTrigger(n,o){let r=n.triggerBuffer.get(o);if(!r||r.length===0)return;let i=r.shift();return r.length===0&&n.triggerBuffer.delete(o),i}getStaticNode(n){let o=this.graph.nodes.find(r=>r.name===n);if(!o)throw new Error(`Node ${n} not found in graph.`);return o}async cleanupPending(n,o){o.abort();let r=[...n.pending.values()];n.pending.clear(),await Promise.allSettled(r)}};a(bn,"Workflow"),bn=Re([tt],bn);function _p(t){return typeof t=="object"&&t!==null&&tb in t&&t[tb]===!0}a(_p,"isWorkflow");function uQ(t){let e=new AbortController;if(!t)return{controller:e,dispose:a(()=>{},"dispose")};if(t.aborted)return e.abort(),{controller:e,dispose:a(()=>{},"dispose")};let n=a(()=>e.abort(),"onParentAbort");return t.addEventListener("abort",n,{once:!0}),{controller:e,dispose:a(()=>t.removeEventListener("abort",n),"dispose")}}a(uQ,"createWorkflowAbort");async function*ob(t,e,n={}){var g;let o=(g=n.author)!=null?g:t.name,r=new cn,i=new Cn({invocationContext:e,channel:r,nodePath:"",runId:o,resumeInputs:lQ(e)}),s=cQ(e.userContent),u=!1,c=(async()=>{try{u=(await i.runNode(t,s,{useAsOutput:!0})).interruptIds.length>0,r.close()}catch(h){r.fail(h)}})(),l,p=!1;try{for await(let h of r)h.output!==void 0&&(l=h.output,p=!0),yield h;await c}finally{r.close(),await c}let d=p&&Object.is(l,i.output);!u&&i.output!==void 0&&!d&&(yield J({author:o,invocationId:e.invocationId,branch:e.branch,content:gu(i.output),output:i.output}))}a(ob,"runNodeAsInvocation");function lQ(t){var u,c,l,p;let e=(c=(u=t.userContent)==null?void 0:u.parts)!=null?c:[];if(!(e.length>0&&e.every(d=>typeof d.text=="string")))return{};let o=e.map(d=>d.text).join(""),r=new Set,i=Is((p=(l=t.session)==null?void 0:l.events)!=null?p:[],t.invocationId);for(let d of nU(i).values())for(let g of d.interruptIds)d.resolvedResponses.has(g)||r.add(g);if(r.size!==1)return{};let[s]=r;return{[s]:o}}a(lQ,"resumeInputsFromPlainText");function cQ(t){var o;if(!t)return;let n=((o=t.parts)!=null?o:[]).filter(r=>typeof r.text=="string");return n.length>0?n.map(r=>r.text).join(""):t}a(cQ,"extractNodeInput");function ib(t){return Wn(t)||_p(t)}a(ib,"isRunnableRoot");function Ns(t){var o,r;if(ib(t))return t;let e=t;if(!yu(e)||e==="START"){let i=e==="START"?"the 'START' sentinel":(r=(o=e==null?void 0:e.constructor)==null?void 0:o.name)!=null?r:typeof e;throw new TypeError(`Cannot use ${i} as a root: expected a BaseAgent, a Workflow, or a node-like value (a node, a tool, or a function).`)}let n=Kt(e);return new bn({name:n.name,description:n.description,edges:[["START",n]]})}a(Ns,"asRunnableRoot");var sb=Symbol.for("google.adk.runner");function dQ(t){return typeof t=="object"&&t!==null&&sb in t&&t[sb]===!0}a(dQ,"isRunner");var jU;jU=sb;var ub=class ub{constructor(e){this[jU]=!0;var s,u,c,l,p,d,g,h,v;let n=(u=(s=e.app)==null?void 0:s.name)!=null?u:e.appName,o=(l=(c=e.app)==null?void 0:c.rootAgent)!=null?l:e.agent;if(!o)throw new Error("agent must be provided in runner constructor (or via app.rootAgent)");this.appName=n,this.agent=Ns(o);let r=(d=(p=e.app)==null?void 0:p.plugins)!=null?d:[],i=(g=e.plugins)!=null?g:[];this.pluginManager=new $u([...r,...i]),this.artifactService=e.artifactService,this.sessionService=e.sessionService,this.memoryService=e.memoryService,this.credentialService=e.credentialService,this.resumabilityConfig=(v=(h=e.app)==null?void 0:h.resumabilityConfig)!=null?v:e.resumabilityConfig}async*runEphemeral(e){let o=(await this.sessionService.createSession({appName:this.appName,userId:e.userId})).id;try{yield*this.runAsync({userId:e.userId,sessionId:o,newMessage:e.newMessage,stateDelta:e.stateDelta,runConfig:e.runConfig,customMetadata:e.customMetadata})}finally{await this.sessionService.deleteSession({appName:this.appName,userId:e.userId,sessionId:o})}}async*runAsync(e){let{userId:n,sessionId:o,stateDelta:r}=e,i=bA(e.runConfig),s=e.newMessage;s&&!s.role&&(s.role="user"),mQ(s);let u=Ze.startSpan("invocation"),c=$e.setSpan(Ue.active(),u);try{yield*ur(c,this,async function*(){var g,h,v,y,_,x,E,T,S,I,w;let l=await this.sessionService.getSession({appName:this.appName,userId:n,sessionId:o});if((g=e.abortSignal)!=null&&g.aborted)return;if(!l)throw this.appName?new Error(`Session not found: ${o} (appName=${this.appName}, userId=${n})`):new Error("Session lookup failed: appName must be provided in runner constructor (or via app.name)");if(i.supportCfc&&te(this.agent)){let b=this.agent.canonicalModel.model;if(!Qn(b))throw new Error(`CFC is not supported for model: ${b} in agent: ${this.agent.name}`);Iu(this.agent.codeExecutor)||(this.agent.codeExecutor=new Cu)}let p=new Jt({artifactService:this.artifactService?fp(this.artifactService)?this.artifactService:new Rs(this.artifactService,this.appName,n,o):void 0,sessionService:this.sessionService,memoryService:this.memoryService,credentialService:this.credentialService,invocationId:bC(),agent:Wn(this.agent)?this.agent:void 0,session:l,userContent:s,runConfig:i,a2aMetadata:i.a2aMetadata,pluginManager:this.pluginManager,abortSignal:e.abortSignal}),d=await this.pluginManager.runOnUserMessageCallback({userMessage:s,invocationContext:p});if(!((h=e.abortSignal)!=null&&h.aborted)){if(d&&(s=d),s){if(!((v=s.parts)!=null&&v.length))throw new Error("No parts in the newMessage.");if(i.saveInputBlobsAsArtifacts&&(s=await this.saveArtifacts(p.artifactService,p.invocationId,s),(y=e.abortSignal)!=null&&y.aborted)||(await this.sessionService.appendEvent({session:l,event:J({invocationId:p.invocationId,author:"user",actions:r?Ft({stateDelta:r}):void 0,content:s,customMetadata:e.customMetadata})}),(_=e.abortSignal)!=null&&_.aborted))return}if(Wn(this.agent)&&(p.agent=this.determineAgentForResumption(l,this.agent)),s){let b=await this.pluginManager.runBeforeRunCallback({invocationContext:p});if((x=e.abortSignal)!=null&&x.aborted)return;if(b){let B=J({invocationId:p.invocationId,author:"model",content:b});if(await this.sessionService.appendEvent({session:l,event:B}),(E=e.abortSignal)!=null&&E.aborted)return;yield B}else{for await(let B of this.runRoot(p)){if((T=e.abortSignal)!=null&&T.aborted)return;let k=await this.pluginManager.runOnEventCallback({invocationContext:p,event:B}),V=k?{...k,id:B.id,invocationId:B.invocationId,timestamp:B.timestamp,author:k.author||B.author,branch:(S=k.branch)!=null?S:B.branch}:B;if(B.partial||await this.sessionService.appendEvent({session:l,event:V}),(I=e.abortSignal)!=null&&I.aborted)return;yield V}if(await this.pluginManager.runAfterRunCallback({invocationContext:p}),(w=e.abortSignal)!=null&&w.aborted)return}}}})}finally{u.end();let l=Wn(this.agent)?pQ(this.agent):[];await Promise.allSettled(l.map(p=>p.close()))}}async*runRoot(e){if(Wn(this.agent)){yield*We(e).runAsync(e);return}yield*ob(this.agent,e)}async saveArtifacts(e,n,o){var s;if(!e||!((s=o.parts)!=null&&s.length))return o;let r=[],i=!1;for(let u=0;u<o.parts.length;u++){let c=o.parts[u];if(!c.inlineData){r.push(c);continue}try{let l=c.inlineData,p=l.displayName||`artifact_${n}_${u}`,d=await e.saveArtifact({filename:p,artifact:c});r.push(oi(`[Uploaded Artifact: "${p}"]`));try{let g=await e.getArtifactVersion({filename:p,version:d});g!=null&&g.canonicalUri&&/^(gs|https?):/i.test(g.canonicalUri)&&r.push({fileData:{fileUri:g.canonicalUri,mimeType:g.mimeType||l.mimeType||"",displayName:p}})}catch(g){N.warn(`Failed to resolve artifact version for ${p}:`,g)}i=!0,N.info(`Successfully saved artifact: ${p}`)}catch(l){N.error(`Failed to save artifact for part ${u}:`,l),r.push(c)}}return i?{...o,parts:r}:o}determineAgentForResumption(e,n){return YU(e,n,this.resumabilityConfig)}isRoutableLlmAgent(e){return ab(e)}async*runLive(e){var s,u,c,l;if(!e.liveRequestQueue)throw new Error("liveRequestQueue is required for runLive.");if(!Wn(this.agent))throw new Error("runLive is only supported for agents.");let n=this.agent,o=bA(e.runConfig);(s=o.responseModalities)!=null&&s.length||(o.responseModalities=[Br.AUDIO]),(u=n.subAgents)!=null&&u.length&&(o.responseModalities.includes(Br.AUDIO)&&((c=o.outputAudioTranscription)!=null||(o.outputAudioTranscription={})),(l=o.inputAudioTranscription)!=null||(o.inputAudioTranscription={}));let r=Ze.startSpan("invocation"),i=$e.setSpan(Ue.active(),r);try{yield*ur(i,this,async function*(){var h,v,y,_;let p=await this.sessionService.getOrCreateSession({appName:this.appName,userId:e.userId,sessionId:e.sessionId});if((h=e.abortSignal)!=null&&h.aborted)return;let d=new Jt({artifactService:this.artifactService?fp(this.artifactService)?this.artifactService:new Rs(this.artifactService,this.appName,e.userId,e.sessionId):void 0,sessionService:this.sessionService,memoryService:this.memoryService,credentialService:this.credentialService,invocationId:bC(),agent:n,session:p,runConfig:o,a2aMetadata:o.a2aMetadata,pluginManager:this.pluginManager,liveRequestQueue:e.liveRequestQueue,abortSignal:e.abortSignal,liveSessionResumptionHandle:e.liveSessionResumptionHandle});d.agent=this.determineAgentForResumption(p,n);let g=await this.pluginManager.runBeforeRunCallback({invocationContext:d});if(!((v=e.abortSignal)!=null&&v.aborted)){if(g){let x=J({invocationId:d.invocationId,author:"model",content:g});await this.sessionService.appendEvent({session:p,event:x}),yield x;return}for await(let x of We(d).runLive(d)){if((y=e.abortSignal)!=null&&y.aborted)return;let E=await this.pluginManager.runOnEventCallback({invocationContext:d,event:x});if((_=e.abortSignal)!=null&&_.aborted)return;let T=E!=null?E:x;!T.partial&&!fQ(T)&&await this.sessionService.appendEvent({session:p,event:T}),yield T}await this.pluginManager.runAfterRunCallback({invocationContext:d})}})}finally{r.end()}}};a(ub,"Runner");var Co=ub;function fQ(t){var n;let e=(n=t.content)==null?void 0:n.parts;return e!=null&&e.length?e.some(o=>{var i,s;let r=(s=(i=o.inlineData)==null?void 0:i.mimeType)==null?void 0:s.toLowerCase();return r!==void 0&&(r.startsWith("audio/")||r.startsWith("video/")||r.startsWith("image/"))}):!1}a(fQ,"isLiveModelMediaEventWithInlineData");function YU(t,e,n){let o=XU(t.events),r=!!(n!=null&&n.isResumable);if(o&&o.author&&r){let i=AL(t.events);if(i)throw new Error(`Function responses in the last event resolve to function calls from more than one agent (at least "${i[0]}" and "${i[1]}"); cannot determine a single agent to resume.`);let s=e.findAgent(o.author);if(s)return s;WU(o)||N.warn(`Function response from an unknown agent: ${o.author}, event id: ${o.id}`)}for(let i=t.events.length-1;i>=0;i--){N.debug("event:",GU(t.events[i]));let s=t.events[i];if(s.author==="user"||!s.author)continue;if(s.author===e.name)return e;let u=e.findSubAgent(s.author);if(!u){WU(s)||N.warn(`Event from an unknown agent: ${s.author}, event id: ${s.id}`);continue}if(ab(u))return u}return e}a(YU,"determineAgentForResumption");function WU(t){var e;return!!((e=t.nodeInfo)!=null&&e.path)}a(WU,"isWorkflowNodeEvent");function ab(t){let e=t;for(;e;){if(!te(e)||e.disallowTransferToParent)return!1;e=e.parentAgent}return!0}a(ab,"isRoutableLlmAgent");function XU(t){var e;return(e=LC(t))!=null?e:null}a(XU,"findEventByLastFunctionResponseId");function pQ(t){let e=[],n=new Set;function o(r){if(!n.has(r)){if(n.add(r),te(r))for(let i of r.tools)Kw(i)&&e.push(i);for(let i of r.subAgents)o(i)}}return a(o,"traverse"),o(t),e}a(pQ,"getAllToolsets");function mQ(t){let e=NC(t);if(e)throw new Error(`A client message may not contain a '${e}' function call: it is raised by the framework, and can only be answered with a function response.`)}a(mQ,"rejectReservedFunctionCalls");var cb=class cb extends Co{constructor(e){var u;let{agent:n,appName:o="InMemoryRunner",plugins:r=[],app:i,resumabilityConfig:s}=e;super({app:i,appName:o,agent:n,plugins:r,artifactService:new Pu,sessionService:new To,memoryService:new _o,resumabilityConfig:(u=i==null?void 0:i.resumabilityConfig)!=null?u:s})}};a(cb,"InMemoryRunner");var lb=cb;var gQ=Symbol.for("google.adk.sessionArtifactService"),QU;QU=gQ;var db=class db{constructor(e){this.toolContext=e;this[QU]=!0}async saveArtifact(e){return this.toolContext.saveArtifact(e.filename,e.artifact)}async loadArtifact(e){return this.toolContext.loadArtifact(e.filename,e.version)}async listArtifactKeys(){return this.toolContext.listArtifacts()}getArtifactService(){let e=this.toolContext.invocationContext.artifactService;if(!e)throw new Error("Artifact service is not initialized.");return e}async deleteArtifact(e){return this.getArtifactService().deleteArtifact(e)}async listVersions(e){return this.getArtifactService().listVersions(e)}async listArtifactVersions(e){return this.getArtifactService().listArtifactVersions(e)}async getArtifactVersion(e){return this.getArtifactService().getArtifactVersion(e)}};a(db,"ForwardingArtifactService");var Lu=db;var fb=Symbol.for("google.adk.agentTool");function hQ(t){return typeof t=="object"&&t!==null&&fb in t&&t[fb]===!0}a(hQ,"isAgentTool");var eF,tF,mb=class mb extends(tF=se,eF=fb,tF){constructor(n){super({name:n.agent.name,description:n.agent.description||""});this[eF]=!0;this.agent=n.agent,this.skipSummarization=n.skipSummarization||!1}_getDeclaration(){let n;if(te(this.agent)&&this.agent.inputSchema?n={name:this.name,description:this.description,parameters:this.agent.inputSchema}:n={name:this.name,description:this.description,parameters:{type:j.OBJECT,properties:{request:{type:j.STRING}},required:["request"]}},this.apiVariant!=="GEMINI_API"){let o=te(this.agent)&&this.agent.outputSchema;n.response=o?{type:j.OBJECT}:{type:j.STRING}}return n}async runAsync({args:n,toolContext:o}){var d,g,h,v,y,_;let i={role:"user",parts:[{text:te(this.agent)&&this.agent.inputSchema?JSON.stringify(n):n.request}]},s=new Co({appName:this.agent.name,agent:this.agent,artifactService:new Lu(o),sessionService:(d=o.invocationContext.sessionService)!=null?d:new To,memoryService:(g=o.invocationContext.memoryService)!=null?g:new _o,credentialService:o.invocationContext.credentialService}),u=await s.sessionService.getOrCreateSession({appName:this.agent.name,userId:o.invocationContext.userId,sessionId:o.invocationContext.session.id,state:o.state.toRecord()});if((h=o.abortSignal)!=null&&h.aborted)return"";let c;for await(let x of s.runAsync({userId:u.userId,sessionId:u.id,newMessage:i,abortSignal:o.abortSignal})){if((v=o.abortSignal)!=null&&v.aborted)return;if(x.actions.stateDelta){let E=Object.fromEntries(Object.entries(x.actions.stateDelta).filter(([T])=>!T.startsWith(me.TEMP_PREFIX)));Object.keys(E).length>0&&o.state.update(E)}c=x}if(!((_=(y=c==null?void 0:c.content)==null?void 0:y.parts)!=null&&_.length))return"";let l=te(this.agent)&&this.agent.outputSchema,p=c.content.parts.filter(x=>!x.thought).map(x=>x.text).filter(x=>x).join(`
223
+ `);return l?JSON.parse(p):p}};a(mb,"AgentTool");var pb=mb;var nF,rF,gb=class gb extends(rF=se,nF=gC,rF){constructor(){super(...arguments);this[nF]=!0}async processLlmRequest(n){if(this._getDeclaration())throw new Error(`${this.name} extends BuiltInTool but returns a function declaration. A tool the model runs itself cannot declare a callable function; extend BaseTool instead.`);await this.applyBuiltInConfig(n),Object.hasOwn(n.llmRequest.toolsDict,this.name)||(n.llmRequest.toolsDict[this.name]=this)}async runAsync(){return N.warn(`${this.name} runs inside the model but was called as a function; answering with guidance instead of executing anything.`),{error:`${this.name} runs inside the model and cannot be called as a function. It is already enabled on this request and its results arrive as grounding metadata; answer from those instead of calling it.`}}};a(gb,"BuiltInTool");var gt=gb;var vb=class vb extends se{constructor(){super({name:"consolidate_context",description:"Requests context consolidation (compaction) to manage history size. Use this when a subtask is complete and you want to summarize progress and clear detailed history."})}_getDeclaration(){return{name:this.name,description:this.description,parameters:{type:j.OBJECT,properties:{detail:{type:j.STRING,description:"Optional description of what has been accomplished so far. This detail will be used to guide the summarization of the history."}}}}}async runAsync({args:e,toolContext:n}){return n.state.set("temp:consolidate_context",!0),e.detail!==void 0&&n.state.set("temp:consolidate_context_detail",e.detail),{status:"success",message:"Context consolidation requested."}}};a(vb,"ConsolidateContextTool");var hb=vb;function vQ(t){if(!t.model)return;let e=ys();if(t.config=t.config||{},t.config.tools=t.config.tools||[],An(t.model)||e){if(Dr(t.model)&&t.config.tools.length>0)throw new Error("Enterprise Web Search tool cannot be used with other tools in Gemini 1.x.");t.config.tools.push({enterpriseWebSearch:{}});return}throw new Error(`Enterprise Web Search tool is not supported for model ${t.model}`)}a(vQ,"applyEnterpriseWebSearch");var yb=class yb extends gt{constructor(){super({name:"enterprise_web_search",description:"Enterprise Web Search Tool"})}async applyBuiltInConfig({llmRequest:e}){vQ(e)}};a(yb,"EnterpriseWebSearchTool");var xp=yb,yQ=new xp;var _Q=`<EXAMPLES>
224
+ Begin few-shot
225
+ The following are examples of user queries and model responses using the available tools.
226
+
227
+ `,xQ=`End few-shot
228
+ <EXAMPLES>`,EQ=`EXAMPLE {}:
229
+ Begin example
230
+ `,SQ=`End example
231
+
232
+ `,oF=`[user]
233
+ `,TQ=`[model]
234
+ `,iF="```\n",CQ="```tool_code\n",IQ="\n```\n",AQ="```tool_outputs\n",wQ="\n```\n";function sF(t,e){var o;let n="";for(let[r,i]of t.entries()){let s=`${EQ.replace("{}",String(r+1))}${oF}`;(o=i.input)!=null&&o.parts&&(s+=i.input.parts.filter(l=>l.text).map(l=>l.text).join(`
235
+ `)+`
236
+ `);let u=!e||e.includes("gemini-2"),c;for(let l of i.output){let p=l.role==="model"?TQ:oF;p!==c&&(s+=p),c=p;for(let d of l.parts||[])if(d.functionCall){let g=u?iF:CQ,h=d.functionCall,v=[];if(h.args)for(let[_,x]of Object.entries(h.args))typeof x=="string"?v.push(`${_}='${x}'`):v.push(`${_}=${x}`);let y=`${h.name}(${v.join(", ")})`;s+=`${g}${y}${IQ}`}else d.functionResponse?s+=`${u?iF:AQ}${JSON.stringify(d.functionResponse)}${wQ}`:d.text&&(s+=`${d.text}
237
+ `)}s+=SQ,n+=s}return`${_Q}${n}${xQ}`}a(sF,"convertExamplesToText");function aF(t,e,n){if(Array.isArray(t))return sF(t,n);if(_w(t))return sF(t.getExamples(e),n);throw new Error("Invalid example configuration")}a(aF,"buildExampleSi");var xb=class xb extends se{constructor(n){super({name:"example_tool",description:"example tool"});this.examples=n}async runAsync(n){throw new Error("ExampleTool should not be called by model")}async processLlmRequest({toolContext:n,llmRequest:o}){var i,s;let r=(i=n.userContent)==null?void 0:i.parts;!r||!((s=r[0])!=null&&s.text)||Ve(o,[aF(this.examples,r[0].text,o.model)])}};a(xb,"ExampleTool");var _b=xb;var Eb=class Eb extends se{constructor(){super({name:"exit_loop",description:`Exits the loop.
238
+
239
+ Call this function only when you are instructed to do so.`})}_getDeclaration(){return{name:this.name,description:this.description}}async runAsync({toolContext:e}){return e.actions.escalate=!0,e.actions.skipSummarization=!0,""}};a(Eb,"ExitLoopTool");var Ep=Eb,bQ=new Ep;var uF=`
240
+
241
+ NOTE: This is a long-running operation. Do not call this tool again if it has already returned some intermediate or pending status.`,Sb=class Sb extends Dt{constructor(e){super({...e,isLongRunning:!0})}_getDeclaration(){let e=super._getDeclaration();return e.description?e.description+=uF:e.description=uF.trimStart(),e}};a(Sb,"LongRunningFunctionTool");var Io=Sb;var RQ=new Io({name:"get_user_choice",description:"Presents a list of options to the user and awaits their selection.",parameters:pe.object({options:pe.array(pe.string()).describe("List of options to present to the user.")}),execute:a(async(t,e)=>(e&&(e.actions.skipSummarization=!0),null),"execute")});function kQ(t){if(!t.model)return;let e=ys();if(t.config=t.config||{},t.config.tools=t.config.tools||[],Dr(t.model))throw new Error("Google Maps grounding tool cannot be used with Gemini 1.x models.");if(An(t.model)||e){t.config.tools.push({googleMaps:{}});return}throw new Error(`Google maps tool is not supported for model ${t.model}`)}a(kQ,"applyGoogleMapsGrounding");var Tb=class Tb extends gt{constructor(){super({name:"google_maps",description:"Google Maps Grounding Tool"})}async applyBuiltInConfig({llmRequest:e}){kQ(e)}};a(Tb,"GoogleMapsGroundingTool");var Sp=Tb,PQ=new Sp;var Cb=class Cb extends gt{constructor(){super({name:"google_search",description:"Google Search Tool"})}async applyBuiltInConfig({llmRequest:e}){if(e.model){if(e.config=e.config||{},e.config.tools=e.config.tools||[],Dr(e.model)){if(e.config.tools.length>0)throw new Error("Google search tool can not be used with other tools in Gemini 1.x.");e.config.tools.push({googleSearchRetrieval:{}});return}if(An(e.model)){e.config.tools.push({googleSearch:{}});return}throw new Error(`Google search tool is not supported for model ${e.model}`)}}};a(Cb,"GoogleSearchTool");var Tp=Cb,NQ=new Tp;var $Q=["image/","audio/","video/"],DQ=new Set(["application/pdf"]),OQ=new Set(["application/csv","application/json","application/xml"]);function lF(t){if(t)return t.split(";")[0].trim()}a(lF,"normalizeMimeType");function LQ(t){let e=lF(t);return e?$Q.some(n=>e.startsWith(n))||DQ.has(e):!1}a(LQ,"isInlineMimeTypeSupported");function MQ(t,e){let n=t.inlineData;if(!n||LQ(n.mimeType))return t;let o=lF(n.mimeType)||"application/octet-stream",r=n.data;if(!r)return{text:`[Artifact: ${e}, type: ${o}. No inline data was provided.]`};let i=o.startsWith("text/")||OQ.has(o),s=Buffer.from(r,"base64");if(i)try{return{text:s.toString("utf8")}}catch(c){}let u=s.length/1024;return{text:`[Binary artifact: ${e}, type: ${o}, size: ${u.toFixed(1)} KB. Content cannot be displayed inline.]`}}a(MQ,"asSafePartForLlm");var Ib=class Ib extends se{constructor(){super({name:"load_artifacts",description:`Loads artifacts into the session for this request.
242
+
243
+ NOTE: Call when you need access to artifacts (for example, uploads saved by the web UI).`})}_getDeclaration(){return{name:this.name,description:this.description,parameters:{type:j.OBJECT,properties:{artifact_names:{type:j.ARRAY,items:{type:j.STRING},description:"The names of the artifacts to load."}}}}}async runAsync({args:e}){return{artifact_names:e.artifact_names||[],status:"artifact contents temporarily inserted and removed. to access these artifacts, call load_artifacts tool again."}}async processLlmRequest(e){await super.processLlmRequest(e),await this.appendArtifactsToLlmRequest(e.toolContext,e.llmRequest)}async appendArtifactsToLlmRequest(e,n){var u,c;if(!e.invocationContext.artifactService)return;let o=await e.listArtifacts();if(!o||o.length===0)return;Ve(n,[`You have a list of artifacts:
244
+ ${JSON.stringify(o)}
245
+
246
+ When the user asks questions about any of the artifacts, you should call the
247
+ \`load_artifacts\` function to load the artifact. Always call load_artifacts
248
+ before answering questions related to the artifacts, regardless of whether the
249
+ artifacts have been loaded before. Do not depend on prior answers about the
250
+ artifacts.`]);let r=n.contents;if(!r||r.length===0)return;let i=0;for(let l=r.length-1;l>=0;l--){let p=r[l],d=(u=p.parts)==null?void 0:u.some(h=>h.functionResponse!==void 0),g=(c=p.parts)==null?void 0:c.some(h=>h.functionCall!==void 0);if(p.role==="model"&&!g||p.role==="user"&&!d){i=l;break}}let s=[];for(let l=i;l<r.length;l++){let p=r[l];if(p.role==="user"&&p.parts)for(let d of p.parts){let g=d.functionResponse;if(g&&g.name===this.name){let v=(g.response||{}).artifact_names||[];for(let y of v)y&&!s.includes(y)&&s.push(y)}}}for(let l of s){let p=await e.loadArtifact(l);if(!p&&!l.startsWith("user:")){let g=`user:${l}`;p=await e.loadArtifact(g)}if(!p){N.warn(`Artifact "${l}" not found, skipping`);continue}let d=MQ(p,l);n.contents.push({role:"user",parts:[{text:`Artifact ${l} is:`},d]})}}};a(Ib,"LoadArtifactsTool");var Cp=Ib,UQ=new Cp;var Ab=class Ab extends se{constructor(){super({name:"load_memory",description:`Loads the memory for the current user.
251
+
252
+ NOTE: Currently this tool only uses text part from the memory.`})}_getDeclaration(){return{name:this.name,description:this.description,parameters:{type:j.OBJECT,properties:{query:{type:j.STRING,description:"The query to load the memory for."}},required:["query"]}}}async runAsync({args:e,toolContext:n}){try{let o=e.query;if(!n.invocationContext.memoryService)throw new Error("Memory service is not initialized.");return{memories:(await n.searchMemory(o)).memories.map(i=>{var s,u;return{content:(u=(s=i.content.parts)==null?void 0:s.map(c=>{var l;return(l=c.text)!=null?l:""}).join(" "))!=null?u:"",author:i.author,timestamp:i.timestamp}})}}catch(o){throw console.error("ERROR in LoadMemoryTool runAsync:",o),o}}async processLlmRequest(e){await super.processLlmRequest(e),e.toolContext.invocationContext.memoryService&&Ve(e.llmRequest,[`You have memory. You can use it to answer questions. If any questions need
253
+ you to look up the memory, you should call load_memory function with a query.`])}};a(Ab,"LoadMemoryTool");var Ip=Ab,FQ=new Ip;var wb=class wb extends se{constructor(){super({name:"preload_memory",description:"preload_memory"})}async runAsync({args:e,toolContext:n}){throw new Error("PreloadMemoryTool should not be called by model")}async processLlmRequest(e){var c,l,p;await super.processLlmRequest(e);let n=e.toolContext.userContent;if(!n||!n.parts||!((c=n.parts[0])!=null&&c.text))return;let o=n.parts[0].text,r;try{if(!e.toolContext.invocationContext.memoryService)return;r=await e.toolContext.searchMemory(o)}catch(d){N.warn(`Failed to preload memory for query: ${o}`);return}if(!r.memories||r.memories.length===0)return;let i=[];for(let d of r.memories){let g=d.timestamp?`Time: ${d.timestamp}`:"";g&&i.push(g);let h=(p=(l=d.content.parts)==null?void 0:l.map(v=>{var y;return(y=v.text)!=null?y:""}).join(" "))!=null?p:"";h&&i.push(d.author?`${d.author}: ${h}`:h)}if(i.length===0)return;let u=`The following content is from your previous conversations with the user.
254
+ They may be useful for answering the user's current query.
255
+ <PAST_CONVERSATIONS>
256
+ ${i.join(`
257
+ `)}
258
+ </PAST_CONVERSATIONS>
259
+ `;Ve(e.llmRequest,[u])}};a(wb,"PreloadMemoryTool");var Ap=wb,zQ=new Ap;var GQ=new Io({name:Me,description:"Presents a custom message to the user and awaits unstructured or structured input.",parameters:pe.object({message:pe.string().describe("The prompt for the user."),response_schema:pe.record(pe.string(),pe.unknown()).optional().describe("Expected schema of the response.")}),execute:a(async(t,e)=>(e&&(e.actions.skipSummarization=!0),null),"execute")});var bb=class bb extends se{_getDeclaration(){return{name:this.name,description:this.description,parameters:{type:j.OBJECT,properties:{query:{type:j.STRING,description:"The query to retrieve."}}}}}};a(bb,"BaseRetrievalTool");var Mu=bb;var kb=class kb extends Mu{constructor(e){super({name:e.name,description:e.description}),this.retriever=e.retriever}async runAsync({args:e}){var r;let o=(await this.retriever.retrieve(String((r=e.query)!=null?r:"")))[0];if(!o)throw new Error(`${this.name} retrieved no results for the query.`);return o.node.text}};a(kb,"LlamaIndexRetrieval");var Rb=kb;var Pb=class Pb extends gt{constructor(){super({name:"url_context",description:"URL Context Tool"})}async applyBuiltInConfig({llmRequest:e}){if(e.model){if(!An(e.model))throw new Error(`URL context tool is not supported for model ${e.model}`);if(!Qn(e.model))throw new Error(`URL context tool requires Gemini 2 or above, but got ${e.model}`);e.config=e.config||{},e.config.tools=e.config.tools||[],e.config.tools.push({urlContext:{}})}}};a(Pb,"UrlContextTool");var wp=Pb,BQ=new wp;var $b=class $b extends gt{constructor(e){super({name:"vertex_ai_search",description:"vertex_ai_search"});let{dataStoreId:n,dataStoreSpecs:o,searchEngineId:r,filter:i,maxResults:s,bypassMultiToolsLimit:u=!1}=e;if(n===void 0&&r===void 0||n!==void 0&&r!==void 0)throw new Error("Either dataStoreId or searchEngineId must be specified.");if(o!==void 0&&r===void 0)throw new Error("searchEngineId must be specified if dataStoreSpecs is specified.");this.dataStoreId=n,this.dataStoreSpecs=o,this.searchEngineId=r,this.filter=i,this.maxResults=s,this.bypassMultiToolsLimit=u}buildVertexAiSearchConfig(e){return{datastore:this.dataStoreId,dataStoreSpecs:this.dataStoreSpecs,engine:this.searchEngineId,filter:this.filter,maxResults:this.maxResults}}async applyBuiltInConfig({toolContext:e,llmRequest:n}){if(!n.model)return;let o=ys();if(n.config=n.config||{},n.config.tools=n.config.tools||[],!An(n.model)&&!o)throw new Error(`Vertex AI search tool is not supported for model ${n.model}`);if(Dr(n.model)&&n.config.tools.length>0&&!this.bypassMultiToolsLimit)throw new Error("Vertex AI search tool cannot be used with other tools in Gemini 1.x.");let r=this.buildVertexAiSearchConfig(e),i;if(r.dataStoreSpecs){let s=r.dataStoreSpecs.map(u=>u.dataStore?u.dataStore.split("/").pop():"unnamed");i=`${r.dataStoreSpecs.length} spec(s): [${s.join(", ")}]`}N.debug(`Adding Vertex AI Search tool config to LLM request: datastore=${r.datastore}, engine=${r.engine}, filter=${r.filter}, maxResults=${r.maxResults}, dataStoreSpecs=${i}`),n.config.tools.push({retrieval:{vertexAiSearch:r}})}};a($b,"VertexAiSearchTool");var Nb=$b;var Ob=class Ob extends gt{constructor(e){super({name:"vertex_rag_retrieval",description:"Vertex AI RAG Retrieval Tool"}),this.vertexRagStore=e}async applyBuiltInConfig({llmRequest:e}){e.config=e.config||{},e.config.tools=e.config.tools||[],e.config.tools.push({retrieval:{vertexRagStore:this.vertexRagStore}})}};a(Ob,"VertexRagRetrievalTool");var Db=Ob;function cF(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}a(cF,"escapeHtml");function dF(t){if(!t||t.length===0)return`<available_skills>
260
+ </available_skills>`;let e=["<available_skills>"];for(let n of t){let o="frontmatter"in n?n.frontmatter:n;e.push(" <skill>"),e.push(` <name>${cF(o.name)}</name>`),e.push(` <description>${cF(o.description)}</description>`),e.push(" </skill>")}return e.push("</available_skills>"),e.join(`
261
+ `)}a(dF,"formatSkillsAsXml");var Ao=class extends se{constructor(n){super({name:"list_skills",description:"Lists all available skills with their names and descriptions."});this.toolset=n}_getDeclaration(){return{name:this.name,description:this.description,parameters:{type:j.OBJECT,properties:{}}}}async runAsync(n){let o=Object.values(this.toolset.skills);return dF(o)}};a(Ao,"ListSkillsTool"),Ao=Re([tt],Ao);var wo=class extends se{constructor(n){super({name:"load_skill",description:"Loads the SKILL.md instructions for a given skill."});this.toolset=n}_getDeclaration(){return{name:this.name,description:this.description,parameters:{type:j.OBJECT,properties:{name:{type:j.STRING,description:"The name of the skill to load."}},required:["name"]}}}async runAsync({args:n,toolContext:o}){let r=n.name;if(!r)return{error:"Skill name is required.",error_code:"MISSING_SKILL_NAME"};let i;try{i=await this.toolset.getOrFetchSkill(r,o.invocationId)}catch(l){return{error:`Failed to fetch skill '${r}' from registry: ${l.message||l}`,error_code:"REGISTRY_ERROR"}}if(!i)return{error:`Skill '${r}' not found.`,error_code:"SKILL_NOT_FOUND"};let u=`_adk_activated_skill_${We(o.invocationContext).name}`,c=o.state.get(u)||[];return c.includes(r)||o.state.set(u,[...c,r]),{skill_name:r,instructions:i.instructions,frontmatter:i.frontmatter,resources:i.resources}}};a(wo,"LoadSkillTool"),wo=Re([tt],wo);var bo=class extends se{constructor(n){var o,r;if(!n.registry)throw new Error("SearchSkillsTool requires a configured skill registry.");super({name:"search_skills",description:((r=(o=n.registry).searchToolDescription)==null?void 0:r.call(o))||"Searches for relevant skills in the registry based on a semantic or keyword query."});this.toolset=n}_getDeclaration(){return{name:this.name,description:this.description,parameters:{type:j.OBJECT,properties:{query:{type:j.STRING,description:"Semantic or keyword search query."}},required:["query"]}}}async runAsync({args:n}){let o=n.query;if(!o)return{error:"Argument 'query' is required.",error_code:"INVALID_ARGUMENTS"};try{return(await this.toolset.registry.searchSkills(o)).filter(i=>this.toolset.skills[i.name]?(N.warn(`Skill naming conflict: skill '${i.name}' already exists locally. Registry skill is filtered.`),!1):!0)}catch(r){return{error:`Failed to search skills from registry: ${r.message||r}`,error_code:"REGISTRY_ERROR"}}}};a(bo,"SearchSkillsTool"),bo=Re([tt],bo);function fF(t,e={}){return Kt(t,e)}a(fF,"node");var Mr=class extends Fe{async*runImpl(e,n){yield*this.runNodeImpl(e,n)}};a(Mr,"WorkflowNode"),Mr=Re([tt],Mr);var Lb=class Lb extends Fe{get requiresAllPredecessors(){return!0}async*runImpl(e,n){yield J({author:this.name,invocationId:e.invocationId,branch:e.branch,output:n})}};a(Lb,"JoinNode");var bp=Lb;var qQ=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function mF(t){if(!qQ.test(t))throw new Error(`Invalid app name '${t}': must start with a letter and can only consist of letters, digits, underscores, and hyphens.`);if(t==="user")throw new Error("App name cannot be 'user'; reserved for end-user input.")}a(mF,"validateAppName");var Mb=Symbol.for("google.adk.app");function VQ(t){return typeof t=="object"&&t!==null&&Mb in t&&t[Mb]===!0}a(VQ,"isApp");var pF;pF=Mb;var Fb=class Fb{constructor(e){this[pF]=!0;var n;if(mF(e.name),e.rootAgent===void 0||e.rootAgent===null)throw new Error("rootAgent must be provided.");this.name=e.name,this.rootAgent=Ns(e.rootAgent),this.plugins=(n=e.plugins)!=null?n:[],this.resumabilityConfig=e.resumabilityConfig}};a(Fb,"App");var Ub=Fb;Gb();export{So as ADK_HANDLE_MODEL_ERROR_TOOL_NAME,qI as AUTH_PREPROCESSOR,Up as ActiveStreamingTool,cp as Agent,WA as AgentControlledContextCompactor,pb as AgentTool,Yf as AgentTransferLlmRequestProcessor,aw as AlreadyExistsError,YA as AnchoredContextCompactor,_u as ApigeeLlm,Ub as App,cn as AsyncQueue,wf as AuthCredentialTypes,Ht as AuthHandler,jf as AuthPreprocessor,GA as AuthProviderRegistry,$t as BaseAgent,Tu as BaseCodeExecutor,yo as BaseEnvironment,yw as BaseExampleProvider,Yn as BaseLlm,De as BaseLlmRequestProcessor,zI as BaseLlmResponseProcessor,Fe as BaseNode,Lt as BasePlugin,Mu as BaseRetrievalTool,Du as BaseSessionService,se as BaseTool,Jw as BaseToolset,Pr as BranchPath,Cu as BuiltInCodeExecutor,gt as BuiltInTool,np as CONTENT_REQUEST_PROCESSOR,Su as ChromeBuiltInLlm,Eu as ChromeModelUnavailableError,XI as CodeExecutionLanguage,hb as ConsolidateContextTool,tp as ContentRequestProcessor,Le as Context,op as ContextCompactionTrigger,Cs as ContextCompactorRequestProcessor,It as CredentialExchangeError,JA as CredentialRefresherRegistry,Ps as DEFAULT_ROUTE,yQ as ENTERPRISE_WEB_SEARCH,bQ as EXIT_LOOP,Lr as Edge,xp as EnterpriseWebSearchTool,NU as EventType,_b as ExampleTool,Ep as ExitLoopTool,kf as FINISH_TASK_SUCCESS_RESULT,vu as FINISH_TASK_TOOL_NAME,lM as FeatureName,c3 as FeatureStage,LM as FileContentEncoding,hu as FinishTaskTool,Lu as ForwardingArtifactService,fs as FunctionNode,Dt as FunctionTool,OU as GLOBAL_SCOPE_KEY,PQ as GOOGLE_MAPS_GROUNDING,NQ as GOOGLE_SEARCH,uo as Gemini,Iw as GlobalInstructionPlugin,au as GoogleLLMVariant,Sp as GoogleMapsGroundingTool,Tp as GoogleSearchTool,Ou as Graph,gA as INTERACTIONS_REQUEST_PROCESSOR,gC as IN_MODEL_TOOL_SYMBOL,Pu as InMemoryArtifactService,qA as InMemoryCredentialService,_o as InMemoryMemoryService,mp as InMemoryPolicyEngine,lb as InMemoryRunner,To as InMemorySessionService,lw as InputValidationError,io as IntentMismatchError,sp as InteractionsRequestProcessor,Jt as InvocationContext,bp as JoinNode,Or as LLMRegistry,UQ as LOAD_ARTIFACTS,FQ as LOAD_MEMORY,Ao as ListSkillsTool,HC as LiveRequestQueue,Rb as LlamaIndexRetrieval,cp as LlmAgent,QA as LlmSummarizer,Cp as LoadArtifactsTool,Ip as LoadMemoryTool,wo as LoadSkillTool,Ds as LogLevel,ww as LoggingPlugin,Io as LongRunningFunctionTool,go as LoopAgent,Cn as NodeContext,as as NodeReportedError,oo as NodeSchemaValidationError,so as NodeStatus,ss as NodeTimeoutError,gs as NodeTool,dw as NotFoundError,lu as OAuth2CredentialExchanger,_C as OAuth2DiscoveryManager,vC as OAuthGrantType,zQ as PRELOAD_MEMORY,ho as ParallelAgent,ps as ParallelWorker,$u as PluginManager,UU as PolicyOutcome,Ap as PreloadMemoryTool,Eo as REFLECT_AND_RETRY_RESPONSE_TYPE,je as REQUEST_CONFIRMATION_FUNCTION_CALL_NAME,qe as REQUEST_CREDENTIAL_FUNCTION_CALL_NAME,Me as REQUEST_INPUT_FUNCTION_CALL_NAME,Dw as RESERVED_TOOL_CALL_ERROR_TYPE,Ie as ReadonlyContext,Ow as ReflectAndRetryModelPlugin,Mw as ReflectAndRetryToolPlugin,yf as RequestInput,OA as RoutedAgent,Sw as RoutedLlm,Co as Runner,ln as START,Rs as ScopedArtifactService,xo as ScopedFailureTracker,bo as SearchSkillsTool,zw as SecurityPlugin,vo as SequentialAgent,pw as SessionNotFoundError,ZA as SessionStateCredentialService,me as State,cu as StateSchemaError,wA as StreamingMode,Os as Task,tw as TokenBasedContextCompactor,Rr as ToolConfirmation,PU as ToolErrorType,gw as ToolExecutionError,ms as ToolNode,pp as TrackingScope,rw as TrajectoryThoughtPruningCompactor,iw as TruncatingContextCompactor,BQ as URL_CONTEXT,wp as UrlContextTool,Nb as VertexAiSearchTool,Db as VertexRagRetrievalTool,bn as Workflow,Mr as WorkflowNode,Ns as asRunnableRoot,$f as commonPrefixOf,J as createEvent,Ft as createEventActions,Lf as createNodeErrorEvent,jn as createNodeState,N5 as createResumabilityConfig,gp as createSession,Nf as createSubBranch,YU as determineAgentForResumption,CL as findEventByFunctionCallId,XU as findEventByLastFunctionResponseId,LC as findMatchingFunctionCall,JY as functionsExportedForTestingOnly,Jf as geminiInitParams,bt as generateClientFunctionCallId,Z5 as getAskUserConfirmationFunctionCalls,cI as getClientLabels,AI as getFeatureConfig,le as getFunctionCalls,fe as getFunctionResponses,EF as getLogger,u5 as getPendingUserInputRequests,RQ as getUserChoiceTool,_A as getUserInputRequests,_l as hasThoughts,iP as hasTrailingCodeExecutionResult,hQ as isAgentTool,VQ as isApp,Wn as isBaseAgent,_w as isBaseExampleProvider,fI as isBaseLlm,uu as isBaseTool,Kw as isBaseToolset,dn as isCompactedEvent,dM as isFeatureEnabled,ar as isFinalResponse,uX as isFunctionTool,Qn as isGemini2OrAbove,ao as isGemini3xFlashLive,DY as isInModelTool,ZY as isIntentMismatchError,te as isLlmAgent,C5 as isLoopAgent,Df as isNodeErrorEvent,cL as isNodeReportedError,dL as isNodeSchemaValidationError,WL as isNodeState,lL as isNodeTimeoutError,I5 as isParallelAgent,_f as isRequestInput,ab as isRoutableLlmAgent,R5 as isRoutedAgent,ib as isRunnableRoot,dQ as isRunner,Es as isScratchpadEvent,P5 as isSequentialAgent,fp as isSessionArtifactService,VY as isStateSchemaError,jY as isToolNotFound,_p as isWorkflow,qw as mergeStates,fF as node,pC as normalizeRetryExceptions,CSe as overrideFeatureEnabled,Js as populateClientFunctionCallId,cs as prepareRetryConfig,nm as pruneThoughts,TSe as registerFeature,GQ as requestInputTool,We as requireAgent,xA as requiresUserInput,SF as resetLogger,Nu as resolveScopeKey,e3 as runWithClientLabel,TF as setLogLevel,Np as setLogger,yl as stringifyContent,bM as stripAdkIdentityPreamble,F5 as toStructuredEvents,H5 as trimTempDeltaState,FU as trimTempState,mF as validateAppName,Ks as version,ISe as withTemporaryFeatureOverride,br as zodObjectToSchema};
3
262
  /**
4
263
  * @license
5
264
  * Copyright 2025 Google LLC
6
265
  * SPDX-License-Identifier: Apache-2.0
7
266
  */
8
- export * from "./common.js";
267
+ /**
268
+ * @license
269
+ * Copyright 2026 Google LLC
270
+ * SPDX-License-Identifier: Apache-2.0
271
+ */
272
+ /*! Bundled license information:
273
+
274
+ lodash-es/lodash.js:
275
+ (**
276
+ * @license
277
+ * Lodash (Custom Build) <https://lodash.com/>
278
+ * Build: `lodash modularize exports="es" --repo lodash/lodash#4.18.1 -o ./`
279
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
280
+ * Released under MIT license <https://lodash.com/license>
281
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
282
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
283
+ *)
284
+
285
+ @google/genai/dist/web/index.mjs:
286
+ @google/genai/dist/web/index.mjs:
287
+ @google/genai/dist/web/index.mjs:
288
+ @google/genai/dist/web/index.mjs:
289
+ (**
290
+ * @license
291
+ * Copyright 2025 Google LLC
292
+ * SPDX-License-Identifier: Apache-2.0
293
+ *)
294
+
295
+ @google/genai/dist/web/index.mjs:
296
+ (**
297
+ * @license
298
+ * Copyright 2025 Google LLC
299
+ * SPDX-License-Identifier: Apache-2.0
300
+ *)
301
+ (**
302
+ * @license
303
+ * Copyright 2026 Google LLC
304
+ * SPDX-License-Identifier: Apache-2.0
305
+ *
306
+ * g3-prettier-ignore-file
307
+ *)
308
+ */
309
+ //# sourceMappingURL=index_web.js.map