@google/adk 2.0.0 → 2.2.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.
- package/dist/cjs/a2a/a2a_event.js +0 -29
- package/dist/cjs/a2a/a2a_remote_agent.js +8 -5
- package/dist/cjs/a2a/a2a_remote_agent_utils.js +104 -2
- package/dist/cjs/a2a/agent_card.js +66 -6
- package/dist/cjs/a2a/agent_executor.js +18 -6
- package/dist/cjs/a2a/agent_to_a2a.js +6 -1
- package/dist/cjs/a2a/event_processor_utils.js +1 -1
- package/dist/cjs/a2a/executor_context.js +4 -2
- package/dist/cjs/a2a/index.js +4 -0
- package/dist/cjs/a2a/request_metadata.js +94 -0
- package/dist/cjs/agents/base_agent.js +9 -8
- package/dist/cjs/agents/context.js +7 -0
- package/dist/cjs/agents/functions.js +150 -47
- package/dist/cjs/agents/invocation_context.js +1 -0
- package/dist/cjs/agents/llm_agent.js +21 -6
- package/dist/cjs/agents/loop_agent.js +1 -1
- package/dist/cjs/agents/parallel_agent.js +1 -1
- package/dist/cjs/agents/processors/agent_transfer_llm_request_processor.js +26 -5
- package/dist/cjs/agents/processors/code_execution_request_processor.js +2 -2
- package/dist/cjs/agents/processors/content_processor_utils.js +15 -7
- package/dist/cjs/agents/processors/content_request_processor.js +4 -1
- package/dist/cjs/agents/processors/nl_planning_processor.js +114 -0
- package/dist/cjs/agents/processors/request_confirmation_llm_request_processor.js +19 -12
- package/dist/cjs/agents/processors/request_input_llm_request_processor.js +3 -7
- package/dist/cjs/agents/readonly_context.js +6 -0
- package/dist/cjs/agents/routed_agent.js +1 -1
- package/dist/cjs/agents/sequential_agent.js +1 -1
- package/dist/cjs/apps/app.js +1 -1
- package/dist/cjs/artifacts/file_artifact_service.js +1 -2
- package/dist/cjs/artifacts/gcs_artifact_service.js +13 -7
- package/dist/cjs/artifacts/scoped_artifact_service.js +9 -0
- package/dist/cjs/artifacts/session_artifact_service.js +19 -0
- package/dist/cjs/auth/auth_credential.js +12 -2
- package/dist/cjs/auth/auth_handler.js +44 -8
- package/dist/cjs/auth/oauth2/oauth2_credential_refresher.js +1 -1
- package/dist/cjs/auth/oauth2/oauth2_utils.js +17 -2
- package/dist/cjs/code_executors/base_code_executor.js +1 -1
- package/dist/cjs/code_executors/built_in_code_executor.js +1 -1
- package/dist/cjs/code_executors/code_execution_utils.js +5 -5
- package/dist/cjs/code_executors/container_code_executor.js +186 -0
- package/dist/cjs/code_executors/docker_container.js +282 -0
- package/dist/cjs/code_executors/unsafe_local_code_executor.js +11 -6
- package/dist/cjs/common.js +119 -45
- package/dist/cjs/context/agent_controlled_context_compactor.js +10 -5
- package/dist/cjs/context/anchored_context_compactor.js +41 -18
- package/dist/cjs/context/compaction_utils.js +15 -6
- package/dist/cjs/context/token_based_context_compactor.js +10 -2
- package/dist/cjs/context/trajectory_thought_pruning_compactor.js +17 -10
- package/dist/cjs/context/truncating_context_compactor.js +17 -5
- package/dist/cjs/errors/already_exists_error.js +50 -0
- package/dist/cjs/errors/input_validation_error.js +50 -0
- package/dist/cjs/errors/not_found_error.js +50 -0
- package/dist/cjs/errors/session_not_found_error.js +50 -0
- package/dist/cjs/errors/tool_execution_error.js +68 -0
- package/dist/cjs/events/event.js +1 -1
- package/dist/cjs/events/event_actions.js +7 -0
- package/dist/cjs/examples/base_example_provider.js +1 -1
- package/dist/cjs/examples/example.js +92 -0
- package/dist/cjs/examples/example_util.js +28 -4
- package/dist/cjs/examples/index.js +39 -0
- package/dist/cjs/examples/vertex_ai_example_store.js +39 -0
- package/dist/cjs/index.js +93 -0
- package/dist/cjs/index_web.js +2 -0
- package/dist/cjs/integrations/agent_registry/agent_registry.js +3 -2
- package/dist/cjs/memory/rag_memory_transcript.js +136 -0
- package/dist/cjs/memory/vertex_ai_memory_bank_service.js +19 -7
- package/dist/cjs/memory/vertex_ai_rag_api.js +120 -0
- package/dist/cjs/memory/vertex_ai_rag_memory_service.js +228 -0
- package/dist/cjs/models/apigee_llm.js +1 -1
- package/dist/cjs/models/base_llm.js +2 -7
- package/dist/cjs/models/chrome_prompt_llm.js +318 -0
- package/dist/cjs/models/chrome_prompt_utils.js +281 -0
- package/dist/cjs/models/gemini_llm_connection.js +5 -4
- package/dist/cjs/models/google_llm.js +9 -4
- package/dist/cjs/models/interactions_utils.js +2 -3
- package/dist/cjs/models/registry.js +2 -0
- package/dist/cjs/planners/base_planner.js +56 -0
- package/dist/cjs/planners/built_in_planner.js +85 -0
- package/dist/cjs/planners/plan_re_act_planner.js +172 -0
- package/dist/cjs/plugins/_reflect_retry_utils.js +142 -0
- package/dist/cjs/plugins/base_plugin.js +46 -61
- package/dist/cjs/plugins/reflect_retry_model_plugin.js +274 -0
- package/dist/cjs/plugins/reflect_retry_tool_plugin.js +276 -0
- package/dist/cjs/runner/runner.js +29 -26
- package/dist/cjs/sessions/database_session_service.js +78 -43
- package/dist/cjs/sessions/db/operations.js +229 -22
- package/dist/cjs/sessions/db/schema.js +113 -159
- package/dist/cjs/sessions/registry.js +5 -1
- package/dist/cjs/sessions/vertex_ai_session_service.js +2 -2
- package/dist/cjs/telemetry/setup.js +1 -1
- package/dist/cjs/telemetry/tracing.js +11 -1
- package/dist/cjs/tools/agent_tool.js +4 -5
- package/dist/cjs/tools/base_tool.js +14 -4
- package/dist/cjs/tools/base_toolset.js +4 -4
- package/dist/cjs/tools/built_in_tool.js +75 -0
- package/dist/cjs/tools/enterprise_web_search_tool.js +3 -6
- package/dist/cjs/tools/example_tool.js +1 -1
- package/dist/cjs/tools/forwarding_artifact_service.js +18 -13
- package/dist/cjs/tools/function_tool.js +6 -3
- package/dist/cjs/tools/google_maps_grounding_tool.js +3 -6
- package/dist/cjs/tools/google_search_tool.js +3 -6
- package/dist/cjs/tools/load_artifacts_tool.js +47 -23
- package/dist/cjs/tools/load_web_page.js +6 -172
- package/dist/cjs/tools/mcp/load_mcp_resource_tool.js +34 -5
- package/dist/cjs/tools/mcp/mcp_session_manager.js +14 -8
- package/dist/cjs/tools/openapi_tool/auth/auth_helpers.js +292 -4
- package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.js +15 -1
- package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/base_auth_credential_exchanger.js +70 -0
- package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +120 -0
- package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.js +10 -10
- package/dist/cjs/tools/openapi_tool/common/common.js +139 -0
- package/dist/cjs/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +11 -6
- package/dist/cjs/tools/openapi_tool/openapi_spec_parser/operation_parser.js +74 -14
- package/dist/cjs/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +146 -34
- package/dist/cjs/tools/openapi_tool/openapi_toolset.js +14 -2
- package/dist/cjs/tools/openapi_tool/rest_api_tool.js +106 -46
- package/dist/cjs/tools/preload_memory_tool.js +1 -1
- package/dist/cjs/tools/resume_inputs.js +27 -0
- package/dist/cjs/tools/retrieval/base_retrieval_tool.js +60 -0
- package/dist/cjs/tools/retrieval/files_retrieval.js +95 -0
- package/dist/cjs/tools/retrieval/llama_index_retrieval.js +57 -0
- package/dist/cjs/tools/skill/skill_toolset.js +2 -0
- package/dist/cjs/tools/tool_context.js +41 -0
- package/dist/cjs/tools/url_context_tool.js +3 -6
- package/dist/cjs/tools/vertex_ai_search_tool.js +4 -8
- package/dist/cjs/tools/vertex_rag_retrieval_tool.js +3 -10
- package/dist/cjs/tools/webmcp/index.js +37 -0
- package/dist/cjs/tools/webmcp/webmcp_tool.js +156 -0
- package/dist/cjs/tools/webmcp/webmcp_toolset.js +116 -0
- package/dist/cjs/tools/webmcp/webmcp_types.js +50 -0
- package/dist/cjs/utils/case_utils.js +52 -2
- package/dist/cjs/utils/client_labels.js +67 -0
- package/dist/cjs/utils/crypto_shim.js +16 -0
- package/dist/cjs/utils/gemini_schema_util.js +103 -9
- package/dist/cjs/utils/hash_utils.js +73 -0
- package/dist/cjs/utils/live_connection_utils.js +10 -9
- package/dist/cjs/utils/logger.js +15 -50
- package/dist/cjs/utils/logger_browser.js +86 -0
- package/dist/cjs/utils/logger_node.js +119 -0
- package/dist/cjs/utils/model_name.js +17 -2
- package/dist/cjs/utils/redact_inline_data.js +46 -0
- package/dist/cjs/utils/redact_uri.js +15 -1
- package/dist/cjs/utils/schema.js +1 -1
- package/dist/cjs/utils/simple_zod_to_json.js +5 -0
- package/dist/cjs/utils/ssrf_guard.js +262 -0
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/workflow/base_node.js +1 -1
- package/dist/cjs/workflow/graph.js +1 -1
- package/dist/cjs/workflow/nodes/node_tool.js +2 -11
- package/dist/cjs/workflow/request_input.js +1 -1
- package/dist/cjs/workflow/run_llm_agent_as_node.js +1 -1
- package/dist/cjs/workflow/workflow.js +1 -1
- package/dist/esm/a2a/a2a_event.js +0 -28
- package/dist/esm/a2a/a2a_remote_agent.js +10 -5
- package/dist/esm/a2a/a2a_remote_agent_utils.js +102 -2
- package/dist/esm/a2a/agent_card.js +71 -6
- package/dist/esm/a2a/agent_executor.js +18 -6
- package/dist/esm/a2a/agent_to_a2a.js +8 -2
- package/dist/esm/a2a/event_processor_utils.js +1 -2
- package/dist/esm/a2a/executor_context.js +4 -2
- package/dist/esm/a2a/index.js +7 -1
- package/dist/esm/a2a/request_metadata.js +68 -0
- package/dist/esm/agents/base_agent.js +9 -8
- package/dist/esm/agents/context.js +7 -0
- package/dist/esm/agents/functions.js +152 -48
- package/dist/esm/agents/invocation_context.js +1 -0
- package/dist/esm/agents/llm_agent.js +24 -6
- package/dist/esm/agents/loop_agent.js +1 -1
- package/dist/esm/agents/parallel_agent.js +1 -1
- package/dist/esm/agents/processors/agent_transfer_llm_request_processor.js +26 -5
- package/dist/esm/agents/processors/code_execution_request_processor.js +2 -2
- package/dist/esm/agents/processors/content_processor_utils.js +15 -7
- package/dist/esm/agents/processors/content_request_processor.js +4 -1
- package/dist/esm/agents/processors/nl_planning_processor.js +87 -0
- package/dist/esm/agents/processors/request_confirmation_llm_request_processor.js +19 -12
- package/dist/esm/agents/processors/request_input_llm_request_processor.js +3 -7
- package/dist/esm/agents/readonly_context.js +6 -0
- package/dist/esm/agents/routed_agent.js +1 -1
- package/dist/esm/agents/sequential_agent.js +1 -1
- package/dist/esm/apps/app.js +1 -1
- package/dist/esm/artifacts/file_artifact_service.js +1 -2
- package/dist/esm/artifacts/gcs_artifact_service.js +13 -7
- package/dist/esm/artifacts/scoped_artifact_service.js +9 -0
- package/dist/esm/artifacts/session_artifact_service.js +12 -0
- package/dist/esm/auth/auth_credential.js +11 -1
- package/dist/esm/auth/auth_handler.js +47 -8
- package/dist/esm/auth/oauth2/oauth2_credential_refresher.js +1 -1
- package/dist/esm/auth/oauth2/oauth2_utils.js +15 -2
- package/dist/esm/code_executors/base_code_executor.js +1 -1
- package/dist/esm/code_executors/built_in_code_executor.js +1 -1
- package/dist/esm/code_executors/code_execution_utils.js +5 -5
- package/dist/esm/code_executors/container_code_executor.js +155 -0
- package/dist/esm/code_executors/docker_container.js +265 -0
- package/dist/esm/code_executors/unsafe_local_code_executor.js +11 -6
- package/dist/esm/common.js +111 -40
- package/dist/esm/context/agent_controlled_context_compactor.js +10 -5
- package/dist/esm/context/anchored_context_compactor.js +45 -19
- package/dist/esm/context/compaction_utils.js +13 -5
- package/dist/esm/context/token_based_context_compactor.js +10 -2
- package/dist/esm/context/trajectory_thought_pruning_compactor.js +17 -10
- package/dist/esm/context/truncating_context_compactor.js +17 -5
- package/dist/esm/errors/already_exists_error.js +23 -0
- package/dist/esm/errors/input_validation_error.js +23 -0
- package/dist/{web/auth/refresher/base_credential_refresher.js → esm/errors/not_found_error.js} +9 -6
- package/dist/esm/errors/session_not_found_error.js +23 -0
- package/dist/esm/errors/tool_execution_error.js +40 -0
- package/dist/esm/events/event.js +1 -1
- package/dist/esm/events/event_actions.js +6 -0
- package/dist/esm/examples/base_example_provider.js +1 -1
- package/dist/esm/examples/example.js +85 -0
- package/dist/esm/examples/example_util.js +25 -3
- package/dist/{web/auth/credential_service/base_credential_service.js → esm/examples/index.js} +4 -0
- package/dist/{web/version.js → esm/examples/vertex_ai_example_store.js} +2 -2
- package/dist/esm/index.js +87 -0
- package/dist/esm/index_web.js +2 -0
- package/dist/esm/integrations/agent_registry/agent_registry.js +3 -2
- package/dist/esm/memory/rag_memory_transcript.js +106 -0
- package/dist/esm/memory/vertex_ai_memory_bank_service.js +19 -7
- package/dist/esm/memory/vertex_ai_rag_api.js +93 -0
- package/dist/esm/memory/vertex_ai_rag_memory_service.js +208 -0
- package/dist/esm/models/apigee_llm.js +1 -1
- package/dist/esm/models/base_llm.js +3 -8
- package/dist/esm/models/chrome_prompt_llm.js +302 -0
- package/dist/esm/models/chrome_prompt_utils.js +241 -0
- package/dist/esm/models/gemini_llm_connection.js +6 -5
- package/dist/esm/models/google_llm.js +9 -4
- package/dist/esm/models/interactions_utils.js +2 -3
- package/dist/esm/models/registry.js +2 -0
- package/dist/esm/planners/base_planner.js +28 -0
- package/dist/esm/planners/built_in_planner.js +57 -0
- package/dist/esm/planners/plan_re_act_planner.js +145 -0
- package/dist/esm/plugins/_reflect_retry_utils.js +111 -0
- package/dist/esm/plugins/base_plugin.js +46 -61
- package/dist/esm/plugins/reflect_retry_model_plugin.js +250 -0
- package/dist/esm/plugins/reflect_retry_tool_plugin.js +254 -0
- package/dist/esm/runner/runner.js +35 -27
- package/dist/esm/sessions/database_session_service.js +58 -25
- package/dist/esm/sessions/db/operations.js +229 -22
- package/dist/esm/sessions/db/schema.js +111 -160
- package/dist/esm/sessions/registry.js +5 -1
- package/dist/esm/sessions/vertex_ai_session_service.js +1 -1
- package/dist/esm/telemetry/setup.js +1 -1
- package/dist/esm/telemetry/tracing.js +11 -1
- package/dist/esm/tools/agent_tool.js +4 -5
- package/dist/esm/tools/base_tool.js +11 -3
- package/dist/esm/tools/base_toolset.js +4 -4
- package/dist/esm/tools/built_in_tool.js +51 -0
- package/dist/esm/tools/enterprise_web_search_tool.js +3 -6
- package/dist/esm/tools/example_tool.js +1 -1
- package/dist/esm/tools/forwarding_artifact_service.js +18 -13
- package/dist/esm/tools/function_tool.js +6 -3
- package/dist/esm/tools/google_maps_grounding_tool.js +3 -6
- package/dist/esm/tools/google_search_tool.js +3 -6
- package/dist/esm/tools/load_artifacts_tool.js +48 -24
- package/dist/esm/tools/load_web_page.js +10 -170
- package/dist/esm/tools/mcp/load_mcp_resource_tool.js +34 -5
- package/dist/esm/tools/mcp/mcp_session_manager.js +14 -8
- package/dist/esm/tools/openapi_tool/auth/auth_helpers.js +285 -3
- package/dist/esm/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.js +15 -1
- package/dist/esm/tools/openapi_tool/auth/credential_exchangers/base_auth_credential_exchanger.js +43 -0
- package/dist/esm/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +93 -0
- package/dist/esm/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.js +10 -12
- package/dist/esm/tools/openapi_tool/common/common.js +112 -0
- package/dist/esm/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +11 -6
- package/dist/esm/tools/openapi_tool/openapi_spec_parser/operation_parser.js +81 -14
- package/dist/esm/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +146 -33
- package/dist/esm/tools/openapi_tool/openapi_toolset.js +14 -2
- package/dist/esm/tools/openapi_tool/rest_api_tool.js +105 -46
- package/dist/esm/tools/preload_memory_tool.js +1 -1
- package/dist/esm/tools/retrieval/base_retrieval_tool.js +33 -0
- package/dist/esm/tools/retrieval/files_retrieval.js +81 -0
- package/dist/esm/tools/retrieval/llama_index_retrieval.js +30 -0
- package/dist/esm/tools/skill/skill_toolset.js +2 -0
- package/dist/{web/context/base_context_compactor.js → esm/tools/tool_context.js} +8 -0
- package/dist/esm/tools/url_context_tool.js +3 -6
- package/dist/esm/tools/vertex_ai_search_tool.js +4 -8
- package/dist/esm/tools/vertex_rag_retrieval_tool.js +3 -10
- package/dist/{web/auth/base_auth_provider.js → esm/tools/webmcp/index.js} +3 -0
- package/dist/esm/tools/webmcp/webmcp_tool.js +131 -0
- package/dist/esm/tools/webmcp/webmcp_toolset.js +89 -0
- package/dist/{web/utils/crypto_shim.js → esm/tools/webmcp/webmcp_types.js} +10 -6
- package/dist/esm/utils/case_utils.js +49 -1
- package/dist/esm/utils/client_labels.js +65 -0
- package/dist/esm/utils/crypto_shim.js +14 -0
- package/dist/esm/utils/gemini_schema_util.js +102 -9
- package/dist/esm/utils/hash_utils.js +45 -0
- package/dist/esm/utils/live_connection_utils.js +11 -10
- package/dist/esm/utils/logger.js +14 -40
- package/dist/esm/utils/logger_browser.js +58 -0
- package/dist/esm/utils/logger_node.js +81 -0
- package/dist/esm/utils/model_name.js +15 -2
- package/dist/esm/utils/redact_inline_data.js +19 -0
- package/dist/esm/utils/redact_uri.js +15 -1
- package/dist/esm/utils/schema.js +1 -1
- package/dist/esm/utils/simple_zod_to_json.js +5 -0
- package/dist/{web/tools/load_web_page.js → esm/utils/ssrf_guard.js} +95 -107
- package/dist/esm/version.js +1 -1
- package/dist/esm/workflow/base_node.js +1 -1
- package/dist/esm/workflow/graph.js +1 -1
- package/dist/esm/workflow/nodes/node_tool.js +2 -11
- package/dist/esm/workflow/request_input.js +1 -1
- package/dist/esm/workflow/run_llm_agent_as_node.js +1 -1
- package/dist/esm/workflow/workflow.js +1 -1
- package/dist/types/a2a/a2a_event.d.ts +7 -10
- package/dist/types/a2a/a2a_remote_agent.d.ts +5 -0
- package/dist/types/a2a/a2a_remote_agent_utils.d.ts +25 -0
- package/dist/types/a2a/agent_card.d.ts +9 -0
- package/dist/types/a2a/agent_executor.d.ts +1 -1
- package/dist/types/a2a/agent_to_a2a.d.ts +2 -0
- package/dist/types/a2a/auth.d.ts +5 -1
- package/dist/types/a2a/executor_context.d.ts +7 -1
- package/dist/types/a2a/index.d.ts +1 -1
- package/dist/types/a2a/request_metadata.d.ts +22 -0
- package/dist/types/agents/base_agent.d.ts +19 -16
- package/dist/types/agents/context.d.ts +8 -0
- package/dist/types/agents/functions.d.ts +72 -6
- package/dist/types/agents/invocation_context.d.ts +11 -3
- package/dist/types/agents/llm_agent.d.ts +20 -7
- package/dist/types/agents/processors/agent_transfer_llm_request_processor.d.ts +16 -1
- package/dist/types/agents/processors/nl_planning_processor.d.ts +30 -0
- package/dist/types/agents/readonly_context.d.ts +4 -0
- package/dist/types/agents/run_config.d.ts +21 -8
- package/dist/types/artifacts/scoped_artifact_service.d.ts +13 -0
- package/dist/types/artifacts/session_artifact_service.d.ts +8 -1
- package/dist/types/auth/auth_credential.d.ts +22 -8
- package/dist/types/auth/auth_handler.d.ts +12 -1
- package/dist/types/auth/oauth2/oauth2_credential_refresher.d.ts +1 -1
- package/dist/types/auth/oauth2/oauth2_utils.d.ts +9 -0
- package/dist/types/auth/refresher/base_credential_refresher.d.ts +1 -1
- package/dist/types/code_executors/code_execution_utils.d.ts +1 -1
- package/dist/types/code_executors/container_code_executor.d.ts +89 -0
- package/dist/types/code_executors/docker_container.d.ts +79 -0
- package/dist/types/common.d.ts +37 -23
- package/dist/types/context/compaction_utils.d.ts +9 -1
- package/dist/types/errors/already_exists_error.d.ts +14 -0
- package/dist/types/errors/input_validation_error.d.ts +14 -0
- package/dist/types/errors/not_found_error.d.ts +14 -0
- package/dist/types/errors/session_not_found_error.d.ts +14 -0
- package/dist/types/errors/tool_execution_error.d.ts +36 -0
- package/dist/types/events/event_actions.d.ts +13 -0
- package/dist/types/examples/base_example_provider.d.ts +2 -2
- package/dist/types/examples/example.d.ts +75 -0
- package/dist/types/examples/example_util.d.ts +13 -2
- package/dist/types/examples/index.d.ts +18 -0
- package/dist/types/examples/vertex_ai_example_store.d.ts +7 -0
- package/dist/types/index.d.ts +31 -1
- package/dist/types/memory/memory_entry.d.ts +15 -0
- package/dist/types/memory/rag_memory_transcript.d.ts +55 -0
- package/dist/types/memory/vertex_ai_memory_bank_service.d.ts +9 -0
- package/dist/types/memory/vertex_ai_rag_api.d.ts +89 -0
- package/dist/types/memory/vertex_ai_rag_memory_service.d.ts +68 -0
- package/dist/types/models/chrome_prompt_llm.d.ts +210 -0
- package/dist/types/models/chrome_prompt_utils.d.ts +97 -0
- package/dist/types/models/google_llm.d.ts +8 -3
- package/dist/types/models/registry.d.ts +3 -2
- package/dist/types/planners/base_planner.d.ts +50 -0
- package/dist/types/planners/built_in_planner.d.ts +53 -0
- package/dist/types/planners/plan_re_act_planner.d.ts +21 -0
- package/dist/types/plugins/_reflect_retry_utils.d.ts +72 -0
- package/dist/types/plugins/base_plugin.d.ts +64 -62
- package/dist/types/plugins/logging_plugin.d.ts +3 -2
- package/dist/types/plugins/reflect_retry_model_plugin.d.ts +132 -0
- package/dist/types/plugins/reflect_retry_tool_plugin.d.ts +187 -0
- package/dist/types/runner/runner.d.ts +7 -8
- package/dist/types/sessions/database_session_service.d.ts +1 -1
- package/dist/types/sessions/db/operations.d.ts +13 -1
- package/dist/types/sessions/db/schema.d.ts +23 -9
- package/dist/types/skills/skill_registry.d.ts +8 -0
- package/dist/types/tools/base_tool.d.ts +11 -0
- package/dist/types/tools/base_toolset.d.ts +3 -4
- package/dist/types/tools/built_in_tool.d.ts +41 -0
- package/dist/types/tools/enterprise_web_search_tool.d.ts +4 -4
- package/dist/types/tools/forwarding_artifact_service.d.ts +23 -10
- package/dist/types/tools/function_tool.d.ts +42 -9
- package/dist/types/tools/google_maps_grounding_tool.d.ts +4 -4
- package/dist/types/tools/google_search_tool.d.ts +4 -4
- package/dist/types/tools/long_running_tool.d.ts +1 -1
- package/dist/types/tools/mcp/mcp_toolset.d.ts +11 -10
- package/dist/types/tools/openapi_tool/auth/auth_helpers.d.ts +115 -1
- package/dist/types/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.d.ts +31 -2
- package/dist/types/tools/openapi_tool/auth/credential_exchangers/base_auth_credential_exchanger.d.ts +35 -0
- package/dist/types/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.d.ts +54 -0
- package/dist/types/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.d.ts +0 -1
- package/dist/types/tools/openapi_tool/common/common.d.ts +60 -0
- package/dist/types/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.d.ts +7 -0
- package/dist/types/tools/openapi_tool/openapi_spec_parser/operation_parser.d.ts +56 -2
- package/dist/types/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.d.ts +73 -5
- package/dist/types/tools/openapi_tool/openapi_toolset.d.ts +11 -0
- package/dist/types/tools/openapi_tool/rest_api_tool.d.ts +42 -8
- package/dist/types/tools/preload_memory_tool.d.ts +1 -1
- package/dist/types/tools/resume_inputs.d.ts +25 -0
- package/dist/types/tools/retrieval/base_retrieval_tool.d.ts +21 -0
- package/dist/types/tools/retrieval/files_retrieval.d.ts +50 -0
- package/dist/types/tools/retrieval/llama_index_retrieval.d.ts +62 -0
- package/dist/types/tools/tool_context.d.ts +19 -0
- package/dist/types/tools/url_context_tool.d.ts +4 -4
- package/dist/types/tools/vertex_ai_search_tool.d.ts +4 -4
- package/dist/types/tools/vertex_rag_retrieval_tool.d.ts +13 -12
- package/dist/types/tools/webmcp/index.d.ts +12 -0
- package/dist/types/tools/webmcp/webmcp_tool.d.ts +47 -0
- package/dist/types/tools/webmcp/webmcp_toolset.d.ts +67 -0
- package/dist/types/tools/webmcp/webmcp_types.d.ts +69 -0
- package/dist/types/utils/case_utils.d.ts +36 -0
- package/dist/types/utils/client_labels.d.ts +33 -0
- package/dist/types/utils/crypto_shim.d.ts +16 -0
- package/dist/types/utils/gemini_schema_util.d.ts +18 -7
- package/dist/types/utils/hash_utils.d.ts +25 -0
- package/dist/types/utils/logger.d.ts +33 -3
- package/dist/types/utils/logger_browser.d.ts +28 -0
- package/dist/types/utils/logger_node.d.ts +20 -0
- package/dist/types/utils/model_name.d.ts +30 -2
- package/dist/types/utils/output_schema_utils.d.ts +3 -3
- package/dist/types/utils/redact_inline_data.d.ts +16 -0
- package/dist/types/utils/redact_uri.d.ts +12 -8
- package/dist/types/utils/ssrf_guard.d.ts +32 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/web/index_web.js +337 -3
- package/dist/web/index_web.js.map +7 -0
- package/package.json +24 -15
- package/dist/web/a2a/a2a_event.js +0 -290
- package/dist/web/a2a/a2a_remote_agent.js +0 -200
- package/dist/web/a2a/a2a_remote_agent_run_processor.js +0 -189
- package/dist/web/a2a/a2a_remote_agent_utils.js +0 -141
- package/dist/web/a2a/agent_card.js +0 -373
- package/dist/web/a2a/agent_executor.js +0 -246
- package/dist/web/a2a/agent_to_a2a.js +0 -126
- package/dist/web/a2a/auth.js +0 -41
- package/dist/web/a2a/event_converter_utils.js +0 -242
- package/dist/web/a2a/event_processor_utils.js +0 -209
- package/dist/web/a2a/executor_context.js +0 -28
- package/dist/web/a2a/index.js +0 -20
- package/dist/web/a2a/metadata_converter_utils.js +0 -115
- package/dist/web/a2a/part_converter_utils.js +0 -201
- package/dist/web/agents/active_streaming_tool.js +0 -25
- package/dist/web/agents/base_agent.js +0 -462
- package/dist/web/agents/context.js +0 -146
- package/dist/web/agents/framework_function_calls.js +0 -34
- package/dist/web/agents/functions.js +0 -462
- package/dist/web/agents/instructions.js +0 -188
- package/dist/web/agents/invocation_context.js +0 -126
- package/dist/web/agents/live_request_queue.js +0 -151
- package/dist/web/agents/llm_agent.js +0 -1514
- package/dist/web/agents/loop_agent.js +0 -131
- package/dist/web/agents/parallel_agent.js +0 -122
- package/dist/web/agents/processors/agent_transfer_llm_request_processor.js +0 -113
- package/dist/web/agents/processors/base_llm_processor.js +0 -21
- package/dist/web/agents/processors/basic_llm_request_processor.js +0 -84
- package/dist/web/agents/processors/code_execution_request_processor.js +0 -381
- package/dist/web/agents/processors/content_processor_utils.js +0 -432
- package/dist/web/agents/processors/content_request_processor.js +0 -73
- package/dist/web/agents/processors/context_compactor_request_processor.js +0 -78
- package/dist/web/agents/processors/identity_llm_request_processor.js +0 -59
- package/dist/web/agents/processors/instructions_llm_request_processor.js +0 -85
- package/dist/web/agents/processors/interactions_request_processor.js +0 -56
- package/dist/web/agents/processors/request_confirmation_llm_request_processor.js +0 -393
- package/dist/web/agents/processors/request_input_llm_request_processor.js +0 -228
- package/dist/web/agents/processors/tool_filter_request_processor.js +0 -72
- package/dist/web/agents/readonly_context.js +0 -60
- package/dist/web/agents/routed_agent.js +0 -161
- package/dist/web/agents/run_config.js +0 -74
- package/dist/web/agents/sequential_agent.js +0 -141
- package/dist/web/agents/transcription_entry.js +0 -7
- package/dist/web/agents/user_input_request.js +0 -135
- package/dist/web/apps/app.js +0 -52
- package/dist/web/apps/resumability_config.js +0 -33
- package/dist/web/artifacts/base_artifact_service.js +0 -7
- package/dist/web/artifacts/file_artifact_service.js +0 -568
- package/dist/web/artifacts/gcs_artifact_service.js +0 -298
- package/dist/web/artifacts/in_memory_artifact_service.js +0 -172
- package/dist/web/artifacts/registry.js +0 -36
- package/dist/web/artifacts/scoped_artifact_service.js +0 -89
- package/dist/web/auth/auth_credential.js +0 -18
- package/dist/web/auth/auth_handler.js +0 -151
- package/dist/web/auth/auth_preprocessor.js +0 -184
- package/dist/web/auth/auth_provider_registry.js +0 -37
- package/dist/web/auth/auth_schemes.js +0 -36
- package/dist/web/auth/auth_tool.js +0 -7
- package/dist/web/auth/credential_response_binding.js +0 -91
- package/dist/web/auth/credential_service/in_memory_credential_service.js +0 -50
- package/dist/web/auth/credential_service/session_state_credential_service.js +0 -27
- package/dist/web/auth/exchanger/base_credential_exchanger.js +0 -16
- package/dist/web/auth/exchanger/credential_exchanger_registry.js +0 -35
- package/dist/web/auth/oauth2/oauth2_credential_exchanger.js +0 -194
- package/dist/web/auth/oauth2/oauth2_credential_refresher.js +0 -105
- package/dist/web/auth/oauth2/oauth2_discovery.js +0 -196
- package/dist/web/auth/oauth2/oauth2_utils.js +0 -105
- package/dist/web/auth/refresher/credential_refresher_registry.js +0 -44
- package/dist/web/code_executors/agent_engine_sandbox_code_executor.js +0 -284
- package/dist/web/code_executors/base_code_executor.js +0 -68
- package/dist/web/code_executors/built_in_code_executor.js +0 -50
- package/dist/web/code_executors/code_execution_utils.js +0 -131
- package/dist/web/code_executors/code_executor_context.js +0 -174
- package/dist/web/code_executors/unsafe_local_code_executor.js +0 -221
- package/dist/web/common.js +0 -452
- package/dist/web/context/agent_controlled_context_compactor.js +0 -76
- package/dist/web/context/anchored_context_compactor.js +0 -120
- package/dist/web/context/compaction_utils.js +0 -42
- package/dist/web/context/summarizers/base_summarizer.js +0 -7
- package/dist/web/context/summarizers/llm_summarizer.js +0 -91
- package/dist/web/context/token_based_context_compactor.js +0 -118
- package/dist/web/context/trajectory_thought_pruning_compactor.js +0 -47
- package/dist/web/context/truncating_context_compactor.js +0 -34
- package/dist/web/environment/base_environment.js +0 -71
- package/dist/web/environment/local_environment.js +0 -165
- package/dist/web/events/compacted_event.js +0 -51
- package/dist/web/events/event.js +0 -208
- package/dist/web/events/event_actions.js +0 -74
- package/dist/web/events/structured_events.js +0 -79
- package/dist/web/examples/base_example_provider.js +0 -32
- package/dist/web/examples/example.js +0 -7
- package/dist/web/examples/example_util.js +0 -83
- package/dist/web/features/feature_registry.js +0 -115
- package/dist/web/index.js +0 -57
- package/dist/web/integrations/agent_registry/agent_registry.js +0 -337
- package/dist/web/integrations/agent_registry/agent_registry_mcp_toolset.js +0 -120
- package/dist/web/integrations/agent_registry/helpers.js +0 -32
- package/dist/web/integrations/agent_registry/types.js +0 -20
- package/dist/web/memory/base_memory_service.js +0 -7
- package/dist/web/memory/in_memory_memory_service.js +0 -89
- package/dist/web/memory/memory_entry.js +0 -7
- package/dist/web/memory/vertex_ai_memory_bank_service.js +0 -496
- package/dist/web/models/apigee_llm.js +0 -227
- package/dist/web/models/base_llm.js +0 -78
- package/dist/web/models/base_llm_connection.js +0 -7
- package/dist/web/models/gemini_llm_connection.js +0 -183
- package/dist/web/models/google_llm.js +0 -396
- package/dist/web/models/interactions_utils.js +0 -745
- package/dist/web/models/llm_request.js +0 -57
- package/dist/web/models/llm_response.js +0 -48
- package/dist/web/models/registry.js +0 -100
- package/dist/web/models/routed_llm.js +0 -112
- package/dist/web/plugins/base_plugin.js +0 -305
- package/dist/web/plugins/global_instruction_plugin.js +0 -71
- package/dist/web/plugins/logging_plugin.js +0 -241
- package/dist/web/plugins/plugin_manager.js +0 -318
- package/dist/web/plugins/security_plugin.js +0 -148
- package/dist/web/runner/in_memory_runner.js +0 -50
- package/dist/web/runner/runner.js +0 -747
- package/dist/web/sessions/base_session_service.js +0 -123
- package/dist/web/sessions/database_session_service.js +0 -440
- package/dist/web/sessions/db/operations.js +0 -124
- package/dist/web/sessions/db/schema.js +0 -216
- package/dist/web/sessions/in_memory_session_service.js +0 -251
- package/dist/web/sessions/registry.js +0 -38
- package/dist/web/sessions/session.js +0 -23
- package/dist/web/sessions/state.js +0 -159
- package/dist/web/sessions/state_write_order.js +0 -74
- package/dist/web/sessions/vertex_ai_session_service.js +0 -546
- package/dist/web/skills/gcp_skill_registry.js +0 -80
- package/dist/web/skills/loader.js +0 -372
- package/dist/web/skills/prompt.js +0 -34
- package/dist/web/skills/skill.js +0 -67
- package/dist/web/skills/skill_registry.js +0 -7
- package/dist/web/telemetry/google_cloud.js +0 -99
- package/dist/web/telemetry/setup.js +0 -89
- package/dist/web/telemetry/tracing.js +0 -304
- package/dist/web/tools/agent_tool.js +0 -150
- package/dist/web/tools/base_tool.js +0 -116
- package/dist/web/tools/base_toolset.js +0 -62
- package/dist/web/tools/consolidate_context_tool.js +0 -55
- package/dist/web/tools/enterprise_web_search_tool.js +0 -60
- package/dist/web/tools/example_tool.js +0 -46
- package/dist/web/tools/exit_loop_tool.js +0 -47
- package/dist/web/tools/finish_task_tool.js +0 -92
- package/dist/web/tools/forwarding_artifact_service.js +0 -51
- package/dist/web/tools/function_tool.js +0 -151
- package/dist/web/tools/get_user_choice_tool.js +0 -27
- package/dist/web/tools/google_maps_grounding_tool.js +0 -59
- package/dist/web/tools/google_search_tool.js +0 -55
- package/dist/web/tools/load_artifacts_tool.js +0 -159
- package/dist/web/tools/load_memory_tool.js +0 -83
- package/dist/web/tools/long_running_tool.js +0 -58
- package/dist/web/tools/mcp/index.js +0 -11
- package/dist/web/tools/mcp/load_mcp_resource_tool.js +0 -111
- package/dist/web/tools/mcp/mcp_session_manager.js +0 -114
- package/dist/web/tools/mcp/mcp_tool.js +0 -47
- package/dist/web/tools/mcp/mcp_toolset.js +0 -144
- package/dist/web/tools/openapi_tool/auth/auth_helpers.js +0 -53
- package/dist/web/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.js +0 -62
- package/dist/web/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.js +0 -113
- package/dist/web/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +0 -242
- package/dist/web/tools/openapi_tool/openapi_spec_parser/operation_parser.js +0 -200
- package/dist/web/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +0 -98
- package/dist/web/tools/openapi_tool/openapi_toolset.js +0 -99
- package/dist/web/tools/openapi_tool/rest_api_tool.js +0 -247
- package/dist/web/tools/preload_memory_tool.js +0 -81
- package/dist/web/tools/request_input_tool.js +0 -29
- package/dist/web/tools/skill/list_skills_tool.js +0 -52
- package/dist/web/tools/skill/load_skill_resource_tool.js +0 -192
- package/dist/web/tools/skill/load_skill_tool.js +0 -96
- package/dist/web/tools/skill/run_skill_inline_script_tool.js +0 -191
- package/dist/web/tools/skill/run_skill_script_tool.js +0 -227
- package/dist/web/tools/skill/search_skills_tool.js +0 -84
- package/dist/web/tools/skill/skill_toolset.js +0 -185
- package/dist/web/tools/tool_confirmation.js +0 -43
- package/dist/web/tools/url_context_tool.js +0 -48
- package/dist/web/tools/vertex_ai_search_tool.js +0 -107
- package/dist/web/tools/vertex_rag_retrieval_tool.js +0 -40
- package/dist/web/utils/async_hooks_shim.js +0 -28
- package/dist/web/utils/async_queue.js +0 -88
- package/dist/web/utils/branch_trie.js +0 -16
- package/dist/web/utils/case_utils.js +0 -28
- package/dist/web/utils/client_labels.js +0 -70
- package/dist/web/utils/deprecated.js +0 -40
- package/dist/web/utils/env_aware_utils.js +0 -115
- package/dist/web/utils/error_utils.js +0 -101
- package/dist/web/utils/experimental.js +0 -54
- package/dist/web/utils/failover_utils.js +0 -100
- package/dist/web/utils/file_extension_utils.js +0 -55
- package/dist/web/utils/file_utils.js +0 -108
- package/dist/web/utils/gemini_schema_util.js +0 -177
- package/dist/web/utils/genai_schema_to_json.js +0 -80
- package/dist/web/utils/live_connection_utils.js +0 -257
- package/dist/web/utils/logger.js +0 -140
- package/dist/web/utils/model_name.js +0 -75
- package/dist/web/utils/object_notation_utils.js +0 -54
- package/dist/web/utils/optional_peer.js +0 -38
- package/dist/web/utils/output_schema_utils.js +0 -18
- package/dist/web/utils/partial_copy.js +0 -26
- package/dist/web/utils/redact_uri.js +0 -39
- package/dist/web/utils/schema.js +0 -167
- package/dist/web/utils/simple_zod_to_json.js +0 -134
- package/dist/web/utils/streaming_utils.js +0 -438
- package/dist/web/utils/task.js +0 -38
- package/dist/web/utils/variant_utils.js +0 -23
- package/dist/web/utils/vertex_ai_utils.js +0 -27
- package/dist/web/workflow/base_node.js +0 -215
- package/dist/web/workflow/branch_path.js +0 -77
- package/dist/web/workflow/dynamic_node_scheduler.js +0 -202
- package/dist/web/workflow/errors.js +0 -140
- package/dist/web/workflow/graph.js +0 -127
- package/dist/web/workflow/index.js +0 -80
- package/dist/web/workflow/node.js +0 -87
- package/dist/web/workflow/node_builders.js +0 -40
- package/dist/web/workflow/node_context.js +0 -236
- package/dist/web/workflow/node_error_event.js +0 -86
- package/dist/web/workflow/node_runner.js +0 -481
- package/dist/web/workflow/node_state.js +0 -43
- package/dist/web/workflow/node_status.js +0 -20
- package/dist/web/workflow/nodes/function_node.js +0 -221
- package/dist/web/workflow/nodes/join_node.js +0 -47
- package/dist/web/workflow/nodes/node_tool.js +0 -131
- package/dist/web/workflow/nodes/parallel_worker.js +0 -120
- package/dist/web/workflow/nodes/tool_node.js +0 -126
- package/dist/web/workflow/request_input.js +0 -36
- package/dist/web/workflow/retry_config.js +0 -43
- package/dist/web/workflow/run_llm_agent_as_node.js +0 -266
- package/dist/web/workflow/run_node_as_invocation.js +0 -170
- package/dist/web/workflow/schedule_dynamic_node.js +0 -26
- package/dist/web/workflow/trigger.js +0 -7
- package/dist/web/workflow/utils/graph_parser.js +0 -188
- package/dist/web/workflow/utils/graph_validation.js +0 -189
- package/dist/web/workflow/utils/hitl_utils.js +0 -239
- package/dist/web/workflow/utils/rehydration_utils.js +0 -342
- package/dist/web/workflow/utils/retry_utils.js +0 -82
- package/dist/web/workflow/utils/workflow_graph_utils.js +0 -115
- package/dist/web/workflow/workflow.js +0 -529
- /package/dist/{web/artifacts/session_artifact_service.js → esm/tools/resume_inputs.js} +0 -0
package/dist/web/index_web.js
CHANGED
|
@@ -1,8 +1,342 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var oz=Object.create;var Ms=Object.defineProperty;var fR=Object.getOwnPropertyDescriptor;var iz=Object.getOwnPropertyNames;var sz=Object.getPrototypeOf,az=Object.prototype.hasOwnProperty;var a=(t,e)=>Ms(t,"name",{value:e,configurable:!0});var Ju=(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)Ms(t,n,{get:e[n],enumerable:!0})},uz=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of iz(e))!az.call(t,r)&&r!==n&&Ms(t,r,{get:()=>e[r],enumerable:!(o=fR(e,r))||o.enumerable});return t};var lz=(t,e,n)=>(n=t!=null?oz(sz(t)):{},uz(e||!t||!t.__esModule?Ms(n,"default",{value:t,enumerable:!0}):n,t));var Pe=(t,e,n,o)=>{for(var r=o>1?void 0:o?fR(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&&Ms(e,n,r),r};var HP=Ju((xle,ZP)=>{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");ZP.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 JP=Ju(qr=>{var Z4=HP();qr.operation=function(t){var e=qr.timeouts(t);return new Z4(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};qr.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};qr.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};qr.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=qr.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 KP=Ju((Tle,WP)=>{WP.exports=JP()});var YP=Ju((Ile,Pl)=>{"use strict";var H4=KP(),J4=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"],fm=class fm 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(fm,"AbortError");var kl=fm,W4=a((t,e,n)=>{let o=n.retries-(e-1);return t.attemptNumber=e,t.retriesLeft=o,t},"decorateErrorWithCounts"),K4=a(t=>J4.includes(t),"isNetworkError"),jP=a((t,e)=>new Promise((n,o)=>{e={onFailedAttempt:a(()=>{},"onFailedAttempt"),retries:10,...e};let r=H4.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 kl)r.stop(),o(s.originalError);else if(s instanceof TypeError&&!K4(s.message))r.stop(),o(s);else{W4(s,i,e);try{await e.onFailedAttempt(s)}catch(u){o(u);return}r.retry(s)||o(r.mainError())}}})}),"pRetry");Pl.exports=jP;Pl.exports.default=jP;Pl.exports.AbortError=kl});var Ls=(r=>(r[r.DEBUG=0]="DEBUG",r[r.INFO=1]="INFO",r[r.WARN=2]="WARN",r[r.ERROR=3]="ERROR",r))(Ls||{}),Fp={0:"debug",1:"info",2:"warn",3:"error"},Gp=class Gp{constructor(){this.logLevel=1}setLogLevel(e){this.logLevel=e}log(e,...n){if(this.logLevel>e)return;let o=new Date().toISOString(),r=`${Ls[e]}: [ADK] ${o} ${n.join(" ")}`;console[Fp[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(Gp,"SimpleLogger");var Wu=Gp,Bp=class Bp{setLogLevel(e){}log(e,...n){}debug(...e){}info(...e){}warn(...e){}error(...e){}};a(Bp,"NoOpLogger");var Up=Bp,kn=new Wu;function zp(t){kn=t!=null?t:new Up}a(zp,"setLogger");function cz(){return kn}a(cz,"getLogger");function dz(){kn=new Wu}a(dz,"resetLogger");function fz(t){w.setLogLevel(t)}a(fz,"setLogLevel");var w={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 pz={0:"blue",1:"green",2:"orange",3:"red"},Vp=class Vp{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[Fp[e]](`%c${Ls[e]}%c${r}`,`color: ${pz[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(Vp,"BrowserLogger");var qp=Vp;function pR(){zp(new qp)}a(pR,"installBrowserLogger");var Zp=class Zp{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(Zp,"Task");var Us=Zp;var Jp=class Jp{constructor(e={}){e.task instanceof Promise?this.task=new Us(()=>e.task):this.task=e.task,this.stream=e.stream}};a(Jp,"ActiveStreamingTool");var Hp=Jp;var mR=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{};var Pn="1.9.0";var gR=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function mz(t){var e=new Set([t]),n=new Set,o=t.match(gR);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(gR);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(mz,"_makeCompatibilityCheck");var hR=mz(Pn);var gz=Pn.split(".")[0],Fs=Symbol.for("opentelemetry.js.api."+gz),zs=mR;function No(t,e,n,o){var r;o===void 0&&(o=!1);var i=zs[Fs]=(r=zs[Fs])!==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(No,"registerGlobal");function Nn(t){var e,n,o=(e=zs[Fs])===null||e===void 0?void 0:e.version;if(!(!o||!hR(o)))return(n=zs[Fs])===null||n===void 0?void 0:n[t]}a(Nn,"getGlobal");function $o(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+Pn+".");var n=zs[Fs];n&&delete n[t]}a($o,"unregisterGlobal");var hz=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},yz=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))},yR=(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 Gs("debug",this._namespace,e)},t.prototype.error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Gs("error",this._namespace,e)},t.prototype.info=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Gs("info",this._namespace,e)},t.prototype.warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Gs("warn",this._namespace,e)},t.prototype.verbose=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Gs("verbose",this._namespace,e)},t})();function Gs(t,e,n){var o=Nn("diag");if(o)return n.unshift(e),o[t].apply(o,yz([],hz(n),!1))}a(Gs,"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 vR(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(vR,"createLogLevelDiagLogger");var vz=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},_z=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))},xz="diag",Do=(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,_z([],vz(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=vR((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 No("diag",d,n,!0)},"setLogger");n.setLogger=o,n.disable=function(){$o(xz,n)},n.createComponentLogger=function(r){return new yR(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 _R(t){return Symbol.for(t)}a(_R,"createContextKey");var Ez=(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})(),xR=new Ez;var Sz=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},Cz=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))},ER=(function(){function t(){}return a(t,"NoopContextManager"),t.prototype.active=function(){return xR},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,Cz([o],Sz(r),!1))},t.prototype.bind=function(e,n){return n},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t})();var Tz=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},Iz=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))},Wp="context",Az=new ER,Oo=(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 No(Wp,e,Do.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,Iz([e,n,o],Tz(i),!1))},t.prototype.bind=function(e,n){return this._getContextManager().bind(e,n)},t.prototype._getContextManager=function(){return Nn(Wp)||Az},t.prototype.disable=function(){this._getContextManager().disable(),$o(Wp,Do.instance())},t})();var Ku;(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(Ku||(Ku={}));var Kp="0000000000000000",jp="00000000000000000000000000000000",SR={traceId:jp,spanId:Kp,traceFlags:Ku.NONE};var nr=(function(){function t(e){e===void 0&&(e=SR),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 Yp=_R("OpenTelemetry Context Key SPAN");function ju(t){return t.getValue(Yp)||void 0}a(ju,"getSpan");function CR(){return ju(Oo.getInstance().active())}a(CR,"getActiveSpan");function Bs(t,e){return t.setValue(Yp,e)}a(Bs,"setSpan");function TR(t){return t.deleteValue(Yp)}a(TR,"deleteSpan");function IR(t,e){return Bs(t,new nr(e))}a(IR,"setSpanContext");function Yu(t){var e;return(e=ju(t))===null||e===void 0?void 0:e.spanContext()}a(Yu,"getSpanContext");var bz=/^([0-9a-f]{32})$/i,wz=/^[0-9a-f]{16}$/i;function Rz(t){return bz.test(t)&&t!==jp}a(Rz,"isValidTraceId");function kz(t){return wz.test(t)&&t!==Kp}a(kz,"isValidSpanId");function Xu(t){return Rz(t.traceId)&&kz(t.spanId)}a(Xu,"isSpanContextValid");function AR(t){return new nr(t)}a(AR,"wrapSpanContext");var Xp=Oo.getInstance(),Qu=(function(){function t(){}return a(t,"NoopTracer"),t.prototype.startSpan=function(e,n,o){o===void 0&&(o=Xp.active());var r=!!(n!=null&&n.root);if(r)return new nr;var i=o&&Yu(o);return Pz(i)&&Xu(i)?new nr(i):new nr},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:Xp.active(),l=this.startSpan(e,i,c),p=Bs(c,l);return Xp.with(p,u,void 0,l)}},t})();function Pz(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}a(Pz,"isSpanContext");var Nz=new Qu,bR=(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):Nz},t})();var wR=(function(){function t(){}return a(t,"NoopTracerProvider"),t.prototype.getTracer=function(e,n,o){return new Qu},t})();var $z=new wR,Qp=(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 bR(this,e,n,o)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:$z},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 Mo;(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(Mo||(Mo={}));var Fe=Oo.getInstance();var em="trace",RR=(function(){function t(){this._proxyTracerProvider=new Qp,this.wrapSpanContext=AR,this.isSpanContextValid=Xu,this.deleteSpan=TR,this.getSpan=ju,this.getActiveSpan=CR,this.getSpanContext=Yu,this.setSpan=Bs,this.setSpanContext=IR}return a(t,"TraceAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var n=No(em,this._proxyTracerProvider,Do.instance());return n&&this._proxyTracerProvider.setDelegate(e),n},t.prototype.getTracerProvider=function(){return Nn(em)||this._proxyTracerProvider},t.prototype.getTracer=function(e,n){return this.getTracerProvider().getTracer(e,n)},t.prototype.disable=function(){$o(em,Do.instance()),this._proxyTracerProvider=new Qp},t})();var Oe=RR.getInstance();function kR(){throw new Error("randomUUID: no cryptographically secure source of randomness is available. Neither crypto.randomUUID() nor crypto.getRandomValues() is present in this environment.")}a(kR,"randomUUID");function PR(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(PR,"createHash");function NR(t){throw new Error("randomBytes: no cryptographically secure source of randomness is available in this environment.")}a(NR,"randomBytes");var qs="GOOGLE_GENAI_USE_ENTERPRISE",Vs="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 kR()}a(fn,"randomUUID");function OR(t){return jt()?window.atob(t):Buffer.from(t,"base64").toString()}a(OR,"base64Decode");function Gr(t){if(!process.env)return!1;let e=(process.env[t]||"").toLowerCase();return["true","1"].includes(e)}a(Gr,"getBooleanEnvVar");var $R=!1;function DR(t){$R||($R=!0,w.warn(t))}a(DR,"warnDeprecatedEnterpriseModeEnvVar");function el(){var e,n;let t=((e=process.env)==null?void 0:e[Vs])!==void 0;return((n=process.env)==null?void 0:n[qs])!==void 0?(t&&DR(`${Vs} is set but ignored because ${qs} takes precedence. ${Vs} is deprecated, please use ${qs} instead.`),Gr(qs)):t?(DR(`${Vs} is deprecated, please use ${qs} instead`),Gr(Vs)):!1}a(el,"isEnterpriseModeEnabled");var Dz=typeof global=="object"&&global&&global.Object===Object&&global,tl=Dz;var Oz=typeof self=="object"&&self&&self.Object===Object&&self,Mz=tl||Oz||Function("return this")(),Me=Mz;var Lz=Me.Symbol,Ut=Lz;var MR=Object.prototype,Uz=MR.hasOwnProperty,Fz=MR.toString,Zs=Ut?Ut.toStringTag:void 0;function zz(t){var e=Uz.call(t,Zs),n=t[Zs];try{t[Zs]=void 0;var o=!0}catch(i){}var r=Fz.call(t);return o&&(e?t[Zs]=n:delete t[Zs]),r}a(zz,"getRawTag");var LR=zz;var Gz=Object.prototype,Bz=Gz.toString;function qz(t){return Bz.call(t)}a(qz,"objectToString");var UR=qz;var Vz="[object Null]",Zz="[object Undefined]",FR=Ut?Ut.toStringTag:void 0;function Hz(t){return t==null?t===void 0?Zz:Vz:FR&&FR in Object(t)?LR(t):UR(t)}a(Hz,"baseGetTag");var $n=Hz;function Jz(t){return t!=null&&typeof t=="object"}a(Jz,"isObjectLike");var bt=Jz;var Wz=Array.isArray,Yt=Wz;function Kz(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}a(Kz,"isObject");var pn=Kz;var jz="[object AsyncFunction]",Yz="[object Function]",Xz="[object GeneratorFunction]",Qz="[object Proxy]";function eG(t){if(!pn(t))return!1;var e=$n(t);return e==Yz||e==Xz||e==jz||e==Qz}a(eG,"isFunction");var nl=eG;var tG=Me["__core-js_shared__"],rl=tG;var zR=(function(){var t=/[^.]+$/.exec(rl&&rl.keys&&rl.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function nG(t){return!!zR&&zR in t}a(nG,"isMasked");var GR=nG;var rG=Function.prototype,oG=rG.toString;function iG(t){if(t!=null){try{return oG.call(t)}catch(e){}try{return t+""}catch(e){}}return""}a(iG,"toSource");var Dn=iG;var sG=/[\\^$.*+?()[\]{}|]/g,aG=/^\[object .+?Constructor\]$/,uG=Function.prototype,lG=Object.prototype,cG=uG.toString,dG=lG.hasOwnProperty,fG=RegExp("^"+cG.call(dG).replace(sG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function pG(t){if(!pn(t)||GR(t))return!1;var e=nl(t)?fG:aG;return e.test(Dn(t))}a(pG,"baseIsNative");var BR=pG;function mG(t,e){return t==null?void 0:t[e]}a(mG,"getValue");var qR=mG;function gG(t,e){var n=qR(t,e);return BR(n)?n:void 0}a(gG,"getNative");var ht=gG;var hG=ht(Me,"WeakMap"),ol=hG;var VR=Object.create,yG=(function(){function t(){}return a(t,"object"),function(e){if(!pn(e))return{};if(VR)return VR(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})(),ZR=yG;function vG(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}a(vG,"copyArray");var HR=vG;var _G=(function(){try{var t=ht(Object,"defineProperty");return t({},"",{}),t}catch(e){}})(),tm=_G;function xG(t,e){for(var n=-1,o=t==null?0:t.length;++n<o&&e(t[n],n,t)!==!1;);return t}a(xG,"arrayEach");var JR=xG;var EG=9007199254740991,SG=/^(?:0|[1-9]\d*)$/;function CG(t,e){var n=typeof t;return e=e==null?EG:e,!!e&&(n=="number"||n!="symbol"&&SG.test(t))&&t>-1&&t%1==0&&t<e}a(CG,"isIndex");var WR=CG;function TG(t,e,n){e=="__proto__"&&tm?tm(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}a(TG,"baseAssignValue");var il=TG;function IG(t,e){return t===e||t!==t&&e!==e}a(IG,"eq");var Lo=IG;var AG=Object.prototype,bG=AG.hasOwnProperty;function wG(t,e,n){var o=t[e];(!(bG.call(t,e)&&Lo(o,n))||n===void 0&&!(e in t))&&il(t,e,n)}a(wG,"assignValue");var sl=wG;function RG(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?il(n,u,c):sl(n,u,c)}return n}a(RG,"copyObject");var rr=RG;var kG=9007199254740991;function PG(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=kG}a(PG,"isLength");var al=PG;function NG(t){return t!=null&&al(t.length)&&!nl(t)}a(NG,"isArrayLike");var Uo=NG;var $G=Object.prototype;function DG(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||$G;return t===n}a(DG,"isPrototype");var or=DG;function OG(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o}a(OG,"baseTimes");var KR=OG;var MG="[object Arguments]";function LG(t){return bt(t)&&$n(t)==MG}a(LG,"baseIsArguments");var nm=LG;var jR=Object.prototype,UG=jR.hasOwnProperty,FG=jR.propertyIsEnumerable,zG=nm((function(){return arguments})())?nm:function(t){return bt(t)&&UG.call(t,"callee")&&!FG.call(t,"callee")},ul=zG;function GG(){return!1}a(GG,"stubFalse");var YR=GG;var ek=typeof exports=="object"&&exports&&!exports.nodeType&&exports,XR=ek&&typeof module=="object"&&module&&!module.nodeType&&module,BG=XR&&XR.exports===ek,QR=BG?Me.Buffer:void 0,qG=QR?QR.isBuffer:void 0,VG=qG||YR,On=VG;var ZG="[object Arguments]",HG="[object Array]",JG="[object Boolean]",WG="[object Date]",KG="[object Error]",jG="[object Function]",YG="[object Map]",XG="[object Number]",QG="[object Object]",eB="[object RegExp]",tB="[object Set]",nB="[object String]",rB="[object WeakMap]",oB="[object ArrayBuffer]",iB="[object DataView]",sB="[object Float32Array]",aB="[object Float64Array]",uB="[object Int8Array]",lB="[object Int16Array]",cB="[object Int32Array]",dB="[object Uint8Array]",fB="[object Uint8ClampedArray]",pB="[object Uint16Array]",mB="[object Uint32Array]",Te={};Te[sB]=Te[aB]=Te[uB]=Te[lB]=Te[cB]=Te[dB]=Te[fB]=Te[pB]=Te[mB]=!0;Te[ZG]=Te[HG]=Te[oB]=Te[JG]=Te[iB]=Te[WG]=Te[KG]=Te[jG]=Te[YG]=Te[XG]=Te[QG]=Te[eB]=Te[tB]=Te[nB]=Te[rB]=!1;function gB(t){return bt(t)&&al(t.length)&&!!Te[$n(t)]}a(gB,"baseIsTypedArray");var tk=gB;function hB(t){return function(e){return t(e)}}a(hB,"baseUnary");var Fo=hB;var nk=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Hs=nk&&typeof module=="object"&&module&&!module.nodeType&&module,yB=Hs&&Hs.exports===nk,rm=yB&&tl.process,vB=(function(){try{var t=Hs&&Hs.require&&Hs.require("util").types;return t||rm&&rm.binding&&rm.binding("util")}catch(e){}})(),Mn=vB;var rk=Mn&&Mn.isTypedArray,_B=rk?Fo(rk):tk,zo=_B;var xB=Object.prototype,EB=xB.hasOwnProperty;function SB(t,e){var n=Yt(t),o=!n&&ul(t),r=!n&&!o&&On(t),i=!n&&!o&&!r&&zo(t),s=n||o||r||i,u=s?KR(t.length,String):[],c=u.length;for(var l in t)(e||EB.call(t,l))&&!(s&&(l=="length"||r&&(l=="offset"||l=="parent")||i&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||WR(l,c)))&&u.push(l);return u}a(SB,"arrayLikeKeys");var ll=SB;function CB(t,e){return function(n){return t(e(n))}}a(CB,"overArg");var cl=CB;var TB=cl(Object.keys,Object),ok=TB;var IB=Object.prototype,AB=IB.hasOwnProperty;function bB(t){if(!or(t))return ok(t);var e=[];for(var n in Object(t))AB.call(t,n)&&n!="constructor"&&e.push(n);return e}a(bB,"baseKeys");var dl=bB;function wB(t){return Uo(t)?ll(t):dl(t)}a(wB,"keys");var Go=wB;function RB(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}a(RB,"nativeKeysIn");var ik=RB;var kB=Object.prototype,PB=kB.hasOwnProperty;function NB(t){if(!pn(t))return ik(t);var e=or(t),n=[];for(var o in t)o=="constructor"&&(e||!PB.call(t,o))||n.push(o);return n}a(NB,"baseKeysIn");var sk=NB;function $B(t){return Uo(t)?ll(t,!0):sk(t)}a($B,"keysIn");var Bo=$B;var DB=ht(Object,"create"),Ln=DB;function OB(){this.__data__=Ln?Ln(null):{},this.size=0}a(OB,"hashClear");var ak=OB;function MB(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}a(MB,"hashDelete");var uk=MB;var LB="__lodash_hash_undefined__",UB=Object.prototype,FB=UB.hasOwnProperty;function zB(t){var e=this.__data__;if(Ln){var n=e[t];return n===LB?void 0:n}return FB.call(e,t)?e[t]:void 0}a(zB,"hashGet");var lk=zB;var GB=Object.prototype,BB=GB.hasOwnProperty;function qB(t){var e=this.__data__;return Ln?e[t]!==void 0:BB.call(e,t)}a(qB,"hashHas");var ck=qB;var VB="__lodash_hash_undefined__";function ZB(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ln&&e===void 0?VB:e,this}a(ZB,"hashSet");var dk=ZB;function qo(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(qo,"Hash");qo.prototype.clear=ak;qo.prototype.delete=uk;qo.prototype.get=lk;qo.prototype.has=ck;qo.prototype.set=dk;var om=qo;function HB(){this.__data__=[],this.size=0}a(HB,"listCacheClear");var fk=HB;function JB(t,e){for(var n=t.length;n--;)if(Lo(t[n][0],e))return n;return-1}a(JB,"assocIndexOf");var ir=JB;var WB=Array.prototype,KB=WB.splice;function jB(t){var e=this.__data__,n=ir(e,t);if(n<0)return!1;var o=e.length-1;return n==o?e.pop():KB.call(e,n,1),--this.size,!0}a(jB,"listCacheDelete");var pk=jB;function YB(t){var e=this.__data__,n=ir(e,t);return n<0?void 0:e[n][1]}a(YB,"listCacheGet");var mk=YB;function XB(t){return ir(this.__data__,t)>-1}a(XB,"listCacheHas");var gk=XB;function QB(t,e){var n=this.__data__,o=ir(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}a(QB,"listCacheSet");var hk=QB;function Vo(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(Vo,"ListCache");Vo.prototype.clear=fk;Vo.prototype.delete=pk;Vo.prototype.get=mk;Vo.prototype.has=gk;Vo.prototype.set=hk;var sr=Vo;var eq=ht(Me,"Map"),ar=eq;function tq(){this.size=0,this.__data__={hash:new om,map:new(ar||sr),string:new om}}a(tq,"mapCacheClear");var yk=tq;function nq(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}a(nq,"isKeyable");var vk=nq;function rq(t,e){var n=t.__data__;return vk(e)?n[typeof e=="string"?"string":"hash"]:n.map}a(rq,"getMapData");var ur=rq;function oq(t){var e=ur(this,t).delete(t);return this.size-=e?1:0,e}a(oq,"mapCacheDelete");var _k=oq;function iq(t){return ur(this,t).get(t)}a(iq,"mapCacheGet");var xk=iq;function sq(t){return ur(this,t).has(t)}a(sq,"mapCacheHas");var Ek=sq;function aq(t,e){var n=ur(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this}a(aq,"mapCacheSet");var Sk=aq;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,"MapCache");Zo.prototype.clear=yk;Zo.prototype.delete=_k;Zo.prototype.get=xk;Zo.prototype.has=Ek;Zo.prototype.set=Sk;var fl=Zo;function uq(t,e){for(var n=-1,o=e.length,r=t.length;++n<o;)t[r+n]=e[n];return t}a(uq,"arrayPush");var pl=uq;var lq=cl(Object.getPrototypeOf,Object),ml=lq;function cq(){this.__data__=new sr,this.size=0}a(cq,"stackClear");var Ck=cq;function dq(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}a(dq,"stackDelete");var Tk=dq;function fq(t){return this.__data__.get(t)}a(fq,"stackGet");var Ik=fq;function pq(t){return this.__data__.has(t)}a(pq,"stackHas");var Ak=pq;var mq=200;function gq(t,e){var n=this.__data__;if(n instanceof sr){var o=n.__data__;if(!ar||o.length<mq-1)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new fl(o)}return n.set(t,e),this.size=n.size,this}a(gq,"stackSet");var bk=gq;function Ho(t){var e=this.__data__=new sr(t);this.size=e.size}a(Ho,"Stack");Ho.prototype.clear=Ck;Ho.prototype.delete=Tk;Ho.prototype.get=Ik;Ho.prototype.has=Ak;Ho.prototype.set=bk;var Jo=Ho;function hq(t,e){return t&&rr(e,Go(e),t)}a(hq,"baseAssign");var wk=hq;function yq(t,e){return t&&rr(e,Bo(e),t)}a(yq,"baseAssignIn");var Rk=yq;var $k=typeof exports=="object"&&exports&&!exports.nodeType&&exports,kk=$k&&typeof module=="object"&&module&&!module.nodeType&&module,vq=kk&&kk.exports===$k,Pk=vq?Me.Buffer:void 0,Nk=Pk?Pk.allocUnsafe:void 0;function _q(t,e){if(e)return t.slice();var n=t.length,o=Nk?Nk(n):new t.constructor(n);return t.copy(o),o}a(_q,"cloneBuffer");var Dk=_q;function xq(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(xq,"arrayFilter");var Ok=xq;function Eq(){return[]}a(Eq,"stubArray");var gl=Eq;var Sq=Object.prototype,Cq=Sq.propertyIsEnumerable,Mk=Object.getOwnPropertySymbols,Tq=Mk?function(t){return t==null?[]:(t=Object(t),Ok(Mk(t),function(e){return Cq.call(t,e)}))}:gl,Wo=Tq;function Iq(t,e){return rr(t,Wo(t),e)}a(Iq,"copySymbols");var Lk=Iq;var Aq=Object.getOwnPropertySymbols,bq=Aq?function(t){for(var e=[];t;)pl(e,Wo(t)),t=ml(t);return e}:gl,hl=bq;function wq(t,e){return rr(t,hl(t),e)}a(wq,"copySymbolsIn");var Uk=wq;function Rq(t,e,n){var o=e(t);return Yt(t)?o:pl(o,n(t))}a(Rq,"baseGetAllKeys");var yl=Rq;function kq(t){return yl(t,Go,Wo)}a(kq,"getAllKeys");var Js=kq;function Pq(t){return yl(t,Bo,hl)}a(Pq,"getAllKeysIn");var Fk=Pq;var Nq=ht(Me,"DataView"),vl=Nq;var $q=ht(Me,"Promise"),_l=$q;var Dq=ht(Me,"Set"),xl=Dq;var zk="[object Map]",Oq="[object Object]",Gk="[object Promise]",Bk="[object Set]",qk="[object WeakMap]",Vk="[object DataView]",Mq=Dn(vl),Lq=Dn(ar),Uq=Dn(_l),Fq=Dn(xl),zq=Dn(ol),Br=$n;(vl&&Br(new vl(new ArrayBuffer(1)))!=Vk||ar&&Br(new ar)!=zk||_l&&Br(_l.resolve())!=Gk||xl&&Br(new xl)!=Bk||ol&&Br(new ol)!=qk)&&(Br=a(function(t){var e=$n(t),n=e==Oq?t.constructor:void 0,o=n?Dn(n):"";if(o)switch(o){case Mq:return Vk;case Lq:return zk;case Uq:return Gk;case Fq:return Bk;case zq:return qk}return e},"getTag"));var Xt=Br;var Gq=Object.prototype,Bq=Gq.hasOwnProperty;function qq(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&Bq.call(t,"index")&&(n.index=t.index,n.input=t.input),n}a(qq,"initCloneArray");var Zk=qq;var Vq=Me.Uint8Array,Ko=Vq;function Zq(t){var e=new t.constructor(t.byteLength);return new Ko(e).set(new Ko(t)),e}a(Zq,"cloneArrayBuffer");var jo=Zq;function Hq(t,e){var n=e?jo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}a(Hq,"cloneDataView");var Hk=Hq;var Jq=/\w*$/;function Wq(t){var e=new t.constructor(t.source,Jq.exec(t));return e.lastIndex=t.lastIndex,e}a(Wq,"cloneRegExp");var Jk=Wq;var Wk=Ut?Ut.prototype:void 0,Kk=Wk?Wk.valueOf:void 0;function Kq(t){return Kk?Object(Kk.call(t)):{}}a(Kq,"cloneSymbol");var jk=Kq;function jq(t,e){var n=e?jo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}a(jq,"cloneTypedArray");var Yk=jq;var Yq="[object Boolean]",Xq="[object Date]",Qq="[object Map]",eV="[object Number]",tV="[object RegExp]",nV="[object Set]",rV="[object String]",oV="[object Symbol]",iV="[object ArrayBuffer]",sV="[object DataView]",aV="[object Float32Array]",uV="[object Float64Array]",lV="[object Int8Array]",cV="[object Int16Array]",dV="[object Int32Array]",fV="[object Uint8Array]",pV="[object Uint8ClampedArray]",mV="[object Uint16Array]",gV="[object Uint32Array]";function hV(t,e,n){var o=t.constructor;switch(e){case iV:return jo(t);case Yq:case Xq:return new o(+t);case sV:return Hk(t,n);case aV:case uV:case lV:case cV:case dV:case fV:case pV:case mV:case gV:return Yk(t,n);case Qq:return new o;case eV:case rV:return new o(t);case tV:return Jk(t);case nV:return new o;case oV:return jk(t)}}a(hV,"initCloneByTag");var Xk=hV;function yV(t){return typeof t.constructor=="function"&&!or(t)?ZR(ml(t)):{}}a(yV,"initCloneObject");var Qk=yV;var vV="[object Map]";function _V(t){return bt(t)&&Xt(t)==vV}a(_V,"baseIsMap");var eP=_V;var tP=Mn&&Mn.isMap,xV=tP?Fo(tP):eP,nP=xV;var EV="[object Set]";function SV(t){return bt(t)&&Xt(t)==EV}a(SV,"baseIsSet");var rP=SV;var oP=Mn&&Mn.isSet,CV=oP?Fo(oP):rP,iP=CV;var TV=1,IV=2,AV=4,sP="[object Arguments]",bV="[object Array]",wV="[object Boolean]",RV="[object Date]",kV="[object Error]",aP="[object Function]",PV="[object GeneratorFunction]",NV="[object Map]",$V="[object Number]",uP="[object Object]",DV="[object RegExp]",OV="[object Set]",MV="[object String]",LV="[object Symbol]",UV="[object WeakMap]",FV="[object ArrayBuffer]",zV="[object DataView]",GV="[object Float32Array]",BV="[object Float64Array]",qV="[object Int8Array]",VV="[object Int16Array]",ZV="[object Int32Array]",HV="[object Uint8Array]",JV="[object Uint8ClampedArray]",WV="[object Uint16Array]",KV="[object Uint32Array]",Ee={};Ee[sP]=Ee[bV]=Ee[FV]=Ee[zV]=Ee[wV]=Ee[RV]=Ee[GV]=Ee[BV]=Ee[qV]=Ee[VV]=Ee[ZV]=Ee[NV]=Ee[$V]=Ee[uP]=Ee[DV]=Ee[OV]=Ee[MV]=Ee[LV]=Ee[HV]=Ee[JV]=Ee[WV]=Ee[KV]=!0;Ee[kV]=Ee[aP]=Ee[UV]=!1;function El(t,e,n,o,r,i){var s,u=e&TV,c=e&IV,l=e&AV;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=Zk(t),!u)return HR(t,s)}else{var d=Xt(t),g=d==aP||d==PV;if(On(t))return Dk(t,u);if(d==uP||d==sP||g&&!r){if(s=c||g?{}:Qk(t),!u)return c?Uk(t,Rk(s,t)):Lk(t,wk(s,t))}else{if(!Ee[d])return r?t:{};s=Xk(t,d,u)}}i||(i=new Jo);var h=i.get(t);if(h)return h;i.set(t,s),iP(t)?t.forEach(function(_){s.add(El(_,e,n,_,t,i))}):nP(t)&&t.forEach(function(_,x){s.set(x,El(_,e,n,x,t,i))});var y=l?c?Fk:Js:c?Bo:Go,v=p?void 0:y(t);return JR(v||t,function(_,x){v&&(x=_,_=t[x]),sl(s,x,El(_,e,n,x,t,i))}),s}a(El,"baseClone");var lP=El;var jV=1,YV=4;function XV(t){return lP(t,jV|YV)}a(XV,"cloneDeep");var Ge=XV;var QV="__lodash_hash_undefined__";function e4(t){return this.__data__.set(t,QV),this}a(e4,"setCacheAdd");var cP=e4;function t4(t){return this.__data__.has(t)}a(t4,"setCacheHas");var dP=t4;function Sl(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new fl;++e<n;)this.add(t[e])}a(Sl,"SetCache");Sl.prototype.add=Sl.prototype.push=cP;Sl.prototype.has=dP;var fP=Sl;function n4(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(n4,"arraySome");var pP=n4;function r4(t,e){return t.has(e)}a(r4,"cacheHas");var mP=r4;var o4=1,i4=2;function s4(t,e,n,o,r,i){var s=n&o4,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&i4?new fP:void 0;for(i.set(t,e),i.set(e,t);++d<u;){var y=t[d],v=e[d];if(o)var _=s?o(v,y,d,e,t,i):o(y,v,d,t,e,i);if(_!==void 0){if(_)continue;g=!1;break}if(h){if(!pP(e,function(x,E){if(!mP(h,E)&&(y===x||r(y,x,n,o,i)))return h.push(E)})){g=!1;break}}else if(!(y===v||r(y,v,n,o,i))){g=!1;break}}return i.delete(t),i.delete(e),g}a(s4,"equalArrays");var Cl=s4;function a4(t){var e=-1,n=Array(t.size);return t.forEach(function(o,r){n[++e]=[r,o]}),n}a(a4,"mapToArray");var gP=a4;function u4(t){var e=-1,n=Array(t.size);return t.forEach(function(o){n[++e]=o}),n}a(u4,"setToArray");var hP=u4;var l4=1,c4=2,d4="[object Boolean]",f4="[object Date]",p4="[object Error]",m4="[object Map]",g4="[object Number]",h4="[object RegExp]",y4="[object Set]",v4="[object String]",_4="[object Symbol]",x4="[object ArrayBuffer]",E4="[object DataView]",yP=Ut?Ut.prototype:void 0,im=yP?yP.valueOf:void 0;function S4(t,e,n,o,r,i,s){switch(n){case E4:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case x4:return!(t.byteLength!=e.byteLength||!i(new Ko(t),new Ko(e)));case d4:case f4:case g4:return Lo(+t,+e);case p4:return t.name==e.name&&t.message==e.message;case h4:case v4:return t==e+"";case m4:var u=gP;case y4:var c=o&l4;if(u||(u=hP),t.size!=e.size&&!c)return!1;var l=s.get(t);if(l)return l==e;o|=c4,s.set(t,e);var p=Cl(u(t),u(e),o,r,i,s);return s.delete(t),p;case _4:if(im)return im.call(t)==im.call(e)}return!1}a(S4,"equalByTag");var vP=S4;var C4=1,T4=Object.prototype,I4=T4.hasOwnProperty;function A4(t,e,n,o,r,i){var s=n&C4,u=Js(t),c=u.length,l=Js(e),p=l.length;if(c!=p&&!s)return!1;for(var d=c;d--;){var g=u[d];if(!(s?g in e:I4.call(e,g)))return!1}var h=i.get(t),y=i.get(e);if(h&&y)return h==e&&y==t;var v=!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 C=s?o(E,x,g,e,t,i):o(x,E,g,t,e,i);if(!(C===void 0?x===E||r(x,E,n,o,i):C)){v=!1;break}_||(_=g=="constructor")}if(v&&!_){var S=t.constructor,T=e.constructor;S!=T&&"constructor"in t&&"constructor"in e&&!(typeof S=="function"&&S instanceof S&&typeof T=="function"&&T instanceof T)&&(v=!1)}return i.delete(t),i.delete(e),v}a(A4,"equalObjects");var _P=A4;var b4=1,xP="[object Arguments]",EP="[object Array]",Tl="[object Object]",w4=Object.prototype,SP=w4.hasOwnProperty;function R4(t,e,n,o,r,i){var s=Yt(t),u=Yt(e),c=s?EP:Xt(t),l=u?EP:Xt(e);c=c==xP?Tl:c,l=l==xP?Tl:l;var p=c==Tl,d=l==Tl,g=c==l;if(g&&On(t)){if(!On(e))return!1;s=!0,p=!1}if(g&&!p)return i||(i=new Jo),s||zo(t)?Cl(t,e,n,o,r,i):vP(t,e,c,n,o,r,i);if(!(n&b4)){var h=p&&SP.call(t,"__wrapped__"),y=d&&SP.call(e,"__wrapped__");if(h||y){var v=h?t.value():t,_=y?e.value():e;return i||(i=new Jo),r(v,_,n,o,i)}}return g?(i||(i=new Jo),_P(t,e,n,o,r,i)):!1}a(R4,"baseIsEqualDeep");var CP=R4;function TP(t,e,n,o,r){return t===e?!0:t==null||e==null||!bt(t)&&!bt(e)?t!==t&&e!==e:CP(t,e,n,o,TP,r)}a(TP,"baseIsEqual");var IP=TP;var k4="[object Map]",P4="[object Set]",N4=Object.prototype,$4=N4.hasOwnProperty;function D4(t){if(t==null)return!0;if(Uo(t)&&(Yt(t)||typeof t=="string"||typeof t.splice=="function"||On(t)||zo(t)||ul(t)))return!t.length;var e=Xt(t);if(e==k4||e==P4)return!t.size;if(or(t))return!dl(t).length;for(var n in t)if($4.call(t,n))return!1;return!0}a(D4,"isEmpty");var rt=D4;function O4(t,e){return IP(t,e)}a(O4,"isEqual");var sm=O4;var AP=0,am=new WeakMap,Yo=new WeakMap;function Ws(t,e){let n=t.get(e);return n||(n=new Map,t.set(e,n)),n}a(Ws,"stampsFor");function um(t,e,n){let o=++AP;Ws(am,t).set(n,o),e&&e!==t&&Ws(Yo,e).set(n,o)}a(um,"recordStateWrite");function bP(t,e,n){var i,s;let o=(i=Yo.get(e))==null?void 0:i.get(n),r=(s=am.get(t))==null?void 0:s.get(n);return o!==void 0&&r!==void 0&&r>o?!1:(Ws(am,t).set(n,o!=null?o:++AP),!0)}a(bP,"shouldApplyDeltaWrite");function wP(t,e,n){var r;let o=(r=Yo.get(t))==null?void 0:r.get(n);o!==void 0&&Ws(Yo,e).set(n,o)}a(wP,"carryDeltaStamp");function Il(t,e){let n=Yo.get(t);if(!n)return;let o=Ws(Yo,e);for(let[r,i]of n)o.set(r,i)}a(Il,"carryDeltaStamps");function Ft(t={}){return{stateDelta:{},artifactDelta:{},requestedAuthConfigs:{},requestedToolConfirmations:{},...t}}a(Ft,"createEventActions");function Al(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(Al,"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),Il(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 lm=Symbol.for("google.adk.event");function W(t={}){return{...t,[lm]:!0,id:t.id||dm(),invocationId:t.invocationId||"",author:t.author,actions:Ft(t.actions),longRunningToolIds:t.longRunningToolIds||[],branch:t.branch,timestamp:t.timestamp||Date.now()}}a(W,"createEvent");function lr(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&&ce(t).length===0&&!t.partial&&!PP(t)}a(lr,"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 Ks="adk-";function wt(){return`${Ks}${fn()}`}a(wt,"generateClientFunctionCallId");function js(t){for(let e of le(t))e.id||(e.id=wt())}a(js,"populateClientFunctionCallId");function ce(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(ce,"getFunctionResponses");function PP(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(PP,"hasTrailingCodeExecutionResult");function bl(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(bl,"stringifyContent");function NP(t){var n;if(((n=t.usageMetadata)==null?void 0:n.promptTokenCount)!==void 0)return t.usageMetadata.promptTokenCount;let e=bl(t);return Math.ceil(e.length/4)}a(NP,"getEventTokens");function wl(t){var e,n;return!!((n=(e=t.content)==null?void 0:e.parts)!=null&&n.some(o=>o.thought===!0))}a(wl,"hasThoughts");function cm(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(cm,"pruneThoughts");var kP="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function Rl(t){return typeof t=="object"&&t!==null&&lm in t&&t[lm]===!0}a(Rl,"isEvent");function dm(){let t="";for(let e=0;e<8;e++)t+=kP[Math.floor(Math.random()*kP.length)];return t}a(dm,"createNewEventId");var Ys="2.2.0";var M4="gen_ai.agent.description",$P="gen_ai.agent.name",DP="gen_ai.conversation.id",ea="gen_ai.operation.name",OP="gen_ai.tool.call.id",MP="gen_ai.tool.description",LP="gen_ai.tool.name",L4="gen_ai.tool.type",U4="adk.workflow.name",UP="adk.node.path",F4="adk.node.run_id",z4="adk.node.attempt",G4="adk.node.status",B4="adk.node.interrupt_count",Ze=Oe.getTracer("gcp.vertex.agent",Ys);function Xs(t){try{return JSON.stringify(t)}catch(e){return"<not serializable>"}}a(Xs,"safeJsonSerialize");function FP({agent:t,invocationContext:e}){let n=Oe.getActiveSpan();n&&n.setAttributes({[ea]:"invoke_agent",[M4]:t.description,[$P]:t.name,[DP]:e.session.id})}a(FP,"traceAgentInvocation");function zP({workflowName:t,nodePath:e,sessionId:n}){let o=Oe.getActiveSpan();o&&o.setAttributes({[ea]:"invoke_workflow",[DP]:n,[U4]:t,[UP]:e})}a(zP,"traceWorkflowInvocation");function Xo({nodePath:t,runId:e,attempt:n,status:o,interruptCount:r}){let i=Oe.getActiveSpan();i&&i.setAttributes({[ea]:"execute_node",[UP]:t,[F4]:e,[z4]:n,[G4]:o,[B4]:r})}a(Xo,"traceNodeExecution");function GP({tool:t,args:e,functionResponseEvent:n}){var s,u;let o=Oe.getActiveSpan();if(!o)return;o.setAttributes({[ea]:"execute_tool",[MP]:t.description||"",[LP]:t.name,[L4]:t.constructor.name,"gcp.vertex.agent.llm_request":"{}","gcp.vertex.agent.llm_response":"{}","gcp.vertex.agent.tool_call_args":Qs()?Xs(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({[OP]:r,"gcp.vertex.agent.event_id":n.id,"gcp.vertex.agent.tool_response":Qs()?Xs(i):"{}"})}a(GP,"traceToolCall");function BP({responseEventId:t,functionResponseEvent:e}){let n=Oe.getActiveSpan();n&&(n.setAttributes({[ea]:"execute_tool",[LP]:"(merged tools)",[MP]:"(merged tools)",[OP]: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",Qs()?Xs(e):"{}"))}a(BP,"traceMergedToolCalls");function qP({invocationContext:t,eventId:e,llmRequest:n,llmResponse:o}){var i,s,u,c;let r=Oe.getActiveSpan();if(r&&(r.setAttributes({"gen_ai.system":"gcp.vertex.agent","gen_ai.request.model":n.model,...(i=t.agent)!=null&&i.name?{[$P]: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":Qs()?Xs(V4(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",Qs()?Xs(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(qP,"traceCallLlm");function q4(t){let e={...t};return delete e.headers,delete e.extraBody,e}a(q4,"redactHttpOptions");function V4(t){let e={model:t.model,contents:[]};if(t.config){let{responseSchema:n,...o}=t.config;o.httpOptions&&(o.httpOptions=q4(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(V4,"buildLlmRequestForTrace");function VP(t,e){return{next:Fe.bind(t,e.next.bind(e)),return:Fe.bind(t,e.return.bind(e)),throw:Fe.bind(t,e.throw.bind(e)),[Symbol.asyncIterator](){return VP(t,e[Symbol.asyncIterator]())}}}a(VP,"bindOtelContextToAsyncGenerator");function cr(t,e,n){let o=n.call(e);return VP(t,o)}a(cr,"runAsyncGeneratorWithOtelContext");function Qs(){let t=process.env.ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS||"true";return t==="true"||t==="1"}a(Qs,"shouldAddRequestResponseToSpans");var hc=lz(YP(),1);var j4,Y4;function X4(){return{geminiUrl:j4,vertexUrl:Y4}}a(X4,"getDefaultBaseUrls");function Q4(t,e,n,o){var r,i;if(!(t!=null&&t.baseUrl)){let s=X4();return e?(r=s.vertexUrl)!==null&&r!==void 0?r:n:(i=s.geminiUrl)!==null&&i!==void 0?i:o}return t.baseUrl}a(Q4,"getBaseUrl");var Wg=class Wg{};a(Wg,"BaseModule");var en=Wg;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 e1(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)}gm(t,r,i,0,s)}}a(e1,"moveValueByPath");function gm(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])gm(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&&gm(s[i],e,n,o+1,r)}}a(gm,"_moveValueRecursive");function Gg(t){if(typeof t!="string")throw new Error("fromImageBytes must be a string");return t}a(Gg,"tBytes$1");function t1(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(t1,"fetchPredictOperationParametersToVertex");function n1(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"],o1(s)),e}a(n1,"generateVideosOperationFromMldev$1");function r1(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"],i1(s)),e}a(r1,"generateVideosOperationFromVertex$1");function o1(t){let e={},n=f(t,["generatedSamples"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(s=>s1(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(o1,"generateVideosResponseFromMldev$1");function i1(t){let e={},n=f(t,["videos"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(s=>a1(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(i1,"generateVideosResponseFromVertex$1");function s1(t){let e={},n=f(t,["video"]);return n!=null&&m(e,["video"],p1(n)),e}a(s1,"generatedVideoFromMldev$1");function a1(t){let e={},n=f(t,["_self"]);return n!=null&&m(e,["video"],m1(n)),e}a(a1,"generatedVideoFromVertex$1");function u1(t){let e={},n=f(t,["operationName"]);return n!=null&&m(e,["_url","operationName"],n),e}a(u1,"getOperationParametersToMldev");function l1(t){let e={},n=f(t,["operationName"]);return n!=null&&m(e,["_url","operationName"],n),e}a(l1,"getOperationParametersToVertex");function c1(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"],d1(s)),e}a(c1,"importFileOperationFromMldev$1");function d1(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(d1,"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"],f1(s)),e}a(G$,"uploadToFileSearchStoreOperationFromMldev");function f1(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(f1,"uploadToFileSearchStoreResponseFromMldev");function p1(t){let e={},n=f(t,["uri"]);n!=null&&m(e,["uri"],n);let o=f(t,["encodedVideo"]);o!=null&&m(e,["videoBytes"],Gg(o));let r=f(t,["encoding"]);return r!=null&&m(e,["mimeType"],r),e}a(p1,"videoFromMldev$1");function m1(t){let e={},n=f(t,["gcsUri"]);n!=null&&m(e,["uri"],n);let o=f(t,["bytesBase64Encoded"]);o!=null&&m(e,["videoBytes"],Gg(o));let r=f(t,["mimeType"]);return r!=null&&m(e,["mimeType"],r),e}a(m1,"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 Ul;(function(t){t.LANGUAGE_UNSPECIFIED="LANGUAGE_UNSPECIFIED",t.PYTHON="PYTHON"})(Ul||(Ul={}));var XP;(function(t){t.SCHEDULING_UNSPECIFIED="SCHEDULING_UNSPECIFIED",t.SILENT="SILENT",t.WHEN_IDLE="WHEN_IDLE",t.INTERRUPT="INTERRUPT"})(XP||(XP={}));var H;(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"})(H||(H={}));var QP;(function(t){t.ENVIRONMENT_UNSPECIFIED="ENVIRONMENT_UNSPECIFIED",t.ENVIRONMENT_BROWSER="ENVIRONMENT_BROWSER",t.ENVIRONMENT_MOBILE="ENVIRONMENT_MOBILE",t.ENVIRONMENT_DESKTOP="ENVIRONMENT_DESKTOP"})(QP||(QP={}));var eN;(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"})(eN||(eN={}));var tN;(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"})(tN||(tN={}));var nN;(function(t){t.API_SPEC_UNSPECIFIED="API_SPEC_UNSPECIFIED",t.SIMPLE_SEARCH="SIMPLE_SEARCH",t.ELASTIC_SEARCH="ELASTIC_SEARCH"})(nN||(nN={}));var rN;(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"})(rN||(rN={}));var oN;(function(t){t.UNSPECIFIED="UNSPECIFIED",t.BLOCKING="BLOCKING",t.NON_BLOCKING="NON_BLOCKING"})(oN||(oN={}));var iN;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.MODE_DYNAMIC="MODE_DYNAMIC"})(iN||(iN={}));var sN;(function(t){t.THINKING_LEVEL_UNSPECIFIED="THINKING_LEVEL_UNSPECIFIED",t.MINIMAL="MINIMAL",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"})(sN||(sN={}));var aN;(function(t){t.DONT_ALLOW="DONT_ALLOW",t.ALLOW_ADULT="ALLOW_ADULT",t.ALLOW_ALL="ALLOW_ALL"})(aN||(aN={}));var uN;(function(t){t.PROMINENT_PEOPLE_UNSPECIFIED="PROMINENT_PEOPLE_UNSPECIFIED",t.ALLOW_PROMINENT_PEOPLE="ALLOW_PROMINENT_PEOPLE",t.BLOCK_PROMINENT_PEOPLE="BLOCK_PROMINENT_PEOPLE"})(uN||(uN={}));var lN;(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"})(lN||(lN={}));var cN;(function(t){t.HARM_BLOCK_METHOD_UNSPECIFIED="HARM_BLOCK_METHOD_UNSPECIFIED",t.SEVERITY="SEVERITY",t.PROBABILITY="PROBABILITY"})(cN||(cN={}));var dN;(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"})(dN||(dN={}));var fN;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.AUTO="AUTO",t.ANY="ANY",t.NONE="NONE",t.VALIDATED="VALIDATED"})(fN||(fN={}));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 pN;(function(t){t.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",t.NEGLIGIBLE="NEGLIGIBLE",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"})(pN||(pN={}));var mN;(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"})(mN||(mN={}));var gN;(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"})(gN||(gN={}));var hN;(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"})(hN||(hN={}));var yN;(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"})(yN||(yN={}));var vN;(function(t){t.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",t.TEXT="TEXT",t.IMAGE="IMAGE",t.VIDEO="VIDEO",t.AUDIO="AUDIO",t.DOCUMENT="DOCUMENT"})(vN||(vN={}));var _N;(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"})(_N||(_N={}));var xN;(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"})(xN||(xN={}));var Zr;(function(t){t.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",t.TEXT="TEXT",t.IMAGE="IMAGE",t.AUDIO="AUDIO",t.VIDEO="VIDEO"})(Zr||(Zr={}));var EN;(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"})(EN||(EN={}));var SN;(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"})(SN||(SN={}));var hm;(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"})(hm||(hm={}));var CN;(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"})(CN||(CN={}));var TN;(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"})(TN||(TN={}));var IN;(function(t){t.PAIRWISE_CHOICE_UNSPECIFIED="PAIRWISE_CHOICE_UNSPECIFIED",t.BASELINE="BASELINE",t.CANDIDATE="CANDIDATE",t.TIE="TIE"})(IN||(IN={}));var AN;(function(t){t.TUNING_SPEED_UNSPECIFIED="TUNING_SPEED_UNSPECIFIED",t.REGULAR="REGULAR",t.FAST="FAST"})(AN||(AN={}));var bN;(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"})(bN||(bN={}));var wN;(function(t){t.VIDEO_ORIENTATION_UNSPECIFIED="VIDEO_ORIENTATION_UNSPECIFIED",t.LANDSCAPE="LANDSCAPE",t.PORTRAIT="PORTRAIT"})(wN||(wN={}));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 kN;(function(t){t.UNSPECIFIED="unspecified",t.FLEX="flex",t.STANDARD="standard",t.PRIORITY="priority"})(kN||(kN={}));var PN;(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"})(PN||(PN={}));var NN;(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"})(NN||(NN={}));var ym;(function(t){t.COLLECTION="COLLECTION"})(ym||(ym={}));var $N;(function(t){t.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED="FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",t.PRIORITIZE_QUALITY="PRIORITIZE_QUALITY",t.BALANCED="BALANCED",t.PRIORITIZE_COST="PRIORITIZE_COST"})($N||($N={}));var Fl;(function(t){t.PREDICT="PREDICT",t.EMBED_CONTENT="EMBED_CONTENT"})(Fl||(Fl={}));var DN;(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"})(DN||(DN={}));var ON;(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"})(ON||(ON={}));var MN;(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"})(MN||(MN={}));var LN;(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"})(LN||(LN={}));var UN;(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"})(UN||(UN={}));var FN;(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"})(FN||(FN={}));var zN;(function(t){t.FOREGROUND="FOREGROUND",t.BACKGROUND="BACKGROUND",t.PROMPT="PROMPT",t.SEMANTIC="SEMANTIC",t.INTERACTIVE="INTERACTIVE"})(zN||(zN={}));var GN;(function(t){t.ASSET="ASSET",t.STYLE="STYLE"})(GN||(GN={}));var BN;(function(t){t.INSERT="INSERT",t.REMOVE="REMOVE",t.REMOVE_STATIC="REMOVE_STATIC",t.OUTPAINT="OUTPAINT"})(BN||(BN={}));var qN;(function(t){t.OPTIMIZED="OPTIMIZED",t.LOSSLESS="LOSSLESS"})(qN||(qN={}));var VN;(function(t){t.CROP="CROP",t.PAD="PAD"})(VN||(VN={}));var ZN;(function(t){t.RESPONSE_PARSE_TYPE_UNSPECIFIED="RESPONSE_PARSE_TYPE_UNSPECIFIED",t.IDENTITY="IDENTITY",t.REGEX_EXTRACT="REGEX_EXTRACT"})(ZN||(ZN={}));var HN;(function(t){t.MATCH_OPERATION_UNSPECIFIED="MATCH_OPERATION_UNSPECIFIED",t.REGEX_CONTAINS="REGEX_CONTAINS",t.PARTIAL_MATCH="PARTIAL_MATCH",t.EXACT_MATCH="EXACT_MATCH"})(HN||(HN={}));var JN;(function(t){t.REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED="REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED",t.MINIMAL="MINIMAL",t.HIGH="HIGH"})(JN||(JN={}));var WN;(function(t){t.SUPERVISED_FINE_TUNING="SUPERVISED_FINE_TUNING",t.PREFERENCE_TUNING="PREFERENCE_TUNING",t.DISTILLATION="DISTILLATION",t.REINFORCEMENT_TUNING="REINFORCEMENT_TUNING"})(WN||(WN={}));var KN;(function(t){t.STATE_UNSPECIFIED="STATE_UNSPECIFIED",t.PROCESSING="PROCESSING",t.ACTIVE="ACTIVE",t.FAILED="FAILED"})(KN||(KN={}));var jN;(function(t){t.SOURCE_UNSPECIFIED="SOURCE_UNSPECIFIED",t.UPLOADED="UPLOADED",t.GENERATED="GENERATED",t.REGISTERED="REGISTERED"})(jN||(jN={}));var YN;(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"})(YN||(YN={}));var XN;(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"})(XN||(XN={}));var QN;(function(t){t.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",t.ACTIVITY_START="ACTIVITY_START",t.ACTIVITY_END="ACTIVITY_END"})(QN||(QN={}));var e$;(function(t){t.START_SENSITIVITY_UNSPECIFIED="START_SENSITIVITY_UNSPECIFIED",t.START_SENSITIVITY_HIGH="START_SENSITIVITY_HIGH",t.START_SENSITIVITY_LOW="START_SENSITIVITY_LOW"})(e$||(e$={}));var t$;(function(t){t.END_SENSITIVITY_UNSPECIFIED="END_SENSITIVITY_UNSPECIFIED",t.END_SENSITIVITY_HIGH="END_SENSITIVITY_HIGH",t.END_SENSITIVITY_LOW="END_SENSITIVITY_LOW"})(t$||(t$={}));var n$;(function(t){t.ACTIVITY_HANDLING_UNSPECIFIED="ACTIVITY_HANDLING_UNSPECIFIED",t.START_OF_ACTIVITY_INTERRUPTS="START_OF_ACTIVITY_INTERRUPTS",t.NO_INTERRUPTION="NO_INTERRUPTION"})(n$||(n$={}));var r$;(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"})(r$||(r$={}));var o$;(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"})(o$||(o$={}));var i$;(function(t){t.MUSIC_GENERATION_MODE_UNSPECIFIED="MUSIC_GENERATION_MODE_UNSPECIFIED",t.QUALITY="QUALITY",t.DIVERSITY="DIVERSITY",t.VOCALIZATION="VOCALIZATION"})(i$||(i$={}));var ei;(function(t){t.PLAYBACK_CONTROL_UNSPECIFIED="PLAYBACK_CONTROL_UNSPECIFIED",t.PLAY="PLAY",t.PAUSE="PAUSE",t.STOP="STOP",t.RESET_CONTEXT="RESET_CONTEXT"})(ei||(ei={}));function ai(t){return{text:t}}a(ai,"createPartFromText");function s$(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(s$,"_isPart");function B$(t){let e=[];if(typeof t=="string")e.push(ai(t));else if(s$(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(ai(n));else if(s$(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(B$,"_toParts");function yc(t){return{role:"user",parts:B$(t)}}a(yc,"createUserContent");function Bg(t){return{role:"model",parts:B$(t)}}a(Bg,"createModelContent");var Kg=class Kg{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(Kg,"HttpResponse");var ui=Kg;var jg=class jg{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,y]of Object.entries(g))h!=="text"&&h!=="thought"&&h!=="thoughtSignature"&&(y!==null||y!==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(jg,"GenerateContentResponse");var Vr=jg,Yg=class Yg{};a(Yg,"EmbedContentResponse");var zl=Yg,Xg=class Xg{};a(Xg,"GenerateImagesResponse");var Gl=Xg,Qg=class Qg{};a(Qg,"EditImageResponse");var vm=Qg,eh=class eh{};a(eh,"UpscaleImageResponse");var _m=eh,th=class th{};a(th,"RecontextImageResponse");var xm=th,nh=class nh{};a(nh,"SegmentImageResponse");var Em=nh,rh=class rh{};a(rh,"ListModelsResponse");var Bl=rh,oh=class oh{};a(oh,"DeleteModelResponse");var ql=oh,ih=class ih{};a(ih,"CountTokensResponse");var Vl=ih,sh=class sh{};a(sh,"ComputeTokensResponse");var Sm=sh;var ac=class ac{_fromAPIResponse({apiResponse:e,_isVertexAI:n}){let o=new ac,r,i=e;return n?r=r1(i):r=n1(i),Object.assign(o,r),o}};a(ac,"GenerateVideosOperation");var Zl=ac;var ah=class ah{};a(ah,"ListTuningJobsResponse");var Cm=ah,uh=class uh{};a(uh,"CancelTuningJobResponse");var Hl=uh,lh=class lh{};a(lh,"ValidateRewardResponse");var Tm=lh,ch=class ch{};a(ch,"DeleteCachedContentResponse");var Jl=ch,dh=class dh{};a(dh,"ListCachedContentsResponse");var Wl=dh,fh=class fh{};a(fh,"ListDocumentsResponse");var Im=fh,ph=class ph{};a(ph,"ListFileSearchStoresResponse");var Am=ph,mh=class mh{};a(mh,"UploadToFileSearchStoreResumableResponse");var bm=mh;var uc=class uc{_fromAPIResponse({apiResponse:e,_isVertexAI:n}){let o=new uc,i=c1(e);return Object.assign(o,i),o}};a(uc,"ImportFileOperation");var wm=uc,gh=class gh{};a(gh,"ListFilesResponse");var Rm=gh,hh=class hh{};a(hh,"CreateFileResponse");var km=hh,yh=class yh{};a(yh,"DeleteFileResponse");var Pm=yh,vh=class vh{};a(vh,"RegisterFilesResponse");var Nm=vh;var _h=class _h{};a(_h,"ListBatchJobsResponse");var Kl=_h;var xh=class xh{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(xh,"LiveServerMessage");var $m=xh;var Eh=class Eh{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}};a(Eh,"LiveMusicServerMessage");var Dm=Eh;var lc=class lc{_fromAPIResponse({apiResponse:e,_isVertexAI:n}){let o=new lc,i=G$(e);return Object.assign(o,i),o}};a(lc,"UploadToFileSearchStoreOperation");var Om=lc;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 q$(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(q$,"tCachesModel");function V$(t){return Array.isArray(t)?t.map(e=>jl(e)):[jl(t)]}a(V$,"tBlobs");function jl(t){if(typeof t=="object"&&t!==null)return t;throw new Error(`Could not parse input as Blob. Unsupported blob type: ${typeof t}`)}a(jl,"tBlob");function Z$(t){let e=jl(t);if(e.mimeType&&e.mimeType.startsWith("image/"))return e;throw new Error(`Unsupported mime type: ${e.mimeType}`)}a(Z$,"tImageBlob");function H$(t){let e=jl(t);if(e.mimeType&&e.mimeType.startsWith("audio/"))return e;throw new Error(`Unsupported mime type: ${e.mimeType}`)}a(H$,"tAudioBlob");function a$(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(a$,"tPart");function J$(t){if(t==null||Array.isArray(t)&&t.length===0)throw new Error("PartListUnion is required");return Array.isArray(t)?t.map(e=>a$(e)):[a$(t)]}a(J$,"tParts");function Mm(t){return t!=null&&typeof t=="object"&&"parts"in t&&Array.isArray(t.parts)}a(Mm,"_isContent");function u$(t){return t!=null&&typeof t=="object"&&"functionCall"in t}a(u$,"_isFunctionCallPart");function l$(t){return t!=null&&typeof t=="object"&&"functionResponse"in t}a(l$,"_isFunctionResponsePart");function Be(t){if(t==null)throw new Error("ContentUnion is required");return Mm(t)?t:{role:"user",parts:J$(t)}}a(Be,"tContent");function qg(t,e){if(!e)return[];if(t.isVertexAI()&&Array.isArray(e))return e.flatMap(n=>{let o=Be(n);return o.parts&&o.parts.length>0&&o.parts[0].text!==void 0?[o.parts[0].text]:[]});if(t.isVertexAI()){let n=Be(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=>Be(n)):[Be(e)]}a(qg,"tContentsForEmbed");function vt(t){if(t==null||Array.isArray(t)&&t.length===0)throw new Error("contents are required");if(!Array.isArray(t)){if(u$(t)||l$(t))throw new Error("To specify functionCall or functionResponse parts, please wrap them in a Content object, specifying the role for them");return[Be(t)]}let e=[],n=[],o=Mm(t[0]);for(let r of t){let i=Mm(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(u$(r)||l$(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:J$(n)}),e}a(vt,"tContents");function g1(t,e){t.includes("null")&&(e.nullable=!0);let n=t.filter(o=>o!=="null");if(n.length===1)e.type=Object.values(H).includes(n[0].toUpperCase())?n[0].toUpperCase():H.TYPE_UNSPECIFIED;else{e.anyOf=[];for(let o of n)e.anyOf.push({type:Object.values(H).includes(o.toUpperCase())?o.toUpperCase():H.TYPE_UNSPECIFIED})}}a(g1,"flattenTypeArrayToAnyOf");function ri(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&&g1(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(H).includes(u.toUpperCase())?u.toUpperCase():H.TYPE_UNSPECIFIED}else if(n.includes(s))e[s]=ri(u);else if(o.includes(s)){let c=[];for(let l of u){if(l.type=="null"){e.nullable=!0;continue}c.push(ri(l))}e[s]=c}else if(r.includes(s)){let c={};for(let[l,p]of Object.entries(u))c[l]=ri(p);e[s]=c}else{if(s==="additionalProperties")continue;e[s]=u}return e}a(ri,"processJsonSchema");function Vg(t){return ri(t)}a(Vg,"tSchema");function Zg(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(Zg,"tSpeechConfig");function Hg(t){if("multiSpeakerVoiceConfig"in t)throw new Error("multiSpeakerVoiceConfig is not supported in the live API.");return t}a(Hg,"tLiveSpeechConfig");function fi(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=ri(e.parameters)),e.response&&(Object.keys(e.response).includes("$schema")?e.responseJsonSchema||(e.responseJsonSchema=e.response,delete e.response):e.response=ri(e.response));return t}a(fi,"tTool");function pi(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(pi,"tTools");function h1(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(h1,"resourceName");function Gn(t,e){if(typeof e!="string")throw new Error("name must be a string");return h1(t,e,"cachedContents")}a(Gn,"tCachedContentName");function W$(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(W$,"tTuningJobStatus");function gr(t){return Gg(t)}a(gr,"tBytes");function y1(t){return t!=null&&typeof t=="object"&&"name"in t}a(y1,"_isFile");function v1(t){return t!=null&&typeof t=="object"&&"video"in t}a(v1,"isGeneratedVideo");function _1(t){return t!=null&&typeof t=="object"&&"uri"in t}a(_1,"isVideo");function K$(t){var e;let n;if(y1(t)&&(n=t.name),!(_1(t)&&(n=t.uri,n===void 0))&&!(v1(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(K$,"tFileName");function j$(t,e){let n;return t.isVertexAI()?n=e?"publishers/google/models":"models":n=e?"models":"tunedModels",n}a(j$,"tModelsUrl");function Y$(t){for(let e of["models","tunedModels","publisherModels"])if(x1(t,e))return t[e];return[]}a(Y$,"tExtractModels");function x1(t,e){return t!==null&&typeof t=="object"&&e in t}a(x1,"hasField");function E1(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(E1,"mcpToGeminiTool");function S1(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=E1(r,e);s.functionDeclarations&&n.push(...s.functionDeclarations)}return{functionDeclarations:n}}a(S1,"mcpToolsToGeminiTool");function X$(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(X$,"tBatchJobSource");function C1(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(C1,"tBatchJobDestination");function Q$(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(Q$,"tRecvBatchJobDestination");function mi(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(mi,"tBatchJobName");function e0(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(e0,"tJobState");function T1(t){return t.includes("gemini")&&t!=="gemini-embedding-001"||t.includes("maas")}a(T1,"tIsVertexEmbedContentModel");function I1(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(I1,"authConfigToMldev$4");function A1(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=>s6(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(A1,"batchJobDestinationFromMldev");function b1(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"],y6(i)),e}a(b1,"batchJobDestinationFromVertex");function w1(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"],v6(i)),e}a(w1,"batchJobDestinationToVertex");function Ml(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"],e0(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"],A1(Q$(l))),e}a(Ml,"batchJobFromMldev");function Lm(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"],e0(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"],R1(d));let g=f(t,["outputConfig"]);g!=null&&m(e,["dest"],b1(Q$(g)));let h=f(t,["completionStats"]);h!=null&&m(e,["completionStats"],h);let y=f(t,["outputInfo"]);return y!=null&&m(e,["outputInfo"],y),e}a(Lm,"batchJobFromVertex");function R1(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(R1,"batchJobSourceFromVertex");function k1(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=>i6(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(k1,"batchJobSourceToMldev");function P1(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(P1,"batchJobSourceToVertex");function N1(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(N1,"blobToMldev$4");function $1(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],mi(t,o)),n}a($1,"cancelBatchJobParametersToMldev");function D1(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],mi(t,o)),n}a(D1,"cancelBatchJobParametersToVertex");function O1(t){let e={},n=f(t,["content"]);n!=null&&m(e,["content"],n);let o=f(t,["citationMetadata"]);o!=null&&m(e,["citationMetadata"],M1(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(O1,"candidateFromMldev$1");function M1(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(M1,"citationMetadataFromMldev$1");function t0(t){let e={},n=f(t,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>p6(i))),m(e,["parts"],r)}let o=f(t,["role"]);return o!=null&&m(e,["role"],o),e}a(t0,"contentToMldev$4");function L1(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(L1,"createBatchJobConfigToMldev");function U1(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"],w1(C1(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(U1,"createBatchJobConfigToVertex");function c$(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"],k1(t,X$(t,r)));let i=f(e,["config"]);return i!=null&&L1(i,n),n}a(c$,"createBatchJobParametersToMldev");function F1(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"],P1(X$(t,r)));let i=f(e,["config"]);return i!=null&&U1(i,n),n}a(F1,"createBatchJobParametersToVertex");function z1(t,e){let n={},o=f(t,["displayName"]);return e!==void 0&&o!=null&&m(e,["batch","displayName"],o),n}a(z1,"createEmbeddingsBatchJobConfigToMldev");function G1(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"],W1(t,r));let i=f(e,["config"]);return i!=null&&z1(i,n),n}a(G1,"createEmbeddingsBatchJobParametersToMldev");function B1(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],mi(t,o)),n}a(B1,"deleteBatchJobParametersToMldev");function q1(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],mi(t,o)),n}a(q1,"deleteBatchJobParametersToVertex");function V1(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(V1,"deleteResourceJobFromMldev");function Z1(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(Z1,"deleteResourceJobFromVertex");function H1(t,e){let n={},o=f(e,["contents"]);if(o!=null){let i=qg(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"],J1(r,n)),e1(n,{"requests[].*":"requests[].request.*"})),n}a(H1,"embedContentBatchToMldev");function J1(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(J1,"embedContentConfigToMldev$1");function W1(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"],H1(t,r)),n}a(W1,"embeddingsBatchJobSourceToMldev");function K1(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(K1,"fileDataToMldev$4");function j1(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(j1,"functionCallToMldev$4");function Y1(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(Y1,"functionCallingConfigToMldev$2");function X1(t,e,n){let o={},r=f(e,["systemInstruction"]);n!==void 0&&r!=null&&m(n,["systemInstruction"],t0(Be(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 y=f(e,["frequencyPenalty"]);y!=null&&m(o,["frequencyPenalty"],y);let v=f(e,["seed"]);v!=null&&m(o,["seed"],v);let _=f(e,["responseMimeType"]);_!=null&&m(o,["responseMimeType"],_);let x=f(e,["responseSchema"]);x!=null&&m(o,["responseSchema"],Vg(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 C=f(e,["safetySettings"]);if(n!==void 0&&C!=null){let N=C;Array.isArray(N)&&(N=N.map(O=>m6(O))),m(n,["safetySettings"],N)}let S=f(e,["tools"]);if(n!==void 0&&S!=null){let N=pi(S);Array.isArray(N)&&(N=N.map(O=>h6(fi(O)))),m(n,["tools"],N)}let T=f(e,["toolConfig"]);if(n!==void 0&&T!=null&&m(n,["toolConfig"],g6(T)),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 R=f(e,["responseModalities"]);R!=null&&m(o,["responseModalities"],R);let B=f(e,["mediaResolution"]);B!=null&&m(o,["mediaResolution"],B);let P=f(e,["speechConfig"]);if(P!=null&&m(o,["speechConfig"],Zg(P)),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 de=f(e,["imageConfig"]);de!=null&&m(o,["imageConfig"],o6(de));let Ce=f(e,["enableEnhancedCivicAnswers"]);if(Ce!=null&&m(o,["enableEnhancedCivicAnswers"],Ce),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 De=f(e,["serviceTier"]);return n!==void 0&&De!=null&&m(n,["serviceTier"],De),o}a(X1,"generateContentConfigToMldev$1");function Q1(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=>O1(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(Q1,"generateContentResponseFromMldev$1");function e6(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],mi(t,o)),n}a(e6,"getBatchJobParametersToMldev");function t6(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],mi(t,o)),n}a(t6,"getBatchJobParametersToVertex");function n6(t){let e={},n=f(t,["authConfig"]);n!=null&&m(e,["authConfig"],I1(n));let o=f(t,["enableWidget"]);return o!=null&&m(e,["enableWidget"],o),e}a(n6,"googleMapsToMldev$4");function r6(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(r6,"googleSearchToMldev$4");function o6(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(o6,"imageConfigToMldev$1");function i6(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=vt(r);Array.isArray(u)&&(u=u.map(c=>t0(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"],X1(t,s,f(n,["request"],{}))),n}a(i6,"inlinedRequestToMldev");function s6(t){let e={},n=f(t,["response"]);n!=null&&m(e,["response"],Q1(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(s6,"inlinedResponseFromMldev");function a6(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(a6,"listBatchJobsConfigToMldev");function u6(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(u6,"listBatchJobsConfigToVertex");function l6(t){let e={},n=f(t,["config"]);return n!=null&&a6(n,e),e}a(l6,"listBatchJobsParametersToMldev");function c6(t){let e={},n=f(t,["config"]);return n!=null&&u6(n,e),e}a(c6,"listBatchJobsParametersToVertex");function d6(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=>Ml(s))),m(e,["batchJobs"],i)}return e}a(d6,"listBatchJobsResponseFromMldev");function f6(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=>Lm(s))),m(e,["batchJobs"],i)}return e}a(f6,"listBatchJobsResponseFromVertex");function p6(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"],K1(i));let s=f(t,["functionCall"]);s!=null&&m(e,["functionCall"],j1(s));let u=f(t,["functionResponse"]);u!=null&&m(e,["functionResponse"],u);let c=f(t,["inlineData"]);c!=null&&m(e,["inlineData"],N1(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 y=f(t,["toolResponse"]);y!=null&&m(e,["toolResponse"],y);let v=f(t,["partMetadata"]);return v!=null&&m(e,["partMetadata"],v),e}a(p6,"partToMldev$4");function m6(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(m6,"safetySettingToMldev$3");function g6(t){let e={},n=f(t,["retrievalConfig"]);n!=null&&m(e,["retrievalConfig"],n);let o=f(t,["functionCallingConfig"]);o!=null&&m(e,["functionCallingConfig"],Y1(o));let r=f(t,["includeServerSideToolInvocations"]);return r!=null&&m(e,["includeServerSideToolInvocations"],r),e}a(g6,"toolConfigToMldev$2");function h6(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"],r6(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(h6,"toolToMldev$4");function y6(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(y6,"vertexMultimodalDatasetDestinationFromVertex");function v6(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(v6,"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 Sh=class Sh{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(Sh,"Pager");var zn=Sh;var Ch=class Ch 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=c$(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=F1(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=>Lm(p))}else{let l=c$(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=>Ml(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=G1(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=>Ml(c))}}async get(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=t6(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=>Lm(p))}else{let l=e6(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=>Ml(p))}}async cancel(e){var n,o,r,i;let s="",u={};if(this.apiClient.isVertexAI()){let c=D1(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=$1(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=c6(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=f6(p),g=new Kl;return Object.assign(g,d),g})}else{let l=l6(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=d6(p),g=new Kl;return Object.assign(g,d),g})}}async delete(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=q1(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=>Z1(p))}else{let l=B1(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=>V1(p))}}};a(Ch,"Batches");var Um=Ch;function _6(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(_6,"authConfigToMldev$3");function x6(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(x6,"blobToMldev$3");function E6(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(E6,"codeExecutionResultToVertex$3");function d$(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(d$,"contentToMldev$3");function f$(t){let e={},n=f(t,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>H6(i))),m(e,["parts"],r)}let o=f(t,["role"]);return o!=null&&m(e,["role"],o),e}a(f$,"contentToVertex$3");function S6(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=vt(s);Array.isArray(p)&&(p=p.map(d=>d$(d))),m(e,["contents"],p)}let u=f(t,["systemInstruction"]);e!==void 0&&u!=null&&m(e,["systemInstruction"],d$(Be(u)));let c=f(t,["tools"]);if(e!==void 0&&c!=null){let p=c;Array.isArray(p)&&(p=p.map(d=>K6(d))),m(e,["tools"],p)}let l=f(t,["toolConfig"]);if(e!==void 0&&l!=null&&m(e,["toolConfig"],J6(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(S6,"createCachedContentConfigToMldev");function C6(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=vt(s);Array.isArray(d)&&(d=d.map(g=>f$(g))),m(e,["contents"],d)}let u=f(t,["systemInstruction"]);e!==void 0&&u!=null&&m(e,["systemInstruction"],f$(Be(u)));let c=f(t,["tools"]);if(e!==void 0&&c!=null){let d=c;Array.isArray(d)&&(d=d.map(g=>j6(g))),m(e,["tools"],d)}let l=f(t,["toolConfig"]);e!==void 0&&l!=null&&m(e,["toolConfig"],W6(l));let p=f(t,["kmsKeyName"]);return e!==void 0&&p!=null&&m(e,["encryption_spec","kmsKeyName"],p),n}a(C6,"createCachedContentConfigToVertex");function T6(t,e){let n={},o=f(e,["model"]);o!=null&&m(n,["model"],q$(t,o));let r=f(e,["config"]);return r!=null&&S6(r,n),n}a(T6,"createCachedContentParametersToMldev");function I6(t,e){let n={},o=f(e,["model"]);o!=null&&m(n,["model"],q$(t,o));let r=f(e,["config"]);return r!=null&&C6(r,n),n}a(I6,"createCachedContentParametersToVertex");function A6(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],Gn(t,o)),n}a(A6,"deleteCachedContentParametersToMldev");function b6(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],Gn(t,o)),n}a(b6,"deleteCachedContentParametersToVertex");function w6(t){let e={},n=f(t,["sdkHttpResponse"]);return n!=null&&m(e,["sdkHttpResponse"],n),e}a(w6,"deleteCachedContentResponseFromMldev");function R6(t){let e={},n=f(t,["sdkHttpResponse"]);return n!=null&&m(e,["sdkHttpResponse"],n),e}a(R6,"deleteCachedContentResponseFromVertex");function k6(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(k6,"executableCodeToVertex$3");function P6(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(P6,"fileDataToMldev$3");function N6(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(N6,"functionCallToMldev$3");function $6(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($6,"functionCallingConfigToMldev$1");function D6(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],Gn(t,o)),n}a(D6,"getCachedContentParametersToMldev");function O6(t,e){let n={},o=f(e,["name"]);return o!=null&&m(n,["_url","name"],Gn(t,o)),n}a(O6,"getCachedContentParametersToVertex");function M6(t){let e={},n=f(t,["authConfig"]);n!=null&&m(e,["authConfig"],_6(n));let o=f(t,["enableWidget"]);return o!=null&&m(e,["enableWidget"],o),e}a(M6,"googleMapsToMldev$3");function L6(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(L6,"googleSearchToMldev$3");function U6(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(U6,"listCachedContentsConfigToMldev");function F6(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(F6,"listCachedContentsConfigToVertex");function z6(t){let e={},n=f(t,["config"]);return n!=null&&U6(n,e),e}a(z6,"listCachedContentsParametersToMldev");function G6(t){let e={},n=f(t,["config"]);return n!=null&&F6(n,e),e}a(G6,"listCachedContentsParametersToVertex");function B6(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(B6,"listCachedContentsResponseFromMldev");function q6(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(q6,"listCachedContentsResponseFromVertex");function V6(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(V6,"mcpServerToVertex$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"],o);let r=f(t,["executableCode"]);r!=null&&m(e,["executableCode"],r);let i=f(t,["fileData"]);i!=null&&m(e,["fileData"],P6(i));let s=f(t,["functionCall"]);s!=null&&m(e,["functionCall"],N6(s));let u=f(t,["functionResponse"]);u!=null&&m(e,["functionResponse"],u);let c=f(t,["inlineData"]);c!=null&&m(e,["inlineData"],x6(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 y=f(t,["toolResponse"]);y!=null&&m(e,["toolResponse"],y);let v=f(t,["partMetadata"]);return v!=null&&m(e,["partMetadata"],v),e}a(Z6,"partToMldev$3");function H6(t){let e={},n=f(t,["mediaResolution"]);n!=null&&m(e,["mediaResolution"],n);let o=f(t,["codeExecutionResult"]);o!=null&&m(e,["codeExecutionResult"],E6(o));let r=f(t,["executableCode"]);r!=null&&m(e,["executableCode"],k6(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(H6,"partToVertex$3");function J6(t){let e={},n=f(t,["retrievalConfig"]);n!=null&&m(e,["retrievalConfig"],n);let o=f(t,["functionCallingConfig"]);o!=null&&m(e,["functionCallingConfig"],$6(o));let r=f(t,["includeServerSideToolInvocations"]);return r!=null&&m(e,["includeServerSideToolInvocations"],r),e}a(J6,"toolConfigToMldev$1");function W6(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(W6,"toolConfigToVertex$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"],L6(r));let i=f(t,["googleMaps"]);i!=null&&m(e,["googleMaps"],M6(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$3");function j6(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(y=>y)),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(y=>V6(y))),m(e,["mcpServers"],h)}return e}a(j6,"toolToVertex$2");function Y6(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(Y6,"updateCachedContentConfigToMldev");function X6(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(X6,"updateCachedContentConfigToVertex");function Q6(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&&Y6(r,n),n}a(Q6,"updateCachedContentParametersToMldev");function eZ(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&&X6(r,n),n}a(eZ,"updateCachedContentParametersToVertex");var Th=class Th 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=I6(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=T6(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=O6(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=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:"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=b6(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=R6(p),g=new Jl;return Object.assign(g,d),g})}else{let l=A6(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=w6(p),g=new Jl;return Object.assign(g,d),g})}}async update(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=eZ(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=Q6(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=G6(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=q6(p),g=new Wl;return Object.assign(g,d),g})}else{let l=z6(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=B6(p),g=new Wl;return Object.assign(g,d),g})}}};a(Th,"Caches");var Fm=Th;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 p$(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(p$,"__values");function Ie(t){return this instanceof Ie?(this.v=t,this):new Ie(t)}a(Ie,"__await");function oi(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(y){return Promise.resolve(y).then(h,d)}}function u(h,y){o[h]&&(r[h]=function(v){return new Promise(function(_,x){i.push([h,v,_,x])>1||c(h,v)})},y&&(r[h]=y(r[h])))}function c(h,y){try{l(o[h](y))}catch(v){g(i[0][3],v)}}function l(h){h.value instanceof Ie?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,y){h(y),i.shift(),i.length&&c(i[0][0],i[0][1])}}a(oi,"__asyncGenerator");function na(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 p$=="function"?p$(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(na,"__asyncValues");function tZ(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:n0(n)}a(tZ,"isValidResponse");function n0(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(n0,"isValidContent");function nZ(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(nZ,"validateHistory");function m$(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&&!n0(t[o])&&(i=!1),o++;i?e.push(...r):e.pop()}return e}a(m$,"extractCuratedHistory");var Ih=class Ih{constructor(e,n){this.modelsModule=e,this.apiClient=n}create(e){return new Gm(this.apiClient,this.modelsModule,e.model,e.config,structuredClone(e.history))}};a(Ih,"Chats");var zm=Ih,Ah=class Ah{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(),nZ(i)}async sendMessage(e){var n;await this.sendPromise;let o=Be(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=Be(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?m$(this.history):this.history;return structuredClone(n)}processStreamResponse(e,n){return oi(this,arguments,a(function*(){var r,i,s,u,c,l;let p=[];try{for(var d=!0,g=na(e),h;h=yield Ie(g.next()),r=h.done,!r;d=!0){u=h.value,d=!1;let y=u;if(tZ(y)){let v=(l=(c=y.candidates)===null||c===void 0?void 0:c[0])===null||l===void 0?void 0:l.content;v!==void 0&&p.push(v)}yield yield Ie(y)}}catch(y){i={error:y}}finally{try{!d&&!r&&(s=g.return)&&(yield Ie(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(...m$(o)):this.history.push(e),this.history.push(...r)}};a(Ah,"Chat");var Gm=Ah;var cc=class cc extends Error{constructor(e){super(e.message),this.name="ApiError",this.status=e.status,Object.setPrototypeOf(this,cc.prototype)}};a(cc,"ApiError");var Yl=cc;function rZ(t){let e={},n=f(t,["file"]);return n!=null&&m(e,["file"],n),e}a(rZ,"createFileParametersToMldev");function oZ(t){let e={},n=f(t,["sdkHttpResponse"]);return n!=null&&m(e,["sdkHttpResponse"],n),e}a(oZ,"createFileResponseFromMldev");function iZ(t){let e={},n=f(t,["name"]);return n!=null&&m(e,["_url","file"],K$(n)),e}a(iZ,"deleteFileParametersToMldev");function sZ(t){let e={},n=f(t,["sdkHttpResponse"]);return n!=null&&m(e,["sdkHttpResponse"],n),e}a(sZ,"deleteFileResponseFromMldev");function aZ(t){let e={},n=f(t,["name"]);return n!=null&&m(e,["_url","file"],K$(n)),e}a(aZ,"getFileParametersToMldev");function uZ(t){let e={},n=f(t,["uris"]);return n!=null&&m(e,["uris"],n),e}a(uZ,"internalRegisterFilesParametersToMldev");function lZ(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(lZ,"listFilesConfigToMldev");function cZ(t){let e={},n=f(t,["config"]);return n!=null&&lZ(n,e),e}a(cZ,"listFilesParametersToMldev");function dZ(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(dZ,"listFilesResponseFromMldev");function fZ(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(fZ,"registerFilesResponseFromMldev");var bh=class bh 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=cZ(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=dZ(c),p=new Rm;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=rZ(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=oZ(c),p=new km;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=aZ(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=iZ(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=sZ(c),p=new Pm;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=uZ(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=fZ(c),p=new Nm;return Object.assign(p,l),p})}}};a(bh,"Files");var Bm=bh;function g$(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(g$,"audioTranscriptionConfigToMldev$1");function pZ(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(pZ,"authConfigToMldev$2");function Ll(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(Ll,"blobToMldev$2");function mZ(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(mZ,"codeExecutionResultToVertex$2");function gZ(t){let e={},n=f(t,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>$Z(i))),m(e,["parts"],r)}let o=f(t,["role"]);return o!=null&&m(e,["role"],o),e}a(gZ,"contentToMldev$2");function hZ(t){let e={},n=f(t,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>DZ(i))),m(e,["parts"],r)}let o=f(t,["role"]);return o!=null&&m(e,["role"],o),e}a(hZ,"contentToVertex$2");function yZ(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(yZ,"executableCodeToVertex$2");function vZ(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(vZ,"fileDataToMldev$2");function _Z(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(_Z,"functionCallToMldev$2");function xZ(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 y=f(t,["responseModalities"]);y!=null&&m(e,["responseModalities"],y);let v=f(t,["responseSchema"]);v!=null&&m(e,["responseSchema"],v);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 C=f(t,["stopSequences"]);C!=null&&m(e,["stopSequences"],C);let S=f(t,["temperature"]);S!=null&&m(e,["temperature"],S);let T=f(t,["thinkingConfig"]);T!=null&&m(e,["thinkingConfig"],T);let b=f(t,["topK"]);b!=null&&m(e,["topK"],b);let R=f(t,["topP"]);if(R!=null&&m(e,["topP"],R),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(xZ,"generationConfigToVertex$1");function EZ(t){let e={},n=f(t,["authConfig"]);n!=null&&m(e,["authConfig"],pZ(n));let o=f(t,["enableWidget"]);return o!=null&&m(e,["enableWidget"],o),e}a(EZ,"googleMapsToMldev$2");function SZ(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(SZ,"googleSearchToMldev$2");function CZ(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"],Hg(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 y=f(t,["systemInstruction"]);e!==void 0&&y!=null&&m(e,["setup","systemInstruction"],gZ(Be(y)));let v=f(t,["tools"]);if(e!==void 0&&v!=null){let P=pi(v);Array.isArray(P)&&(P=P.map(V=>LZ(fi(V)))),m(e,["setup","tools"],P)}let _=f(t,["sessionResumption"]);e!==void 0&&_!=null&&m(e,["setup","sessionResumption"],MZ(_));let x=f(t,["inputAudioTranscription"]);e!==void 0&&x!=null&&m(e,["setup","inputAudioTranscription"],g$(x));let E=f(t,["outputAudioTranscription"]);e!==void 0&&E!=null&&m(e,["setup","outputAudioTranscription"],g$(E));let C=f(t,["realtimeInputConfig"]);e!==void 0&&C!=null&&m(e,["setup","realtimeInputConfig"],C);let S=f(t,["contextWindowCompression"]);e!==void 0&&S!=null&&m(e,["setup","contextWindowCompression"],S);let T=f(t,["proactivity"]);if(e!==void 0&&T!=null&&m(e,["setup","proactivity"],T),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 b=f(t,["avatarConfig"]);e!==void 0&&b!=null&&m(e,["setup","avatarConfig"],b);let R=f(t,["safetySettings"]);if(e!==void 0&&R!=null){let P=R;Array.isArray(P)&&(P=P.map(V=>OZ(V))),m(e,["setup","safetySettings"],P)}let B=f(t,["translationConfig"]);return e!==void 0&&B!=null&&m(e,["setup","generationConfig","translationConfig"],B),n}a(CZ,"liveConnectConfigToMldev$1");function TZ(t,e){let n={},o=f(t,["generationConfig"]);e!==void 0&&o!=null&&m(e,["setup","generationConfig"],xZ(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"],Hg(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 y=f(t,["systemInstruction"]);e!==void 0&&y!=null&&m(e,["setup","systemInstruction"],hZ(Be(y)));let v=f(t,["tools"]);if(e!==void 0&&v!=null){let P=pi(v);Array.isArray(P)&&(P=P.map(V=>UZ(fi(V)))),m(e,["setup","tools"],P)}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 C=f(t,["realtimeInputConfig"]);e!==void 0&&C!=null&&m(e,["setup","realtimeInputConfig"],C);let S=f(t,["contextWindowCompression"]);e!==void 0&&S!=null&&m(e,["setup","contextWindowCompression"],S);let T=f(t,["proactivity"]);e!==void 0&&T!=null&&m(e,["setup","proactivity"],T);let b=f(t,["explicitVadSignal"]);e!==void 0&&b!=null&&m(e,["setup","explicitVadSignal"],b);let R=f(t,["avatarConfig"]);e!==void 0&&R!=null&&m(e,["setup","avatarConfig"],R);let B=f(t,["safetySettings"]);if(e!==void 0&&B!=null){let P=B;Array.isArray(P)&&(P=P.map(V=>V)),m(e,["setup","safetySettings"],P)}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(TZ,"liveConnectConfigToVertex");function IZ(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"],CZ(r,n)),n}a(IZ,"liveConnectParametersToMldev");function AZ(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"],TZ(r,n)),n}a(AZ,"liveConnectParametersToVertex");function bZ(t){let e={},n=f(t,["musicGenerationConfig"]);return n!=null&&m(e,["musicGenerationConfig"],n),e}a(bZ,"liveMusicSetConfigParametersToMldev");function wZ(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(wZ,"liveMusicSetWeightedPromptsParametersToMldev");function RZ(t){let e={},n=f(t,["media"]);if(n!=null){let l=V$(n);Array.isArray(l)&&(l=l.map(p=>Ll(p))),m(e,["mediaChunks"],l)}let o=f(t,["audio"]);o!=null&&m(e,["audio"],Ll(H$(o)));let r=f(t,["audioStreamEnd"]);r!=null&&m(e,["audioStreamEnd"],r);let i=f(t,["video"]);i!=null&&m(e,["video"],Ll(Z$(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(RZ,"liveSendRealtimeInputParametersToMldev");function kZ(t){let e={},n=f(t,["media"]);if(n!=null){let l=V$(n);Array.isArray(l)&&(l=l.map(p=>p)),m(e,["mediaChunks"],l)}let o=f(t,["audio"]);o!=null&&m(e,["audio"],H$(o));let r=f(t,["audioStreamEnd"]);r!=null&&m(e,["audioStreamEnd"],r);let i=f(t,["video"]);i!=null&&m(e,["video"],Z$(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(kZ,"liveSendRealtimeInputParametersToVertex");function PZ(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"],FZ(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"],zZ(p)),e}a(PZ,"liveServerMessageFromVertex");function NZ(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(NZ,"mcpServerToVertex$1");function $Z(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"],vZ(i));let s=f(t,["functionCall"]);s!=null&&m(e,["functionCall"],_Z(s));let u=f(t,["functionResponse"]);u!=null&&m(e,["functionResponse"],u);let c=f(t,["inlineData"]);c!=null&&m(e,["inlineData"],Ll(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 y=f(t,["toolResponse"]);y!=null&&m(e,["toolResponse"],y);let v=f(t,["partMetadata"]);return v!=null&&m(e,["partMetadata"],v),e}a($Z,"partToMldev$2");function DZ(t){let e={},n=f(t,["mediaResolution"]);n!=null&&m(e,["mediaResolution"],n);let o=f(t,["codeExecutionResult"]);o!=null&&m(e,["codeExecutionResult"],mZ(o));let r=f(t,["executableCode"]);r!=null&&m(e,["executableCode"],yZ(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(DZ,"partToVertex$2");function OZ(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(OZ,"safetySettingToMldev$2");function MZ(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(MZ,"sessionResumptionConfigToMldev$1");function LZ(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"],SZ(r));let i=f(t,["googleMaps"]);i!=null&&m(e,["googleMaps"],EZ(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(LZ,"toolToMldev$2");function UZ(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(y=>y)),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(y=>NZ(y))),m(e,["mcpServers"],h)}return e}a(UZ,"toolToVertex$1");function FZ(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(y=>y)),m(e,["promptTokensDetails"],h)}let l=f(t,["cacheTokensDetails"]);if(l!=null){let h=l;Array.isArray(h)&&(h=h.map(y=>y)),m(e,["cacheTokensDetails"],h)}let p=f(t,["candidatesTokensDetails"]);if(p!=null){let h=p;Array.isArray(h)&&(h=h.map(y=>y)),m(e,["responseTokensDetails"],h)}let d=f(t,["toolUsePromptTokensDetails"]);if(d!=null){let h=d;Array.isArray(h)&&(h=h.map(y=>y)),m(e,["toolUsePromptTokensDetails"],h)}let g=f(t,["trafficType"]);return g!=null&&m(e,["trafficType"],g),e}a(FZ,"usageMetadataFromVertex");function zZ(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(zZ,"voiceActivityFromVertex");function GZ(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(GZ,"authConfigToMldev$1");function BZ(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(BZ,"blobToMldev$1");function qZ(t,e){let n={},o=f(t,["content"]);o!=null&&m(n,["content"],o);let r=f(t,["citationMetadata"]);r!=null&&m(n,["citationMetadata"],VZ(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(y=>y)),m(n,["safetyRatings"],h)}let g=f(t,["urlContextMetadata"]);return g!=null&&m(n,["urlContextMetadata"],g),n}a(qZ,"candidateFromMldev");function VZ(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(VZ,"citationMetadataFromMldev");function ZZ(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(ZZ,"codeExecutionResultToVertex$1");function HZ(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=vt(i);Array.isArray(s)&&(s=s.map(u=>gi(u))),m(o,["contents"],s)}return o}a(HZ,"computeTokensParametersToVertex");function JZ(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(JZ,"computeTokensResponseFromVertex");function WZ(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"],KZ(r)),n}a(WZ,"contentEmbeddingFromVertex");function KZ(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(KZ,"contentEmbeddingStatisticsFromVertex");function aa(t,e){let n={},o=f(t,["parts"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>i2(s))),m(n,["parts"],i)}let r=f(t,["role"]);return r!=null&&m(n,["role"],r),n}a(aa,"contentToMldev$1");function gi(t,e){let n={},o=f(t,["parts"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>s2(s))),m(n,["parts"],i)}let r=f(t,["role"]);return r!=null&&m(n,["role"],r),n}a(gi,"contentToVertex$1");function jZ(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(jZ,"controlReferenceConfigToVertex");function YZ(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(YZ,"countTokensConfigToMldev");function XZ(t,e,n){let o={},r=f(t,["systemInstruction"]);e!==void 0&&r!=null&&m(e,["systemInstruction"],gi(Be(r)));let i=f(t,["tools"]);if(e!==void 0&&i!=null){let u=i;Array.isArray(u)&&(u=u.map(c=>s0(c))),m(e,["tools"],u)}let s=f(t,["generationConfig"]);return e!==void 0&&s!=null&&m(e,["generationConfig"],qH(s)),o}a(XZ,"countTokensConfigToVertex");function QZ(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=vt(i);Array.isArray(u)&&(u=u.map(c=>aa(c))),m(o,["contents"],u)}let s=f(e,["config"]);return s!=null&&YZ(s),o}a(QZ,"countTokensParametersToMldev");function eH(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=vt(i);Array.isArray(u)&&(u=u.map(c=>gi(c))),m(o,["contents"],u)}let s=f(e,["config"]);return s!=null&&XZ(s,o),o}a(eH,"countTokensParametersToVertex");function tH(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(tH,"countTokensResponseFromMldev");function nH(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(nH,"countTokensResponseFromVertex");function rH(t,e,n){let o={},r=f(e,["model"]);return r!=null&&m(o,["_url","name"],ue(t,r)),o}a(rH,"deleteModelParametersToMldev");function oH(t,e,n){let o={},r=f(e,["model"]);return r!=null&&m(o,["_url","name"],ue(t,r)),o}a(oH,"deleteModelParametersToVertex");function iH(t,e){let n={},o=f(t,["sdkHttpResponse"]);return o!=null&&m(n,["sdkHttpResponse"],o),n}a(iH,"deleteModelResponseFromMldev");function sH(t,e){let n={},o=f(t,["sdkHttpResponse"]);return o!=null&&m(n,["sdkHttpResponse"],o),n}a(sH,"deleteModelResponseFromVertex");function aH(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 y=f(t,["language"]);e!==void 0&&y!=null&&m(e,["parameters","language"],y);let v=f(t,["outputMimeType"]);e!==void 0&&v!=null&&m(e,["parameters","outputOptions","mimeType"],v);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 C=f(t,["editMode"]);e!==void 0&&C!=null&&m(e,["parameters","editMode"],C);let S=f(t,["baseSteps"]);return e!==void 0&&S!=null&&m(e,["parameters","editConfig","baseSteps"],S),o}a(aH,"editImageConfigToVertex");function uH(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=>f2(l))),m(o,["instances[0]","referenceImages"],c)}let u=f(e,["config"]);return u!=null&&aH(u,o),o}a(uH,"editImageParametersInternalToVertex");function lH(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=>vc(s))),m(n,["generatedImages"],i)}return n}a(lH,"editImageResponseFromVertex");function cH(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(cH,"embedContentConfigToMldev");function dH(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(dH,"embedContentConfigToVertex");function fH(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=qg(t,i);Array.isArray(l)&&(l=l.map(p=>p)),m(o,["requests[]","content"],l)}let s=f(e,["content"]);s!=null&&aa(Be(s));let u=f(e,["config"]);u!=null&&cH(u,o);let c=f(e,["model"]);return c!==void 0&&m(o,["requests[]","model"],ue(t,c)),o}a(fH,"embedContentParametersPrivateToMldev");function pH(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=qg(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"],gi(Be(c)))}let u=f(e,["config"]);return u!=null&&dH(u,o,n),o}a(pH,"embedContentParametersPrivateToVertex");function mH(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(mH,"embedContentResponseFromMldev");function gH(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=>WZ(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(gH,"embedContentResponseFromVertex");function hH(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(hH,"endpointFromVertex");function yH(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(yH,"executableCodeToVertex$1");function vH(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(vH,"fileDataToMldev$1");function _H(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(_H,"functionCallToMldev$1");function xH(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(xH,"functionCallingConfigToMldev");function EH(t,e,n,o){let r={},i=f(e,["systemInstruction"]);n!==void 0&&i!=null&&m(n,["systemInstruction"],aa(Be(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 y=f(e,["presencePenalty"]);y!=null&&m(r,["presencePenalty"],y);let v=f(e,["frequencyPenalty"]);v!=null&&m(r,["frequencyPenalty"],v);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"],Vg(E));let C=f(e,["responseJsonSchema"]);if(C!=null&&m(r,["responseJsonSchema"],C),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=>p2(X))),m(n,["safetySettings"],O)}let T=f(e,["tools"]);if(n!==void 0&&T!=null){let O=pi(T);Array.isArray(O)&&(O=O.map(X=>E2(fi(X)))),m(n,["tools"],O)}let b=f(e,["toolConfig"]);if(n!==void 0&&b!=null&&m(n,["toolConfig"],_2(b)),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 R=f(e,["cachedContent"]);n!==void 0&&R!=null&&m(n,["cachedContent"],Gn(t,R));let B=f(e,["responseModalities"]);B!=null&&m(r,["responseModalities"],B);let P=f(e,["mediaResolution"]);P!=null&&m(r,["mediaResolution"],P);let V=f(e,["speechConfig"]);if(V!=null&&m(r,["speechConfig"],Zg(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 de=f(e,["thinkingConfig"]);de!=null&&m(r,["thinkingConfig"],de);let Ce=f(e,["imageConfig"]);Ce!=null&&m(r,["imageConfig"],WH(Ce));let De=f(e,["enableEnhancedCivicAnswers"]);if(De!=null&&m(r,["enableEnhancedCivicAnswers"],De),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 N=f(e,["serviceTier"]);return n!==void 0&&N!=null&&m(n,["serviceTier"],N),r}a(EH,"generateContentConfigToMldev");function SH(t,e,n,o){let r={},i=f(e,["systemInstruction"]);n!==void 0&&i!=null&&m(n,["systemInstruction"],gi(Be(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 y=f(e,["presencePenalty"]);y!=null&&m(r,["presencePenalty"],y);let v=f(e,["frequencyPenalty"]);v!=null&&m(r,["frequencyPenalty"],v);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"],Vg(E));let C=f(e,["responseJsonSchema"]);C!=null&&m(r,["responseJsonSchema"],C);let S=f(e,["routingConfig"]);S!=null&&m(r,["routingConfig"],S);let T=f(e,["modelSelectionConfig"]);T!=null&&m(r,["modelConfig"],T);let b=f(e,["safetySettings"]);if(n!==void 0&&b!=null){let fe=b;Array.isArray(fe)&&(fe=fe.map(Lt=>Lt)),m(n,["safetySettings"],fe)}let R=f(e,["tools"]);if(n!==void 0&&R!=null){let fe=pi(R);Array.isArray(fe)&&(fe=fe.map(Lt=>s0(fi(Lt)))),m(n,["tools"],fe)}let B=f(e,["toolConfig"]);n!==void 0&&B!=null&&m(n,["toolConfig"],x2(B));let P=f(e,["labels"]);n!==void 0&&P!=null&&m(n,["labels"],P);let V=f(e,["cachedContent"]);n!==void 0&&V!=null&&m(n,["cachedContent"],Gn(t,V));let de=f(e,["responseModalities"]);de!=null&&m(r,["responseModalities"],de);let Ce=f(e,["mediaResolution"]);Ce!=null&&m(r,["mediaResolution"],Ce);let De=f(e,["speechConfig"]);De!=null&&m(r,["speechConfig"],Zg(De));let N=f(e,["audioTimestamp"]);N!=null&&m(r,["audioTimestamp"],N);let O=f(e,["thinkingConfig"]);O!=null&&m(r,["thinkingConfig"],O);let X=f(e,["imageConfig"]);if(X!=null&&m(r,["imageConfig"],KH(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 be=f(e,["modelArmorConfig"]);n!==void 0&&be!=null&&m(n,["modelArmorConfig"],be);let we=f(e,["serviceTier"]);return n!==void 0&&we!=null&&m(n,["serviceTier"],we),r}a(SH,"generateContentConfigToVertex");function h$(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=vt(i);Array.isArray(u)&&(u=u.map(c=>aa(c))),m(o,["contents"],u)}let s=f(e,["config"]);return s!=null&&m(o,["generationConfig"],EH(t,s,o)),o}a(h$,"generateContentParametersToMldev");function y$(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=vt(i);Array.isArray(u)&&(u=u.map(c=>gi(c))),m(o,["contents"],u)}let s=f(e,["config"]);return s!=null&&m(o,["generationConfig"],SH(t,s,o)),o}a(y$,"generateContentParametersToVertex");function v$(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=>qZ(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(v$,"generateContentResponseFromMldev");function _$(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(_$,"generateContentResponseFromVertex");function CH(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 y=f(t,["imageSize"]);if(e!==void 0&&y!=null&&m(e,["parameters","sampleImageSize"],y),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(CH,"generateImagesConfigToMldev");function TH(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 y=f(t,["language"]);e!==void 0&&y!=null&&m(e,["parameters","language"],y);let v=f(t,["outputMimeType"]);e!==void 0&&v!=null&&m(e,["parameters","outputOptions","mimeType"],v);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 C=f(t,["imageSize"]);e!==void 0&&C!=null&&m(e,["parameters","sampleImageSize"],C);let S=f(t,["enhancePrompt"]);return e!==void 0&&S!=null&&m(e,["parameters","enhancePrompt"],S),o}a(TH,"generateImagesConfigToVertex");function IH(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&&CH(s,o),o}a(IH,"generateImagesParametersToMldev");function AH(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&&TH(s,o),o}a(AH,"generateImagesParametersToVertex");function bH(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=>FH(u))),m(n,["generatedImages"],s)}let i=f(t,["positivePromptSafetyAttributes"]);return i!=null&&m(n,["positivePromptSafetyAttributes"],o0(i)),n}a(bH,"generateImagesResponseFromMldev");function wH(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=>vc(u))),m(n,["generatedImages"],s)}let i=f(t,["positivePromptSafetyAttributes"]);return i!=null&&m(n,["positivePromptSafetyAttributes"],i0(i)),n}a(wH,"generateImagesResponseFromVertex");function RH(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"],_c(d));let g=f(t,["referenceImages"]);if(e!==void 0&&g!=null){let y=g;Array.isArray(y)&&(y=y.map(v=>D2(v))),m(e,["instances[0]","referenceImages"],y)}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(RH,"generateVideosConfigToMldev");function kH(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 y=f(t,["enhancePrompt"]);e!==void 0&&y!=null&&m(e,["parameters","enhancePrompt"],y);let v=f(t,["generateAudio"]);e!==void 0&&v!=null&&m(e,["parameters","generateAudio"],v);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 b=x;Array.isArray(b)&&(b=b.map(R=>O2(R))),m(e,["instances[0]","referenceImages"],b)}let E=f(t,["mask"]);e!==void 0&&E!=null&&m(e,["instances[0]","mask"],$2(E));let C=f(t,["compressionQuality"]);e!==void 0&&C!=null&&m(e,["parameters","compressionQuality"],C);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 T=f(t,["resizeMode"]);return e!==void 0&&T!=null&&m(e,["parameters","resizeMode"],T),o}a(kH,"generateVideosConfigToVertex");function PH(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"],OH(u)),n}a(PH,"generateVideosOperationFromMldev");function NH(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"],MH(u)),n}a(NH,"generateVideosOperationFromVertex");function $H(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"],_c(s));let u=f(e,["video"]);u!=null&&m(o,["instances[0]","video"],a0(u));let c=f(e,["source"]);c!=null&&LH(c,o);let l=f(e,["config"]);return l!=null&&RH(l,o),o}a($H,"generateVideosParametersToMldev");function DH(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"],u0(u));let c=f(e,["source"]);c!=null&&UH(c,o);let l=f(e,["config"]);return l!=null&&kH(l,o),o}a(DH,"generateVideosParametersToVertex");function OH(t,e){let n={},o=f(t,["generatedSamples"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(u=>GH(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(OH,"generateVideosResponseFromMldev");function MH(t,e){let n={},o=f(t,["videos"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(u=>BH(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(MH,"generateVideosResponseFromVertex");function LH(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"],_c(i));let s=f(t,["video"]);return e!==void 0&&s!=null&&m(e,["instances[0]","video"],a0(s)),o}a(LH,"generateVideosSourceToMldev");function UH(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"],u0(s)),o}a(UH,"generateVideosSourceToVertex");function FH(t,e){let n={},o=f(t,["_self"]);o!=null&&m(n,["image"],jH(o));let r=f(t,["raiFilteredReason"]);r!=null&&m(n,["raiFilteredReason"],r);let i=f(t,["_self"]);return i!=null&&m(n,["safetyAttributes"],o0(i)),n}a(FH,"generatedImageFromMldev");function vc(t,e){let n={},o=f(t,["_self"]);o!=null&&m(n,["image"],r0(o));let r=f(t,["raiFilteredReason"]);r!=null&&m(n,["raiFilteredReason"],r);let i=f(t,["_self"]);i!=null&&m(n,["safetyAttributes"],i0(i));let s=f(t,["prompt"]);return s!=null&&m(n,["enhancedPrompt"],s),n}a(vc,"generatedImageFromVertex");function zH(t,e){let n={},o=f(t,["_self"]);o!=null&&m(n,["mask"],r0(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(zH,"generatedImageMaskFromVertex");function GH(t,e){let n={},o=f(t,["video"]);return o!=null&&m(n,["video"],P2(o)),n}a(GH,"generatedVideoFromMldev");function BH(t,e){let n={},o=f(t,["_self"]);return o!=null&&m(n,["video"],N2(o)),n}a(BH,"generatedVideoFromVertex");function qH(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 y=f(t,["responseMimeType"]);y!=null&&m(n,["responseMimeType"],y);let v=f(t,["responseModalities"]);v!=null&&m(n,["responseModalities"],v);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 C=f(t,["speechConfig"]);C!=null&&m(n,["speechConfig"],C);let S=f(t,["stopSequences"]);S!=null&&m(n,["stopSequences"],S);let T=f(t,["temperature"]);T!=null&&m(n,["temperature"],T);let b=f(t,["thinkingConfig"]);b!=null&&m(n,["thinkingConfig"],b);let R=f(t,["topK"]);R!=null&&m(n,["topK"],R);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(qH,"generationConfigToVertex");function VH(t,e,n){let o={},r=f(e,["model"]);return r!=null&&m(o,["_url","name"],ue(t,r)),o}a(VH,"getModelParametersToMldev");function ZH(t,e,n){let o={},r=f(e,["model"]);return r!=null&&m(o,["_url","name"],ue(t,r)),o}a(ZH,"getModelParametersToVertex");function HH(t,e){let n={},o=f(t,["authConfig"]);o!=null&&m(n,["authConfig"],GZ(o));let r=f(t,["enableWidget"]);return r!=null&&m(n,["enableWidget"],r),n}a(HH,"googleMapsToMldev$1");function JH(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(JH,"googleSearchToMldev$1");function WH(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(WH,"imageConfigToMldev");function KH(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(KH,"imageConfigToVertex");function jH(t,e){let n={},o=f(t,["bytesBase64Encoded"]);o!=null&&m(n,["imageBytes"],gr(o));let r=f(t,["mimeType"]);return r!=null&&m(n,["mimeType"],r),n}a(jH,"imageFromMldev");function r0(t,e){let n={},o=f(t,["gcsUri"]);o!=null&&m(n,["gcsUri"],o);let r=f(t,["bytesBase64Encoded"]);r!=null&&m(n,["imageBytes"],gr(r));let i=f(t,["mimeType"]);return i!=null&&m(n,["mimeType"],i),n}a(r0,"imageFromVertex");function _c(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"],gr(o));let r=f(t,["mimeType"]);return r!=null&&m(n,["mimeType"],r),n}a(_c,"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"],gr(r));let i=f(t,["mimeType"]);return i!=null&&m(n,["mimeType"],i),n}a(tn,"imageToVertex");function YH(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"],j$(t,c)),r}a(YH,"listModelsConfigToMldev");function XH(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"],j$(t,c)),r}a(XH,"listModelsConfigToVertex");function QH(t,e,n){let o={},r=f(e,["config"]);return r!=null&&YH(t,r,o),o}a(QH,"listModelsParametersToMldev");function e2(t,e,n){let o={},r=f(e,["config"]);return r!=null&&XH(t,r,o),o}a(e2,"listModelsParametersToVertex");function t2(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=Y$(i);Array.isArray(s)&&(s=s.map(u=>qm(u))),m(n,["models"],s)}return n}a(t2,"listModelsResponseFromMldev");function n2(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=Y$(i);Array.isArray(s)&&(s=s.map(u=>Vm(u))),m(n,["models"],s)}return n}a(n2,"listModelsResponseFromVertex");function r2(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(r2,"maskReferenceConfigToVertex");function o2(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(o2,"mcpServerToVertex");function qm(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"],S2(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 y=f(t,["topK"]);y!=null&&m(n,["topK"],y);let v=f(t,["thinking"]);return v!=null&&m(n,["thinking"],v),n}a(qm,"modelFromMldev");function Vm(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=>hH(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"],C2(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(Vm,"modelFromVertex");function i2(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"],vH(s));let u=f(t,["functionCall"]);u!=null&&m(n,["functionCall"],_H(u));let c=f(t,["functionResponse"]);c!=null&&m(n,["functionResponse"],c);let l=f(t,["inlineData"]);l!=null&&m(n,["inlineData"],BZ(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 y=f(t,["toolCall"]);y!=null&&m(n,["toolCall"],y);let v=f(t,["toolResponse"]);v!=null&&m(n,["toolResponse"],v);let _=f(t,["partMetadata"]);return _!=null&&m(n,["partMetadata"],_),n}a(i2,"partToMldev$1");function s2(t,e){let n={},o=f(t,["mediaResolution"]);o!=null&&m(n,["mediaResolution"],o);let r=f(t,["codeExecutionResult"]);r!=null&&m(n,["codeExecutionResult"],ZZ(r));let i=f(t,["executableCode"]);i!=null&&m(n,["executableCode"],yH(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(s2,"partToVertex$1");function a2(t,e){let n={},o=f(t,["productImage"]);return o!=null&&m(n,["image"],tn(o)),n}a(a2,"productImageToVertex");function u2(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 y=f(t,["labels"]);return e!==void 0&&y!=null&&m(e,["labels"],y),o}a(u2,"recontextImageConfigToVertex");function l2(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&&d2(i,o);let s=f(e,["config"]);return s!=null&&u2(s,o),o}a(l2,"recontextImageParametersToVertex");function c2(t,e){let n={},o=f(t,["predictions"]);if(o!=null){let r=o;Array.isArray(r)&&(r=r.map(i=>vc(i))),m(n,["generatedImages"],r)}return n}a(c2,"recontextImageResponseFromVertex");function d2(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=>a2(c))),m(e,["instances[0]","productImages"],u)}return o}a(d2,"recontextImageSourceToVertex");function f2(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"],r2(s));let u=f(t,["controlImageConfig"]);u!=null&&m(n,["controlImageConfig"],jZ(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(f2,"referenceImageAPIInternalToVertex");function o0(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(o0,"safetyAttributesFromMldev");function i0(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(i0,"safetyAttributesFromVertex");function p2(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(p2,"safetySettingToMldev$1");function m2(t,e){let n={},o=f(t,["image"]);return o!=null&&m(n,["image"],tn(o)),n}a(m2,"scribbleImageToVertex");function g2(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(g2,"segmentImageConfigToVertex");function h2(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&&v2(i,o);let s=f(e,["config"]);return s!=null&&g2(s,o),o}a(h2,"segmentImageParametersToVertex");function y2(t,e){let n={},o=f(t,["predictions"]);if(o!=null){let r=o;Array.isArray(r)&&(r=r.map(i=>zH(i))),m(n,["generatedMasks"],r)}return n}a(y2,"segmentImageResponseFromVertex");function v2(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"],m2(s)),o}a(v2,"segmentImageSourceToVertex");function _2(t,e){let n={},o=f(t,["retrievalConfig"]);o!=null&&m(n,["retrievalConfig"],o);let r=f(t,["functionCallingConfig"]);r!=null&&m(n,["functionCallingConfig"],xH(r));let i=f(t,["includeServerSideToolInvocations"]);return i!=null&&m(n,["includeServerSideToolInvocations"],i),n}a(_2,"toolConfigToMldev");function x2(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(x2,"toolConfigToVertex");function E2(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"],JH(i));let s=f(t,["googleMaps"]);s!=null&&m(n,["googleMaps"],HH(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(E2,"toolToMldev$1");function s0(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 y=l;Array.isArray(y)&&(y=y.map(v=>v)),m(n,["functionDeclarations"],y)}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 y=h;Array.isArray(y)&&(y=y.map(v=>o2(v))),m(n,["mcpServers"],y)}return n}a(s0,"toolToVertex");function S2(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(S2,"tunedModelInfoFromMldev");function C2(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(C2,"tunedModelInfoFromVertex");function T2(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(T2,"updateModelConfigToMldev");function I2(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(I2,"updateModelConfigToVertex");function A2(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&&T2(i,o),o}a(A2,"updateModelParametersToMldev");function b2(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&&I2(i,o),o}a(b2,"updateModelParametersToVertex");function w2(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 y=f(t,["mode"]);return e!==void 0&&y!=null&&m(e,["parameters","mode"],y),o}a(w2,"upscaleImageAPIConfigInternalToVertex");function R2(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&&w2(u,o),o}a(R2,"upscaleImageAPIParametersInternalToVertex");function k2(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=>vc(s))),m(n,["generatedImages"],i)}return n}a(k2,"upscaleImageResponseFromVertex");function P2(t,e){let n={},o=f(t,["uri"]);o!=null&&m(n,["uri"],o);let r=f(t,["encodedVideo"]);r!=null&&m(n,["videoBytes"],gr(r));let i=f(t,["encoding"]);return i!=null&&m(n,["mimeType"],i),n}a(P2,"videoFromMldev");function N2(t,e){let n={},o=f(t,["gcsUri"]);o!=null&&m(n,["uri"],o);let r=f(t,["bytesBase64Encoded"]);r!=null&&m(n,["videoBytes"],gr(r));let i=f(t,["mimeType"]);return i!=null&&m(n,["mimeType"],i),n}a(N2,"videoFromVertex");function $2(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($2,"videoGenerationMaskToVertex");function D2(t,e){let n={},o=f(t,["image"]);o!=null&&m(n,["image"],_c(o));let r=f(t,["referenceType"]);return r!=null&&m(n,["referenceType"],r),n}a(D2,"videoGenerationReferenceImageToMldev");function O2(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(O2,"videoGenerationReferenceImageToVertex");function a0(t,e){let n={},o=f(t,["uri"]);o!=null&&m(n,["uri"],o);let r=f(t,["videoBytes"]);r!=null&&m(n,["encodedVideo"],gr(r));let i=f(t,["mimeType"]);return i!=null&&m(n,["encoding"],i),n}a(a0,"videoToMldev");function u0(t,e){let n={},o=f(t,["uri"]);o!=null&&m(n,["gcsUri"],o);let r=f(t,["videoBytes"]);r!=null&&m(n,["bytesBase64Encoded"],gr(r));let i=f(t,["mimeType"]);return i!=null&&m(n,["mimeType"],i),n}a(u0,"videoToVertex");function M2(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(M2,"createFileSearchStoreConfigToMldev");function L2(t,e){let n={},o=f(e,["config"]);return o!=null&&M2(t,o,n),n}a(L2,"createFileSearchStoreParametersToMldev");function U2(t,e){let n={},o=f(t,["force"]);return e!==void 0&&o!=null&&m(e,["_query","force"],o),n}a(U2,"deleteFileSearchStoreConfigToMldev");function F2(t){let e={},n=f(t,["name"]);n!=null&&m(e,["_url","name"],n);let o=f(t,["config"]);return o!=null&&U2(o,e),e}a(F2,"deleteFileSearchStoreParametersToMldev");function z2(t){let e={},n=f(t,["name"]);return n!=null&&m(e,["_url","name"],n),e}a(z2,"getFileSearchStoreParametersToMldev");function G2(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(G2,"importFileConfigToMldev");function B2(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"],V2(s)),e}a(B2,"importFileOperationFromMldev");function q2(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&&G2(r,e),e}a(q2,"importFileParametersToMldev");function V2(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(V2,"importFileResponseFromMldev");function Z2(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(Z2,"listFileSearchStoresConfigToMldev");function H2(t){let e={},n=f(t,["config"]);return n!=null&&Z2(n,e),e}a(H2,"listFileSearchStoresParametersToMldev");function J2(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(J2,"listFileSearchStoresResponseFromMldev");function l0(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(l0,"uploadToFileSearchStoreConfigToMldev");function W2(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&&l0(o,e),e}a(W2,"uploadToFileSearchStoreParametersToMldev");function K2(t){let e={},n=f(t,["sdkHttpResponse"]);return n!=null&&m(e,["sdkHttpResponse"],n),e}a(K2,"uploadToFileSearchStoreResumableResponseFromMldev");var j2="Content-Type",Y2="X-Server-Timeout",X2="User-Agent",Zm="x-goog-api-client",Q2="2.9.0",eJ=`google-genai-sdk/${Q2}`,tJ="v1beta1",nJ="v1beta",rJ=new Set(["us","eu"]),oJ=5,iJ=[408,429,500,502,503,504],wh=class wh{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&&rJ.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:tJ}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:nJ,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===ym.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&&sJ(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 x$(r),new ui(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 x$(r),this.processStreamResponse(r))).catch(r=>{throw r instanceof Error?r:new Error(`exception ${r} sending request`,{cause:r})})}processStreamResponse(e){return oi(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 Ie(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 y=JSON.parse(d);if("error"in y){let v=JSON.parse(JSON.stringify(y.error)),_=v.status,x=v.code,E=`got status: ${_}. ${JSON.stringify(y)}`;if(x>=400&&x<600)throw new Yl({message:E,status:x})}}catch(y){if(y.name==="ApiError")throw y}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 y=s.substring(0,g);s=s.substring(g+h);let v=y.trim();if(v.startsWith(u)){let _=v.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 Ie(new ui(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,hc.default)(a(async()=>{let s=await fetch(e,n);if(s.ok)return s;throw iJ.includes(s.status)?new Error(`Retryable HTTP Error: ${s.statusText}`):new hc.AbortError(`Non-retryable exception ${s.statusText} sending request`)},"runFetch"),{retries:((o=r.attempts)!==null&&o!==void 0?o:oJ)-1})}getDefaultHeaders(){let e={},n=eJ+" "+this.clientOptions.userAgentExtra;return e[X2]=n,e[Zm]=n,e[j2]="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(Y2,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&&l0(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(wh,"ApiClient");var Hm=wh;async function x$(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 Yl({message:r,status:n}):new Error(r)}}a(x$,"throwErrorIfNotOK");function sJ(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(sJ,"includeExtraBodyToRequestInit");var aJ="mcp_used/unknown",uJ=!1;function c0(t){for(let e of t)if(lJ(e)||typeof e=="object"&&"inputSchema"in e)return!0;return uJ}a(c0,"hasMcpToolUsage");function d0(t){var e;let n=(e=t[Zm])!==null&&e!==void 0?e:"";t[Zm]=(n+` ${aJ}`).trimStart()}a(d0,"setMcpUsageHeader");function lJ(t){return t!==null&&typeof t=="object"&&t instanceof Jm}a(lJ,"isMcpCallableTool");function cJ(t){return oi(this,arguments,a(function*(n,o=100){let r,i=0;for(;i<o;){let s=yield Ie(n.listTools({cursor:r}));for(let u of s.tools)yield yield Ie(u),i++;if(!s.nextCursor)break;r=s.nextCursor}},"listAllTools_1"))}a(cJ,"listAllTools");var dc=class dc{constructor(e=[],n){this.mcpTools=[],this.functionNameToMcpClient={},this.mcpClients=e,this.config=n}static create(e,n){return new dc(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,na(cJ(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(),S1(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(dc,"McpCallableTool");var Jm=dc;async function dJ(t,e,n){let o=new Dm,r;n.data instanceof Blob?r=JSON.parse(await n.data.text()):r=JSON.parse(n.data),Object.assign(o,r),e(o)}a(dJ,"handleWebSocketMessage$1");var Rh=class Rh{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=pJ(this.apiClient.getDefaultHeaders()),u=this.apiClient.getApiKey(),c=`${r}/ws/google.ai.generativelanguage.${i}.GenerativeService.BidiGenerateMusic?key=${u}`,l=a(()=>{},"onopenResolve"),p=new Promise(C=>{l=C}),d=e.callbacks,g=a(function(){l({})},"onopenAwaitedCallback"),h=this.apiClient,y={onopen:g,onmessage:a(C=>{dJ(h,d.onmessage,C)},"onmessage"),onerror:(n=d==null?void 0:d.onerror)!==null&&n!==void 0?n:function(C){},onclose:(o=d==null?void 0:d.onclose)!==null&&o!==void 0?o:function(C){}},v=this.webSocketFactory.create(c,fJ(s),y);v.connect(),await p;let E={setup:{model:ue(this.apiClient,e.model)}};return v.send(JSON.stringify(E)),new Km(v,this.apiClient)}};a(Rh,"LiveMusic");var Wm=Rh,kh=class kh{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=wZ(e);this.conn.send(JSON.stringify({clientContent:n}))}async setMusicGenerationConfig(e){e.musicGenerationConfig||(e.musicGenerationConfig={});let n=bZ(e);this.conn.send(JSON.stringify(n))}sendPlaybackControl(e){let n={playbackControl:e};this.conn.send(JSON.stringify(n))}play(){this.sendPlaybackControl(ei.PLAY)}pause(){this.sendPlaybackControl(ei.PAUSE)}stop(){this.sendPlaybackControl(ei.STOP)}resetContext(){this.sendPlaybackControl(ei.RESET_CONTEXT)}close(){this.conn.close()}};a(kh,"LiveMusicSession");var Km=kh;function fJ(t){let e={};return t.forEach((n,o)=>{e[o]=n}),e}a(fJ,"headersToMap$1");function pJ(t){let e=new Headers;for(let[n,o]of Object.entries(t))e.append(n,o);return e}a(pJ,"mapToHeaders$1");var mJ="FunctionResponse request must have an `id` field from the response of a ToolCall.FunctionalCalls in Google AI.";async function gJ(t,e,n){let o=new $m,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=PZ(i);Object.assign(o,s)}else Object.assign(o,i);e(o)}a(gJ,"handleWebSocketMessage");var Ph=class Ph{constructor(e,n,o){this.apiClient=e,this.auth=n,this.webSocketFactory=o,this.music=new Wm(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&&c0(e.config.tools)&&d0(d);let g=vJ(d);if(this.apiClient.isVertexAI()){let P=this.apiClient.getProject(),V=this.apiClient.getLocation(),de=this.apiClient.getApiKey(),Ce=!!P&&!!V||!!de;this.apiClient.getCustomBaseUrl()&&!Ce?p=c:(p=`${c}/ws/google.cloud.aiplatform.${l}.LlmBidiService/BidiGenerateContent`,await this.auth.addAuthHeaders(g,p))}else{let P=this.apiClient.getApiKey(),V="BidiGenerateContent",de="key";P!=null&&P.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",de="access_token"),p=`${c}/ws/google.ai.generativelanguage.${l}.GenerativeService.${V}?${de}=${P}`}let h=a(()=>{},"onopenResolve"),y=new Promise(P=>{h=P}),v=e.callbacks,_=a(function(){var P;(P=v==null?void 0:v.onopen)===null||P===void 0||P.call(v),h({})},"onopenAwaitedCallback"),x=this.apiClient,E={onopen:_,onmessage:a(P=>{gJ(x,v.onmessage,P)},"onmessage"),onerror:(n=v==null?void 0:v.onerror)!==null&&n!==void 0?n:function(P){},onclose:(o=v==null?void 0:v.onclose)!==null&&o!==void 0?o:function(P){}},C=this.webSocketFactory.create(p,yJ(g),E);C.connect(),await y;let S=ue(this.apiClient,e.model);if(this.apiClient.isVertexAI()&&S.startsWith("publishers/")){let P=this.apiClient.getProject(),V=this.apiClient.getLocation();P&&V&&(S=`projects/${P}/locations/${V}/`+S)}let T={};this.apiClient.isVertexAI()&&((r=e.config)===null||r===void 0?void 0:r.responseModalities)===void 0&&(e.config===void 0?e.config={responseModalities:[Zr.AUDIO]}:e.config.responseModalities=[Zr.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 b=(u=(s=e.config)===null||s===void 0?void 0:s.tools)!==null&&u!==void 0?u:[],R=[];for(let P of b)if(this.isCallableTool(P)){let V=P;R.push(await V.tool())}else R.push(P);R.length>0&&(e.config.tools=R);let B={model:S,config:e.config,callbacks:e.callbacks};return this.apiClient.isVertexAI()?T=AZ(this.apiClient,B):T=IZ(this.apiClient,B),delete T.config,C.send(JSON.stringify(T)),new Ym(C,this.apiClient)}isCallableTool(e){return"callTool"in e&&typeof e.callTool=="function"}};a(Ph,"Live");var jm=Ph,hJ={turnComplete:!0},Nh=class Nh{constructor(e,n){this.conn=e,this.apiClient=n}tLiveClientContent(e,n){if(n.turns!==null&&n.turns!==void 0){let o=[];try{o=vt(n.turns),e.isVertexAI()||(o=o.map(r=>aa(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(mJ)}return{toolResponse:{functionResponses:o}}}sendClientContent(e){e=Object.assign(Object.assign({},hJ),e);let n=this.tLiveClientContent(this.apiClient,e);this.conn.send(JSON.stringify(n))}sendRealtimeInput(e){let n={};this.apiClient.isVertexAI()?n={realtimeInput:kZ(e)}:n={realtimeInput:RZ(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(Nh,"Session");var Ym=Nh;function yJ(t){let e={};return t.forEach((n,o)=>{e[o]=n}),e}a(yJ,"headersToMap");function vJ(t){let e=new Headers;for(let[n,o]of Object.entries(t))e.append(n,o);return e}a(vJ,"mapToHeaders");var E$=10;function S$(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(ii(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(S$,"shouldDisableAfc");function ii(t){return"callTool"in t&&typeof t.callTool=="function"}a(ii,"isCallableTool");function _J(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=>ii(r)))!==null&&o!==void 0?o:!1}a(_J,"hasCallableTools");function C$(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(ii(o))return;let i=o;i.functionDeclarations&&i.functionDeclarations.length>0&&n.push(r)}),n}a(C$,"findAfcIncompatibleToolIndexes");function T$(t){var e;return!(!((e=t==null?void 0:t.automaticFunctionCalling)===null||e===void 0)&&e.ignoreCallHistory)}a(T$,"shouldAppendAfcHistory");var $h=class $h 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=vt(n.contents)),await this.embedContentInternal(n);if(n.model.includes("gemini")&&n.model!=="gemini-embedding-001"||n.model.includes("maas")){let r=vt(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:Fl.EMBED_CONTENT});return await this.embedContentInternal(i)}else{let r=Object.assign(Object.assign({},n),{embeddingApiType:Fl.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),!_J(n)||S$(n.config))return await this.generateContentInternal(c);let l=C$(n);if(l.length>0){let v=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 ${v}.`)}let p,d,g=vt(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:E$,y=0;for(;y<h&&(p=await this.generateContentInternal(c),!(!p.functionCalls||p.functionCalls.length===0));){let v=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(ii(x)){let C=await x.callTool(p.functionCalls);_.push(...C)}y++,d={role:"user",parts:_},c.contents=vt(c.contents),c.contents.push(v),c.contents.push(d),T$(c.config)&&(g.push(v),g.push(d))}return T$(c.config)&&(p.automaticFunctionCallingHistory=g),p},this.generateContentStream=async n=>{var o,r,i,s,u;if(this.maybeMoveToResponseJsonSchem(n),S$(n.config)){let d=await this.processParamsMaybeAddMcpUsage(n);return await this.generateContentStreamInternal(d)}let c=C$(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=>ii(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&&c0(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()),d0(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(ii(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:E$,s=!1,u=0,c=await this.initAfcToolsMap(e);return(function(l,p,d){return oi(this,arguments,function*(){for(var g,h,y,v,_,x;u<i;){s&&(u++,s=!1);let T=yield Ie(l.processParamsMaybeAddMcpUsage(d)),b=yield Ie(l.generateContentStreamInternal(T)),R=[],B=[];try{for(var E=!0,C=(h=void 0,na(b)),S;S=yield Ie(C.next()),g=S.done,!g;E=!0){v=S.value,E=!1;let P=v;if(yield yield Ie(P),P.candidates&&(!((_=P.candidates[0])===null||_===void 0)&&_.content)){B.push(P.candidates[0].content);for(let V of(x=P.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 de=yield Ie(p.get(V.functionCall.name).callTool([V.functionCall]));R.push(...de)}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(P){h={error:P}}finally{try{!E&&!g&&(y=C.return)&&(yield Ie(y.call(C)))}finally{if(h)throw h.error}}if(R.length>0){s=!0;let P=new Vr;P.candidates=[{content:{role:"user",parts:R}}],yield yield Ie(P);let V=[];V.push(...B),V.push({role:"user",parts:R});let de=vt(d.contents).concat(V);d.contents=de}else break}})})(this,c,e)}async generateContentInternal(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=y$(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=_$(p),g=new Vr;return Object.assign(g,d),g})}else{let l=h$(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=v$(p),g=new Vr;return Object.assign(g,d),g})}}async generateContentStreamInternal(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=y$(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 oi(this,arguments,function*(){var g,h,y,v;try{for(var _=!0,x=na(d),E;E=yield Ie(x.next()),g=E.done,!g;_=!0){v=E.value,_=!1;let C=v,S=_$(yield Ie(C.json()),e);S.sdkHttpResponse={headers:C.headers};let T=new Vr;Object.assign(T,S),yield yield Ie(T)}}catch(C){h={error:C}}finally{try{!_&&!g&&(y=x.return)&&(yield Ie(y.call(x)))}finally{if(h)throw h.error}}})})}else{let l=h$(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 oi(this,arguments,function*(){var g,h,y,v;try{for(var _=!0,x=na(d),E;E=yield Ie(x.next()),g=E.done,!g;_=!0){v=E.value,_=!1;let C=v,S=v$(yield Ie(C.json()),e);S.sdkHttpResponse={headers:C.headers};let T=new Vr;Object.assign(T,S),yield yield Ie(T)}}catch(C){h={error:C}}finally{try{!_&&!g&&(y=x.return)&&(yield Ie(y.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=pH(this.apiClient,e,e),p=T1(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=gH(d,e),h=new zl;return Object.assign(h,g),h})}else{let l=fH(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=mH(p),g=new zl;return Object.assign(g,d),g})}}async generateImagesInternal(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=AH(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=wH(p),g=new Gl;return Object.assign(g,d),g})}else{let l=IH(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=bH(p),g=new Gl;return Object.assign(g,d),g})}}async editImageInternal(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){let u=uH(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=lH(c),p=new vm;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=R2(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=k2(c),p=new _m;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=l2(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=c2(c),p=new xm;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=h2(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=y2(c),p=new Em;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=ZH(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=>Vm(p))}else{let l=VH(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=>qm(p))}}async listInternal(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=e2(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=n2(p),g=new Bl;return Object.assign(g,d),g})}else{let l=QH(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=t2(p),g=new Bl;return Object.assign(g,d),g})}}async update(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=b2(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=>Vm(p))}else{let l=A2(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=>qm(p))}}async delete(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=oH(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=sH(p),g=new ql;return Object.assign(g,d),g})}else{let l=rH(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=iH(p),g=new ql;return Object.assign(g,d),g})}}async countTokens(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=eH(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=nH(p),g=new Vl;return Object.assign(g,d),g})}else{let l=QZ(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=tH(p),g=new Vl;return Object.assign(g,d),g})}}async computeTokens(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){let u=HZ(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=JZ(c),p=new Sm;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=DH(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=NH(p),g=new Zl;return Object.assign(g,d),g})}else{let l=$H(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=PH(p),g=new Zl;return Object.assign(g,d),g})}}};a($h,"Models");var Xm=$h;var Dh=class Dh 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=l1(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=u1(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=t1(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(Dh,"Operations");var Qm=Dh;function I$(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(I$,"audioTranscriptionConfigToMldev");function xJ(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(xJ,"authConfigToMldev");function EJ(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(EJ,"blobToMldev");function SJ(t){let e={},n=f(t,["parts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(i=>PJ(i))),m(e,["parts"],r)}let o=f(t,["role"]);return o!=null&&m(e,["role"],o),e}a(SJ,"contentToMldev");function CJ(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"],kJ(t,u));let c=f(e,["lockAdditionalFields"]);return n!==void 0&&c!=null&&m(n,["fieldMask"],c),o}a(CJ,"createAuthTokenConfigToMldev");function TJ(t,e){let n={},o=f(e,["config"]);return o!=null&&m(n,["config"],CJ(t,o,n)),n}a(TJ,"createAuthTokenParametersToMldev");function IJ(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(IJ,"fileDataToMldev");function AJ(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(AJ,"functionCallToMldev");function bJ(t){let e={},n=f(t,["authConfig"]);n!=null&&m(e,["authConfig"],xJ(n));let o=f(t,["enableWidget"]);return o!=null&&m(e,["enableWidget"],o),e}a(bJ,"googleMapsToMldev");function wJ(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(wJ,"googleSearchToMldev");function RJ(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"],Hg(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 y=f(t,["systemInstruction"]);e!==void 0&&y!=null&&m(e,["setup","systemInstruction"],SJ(Be(y)));let v=f(t,["tools"]);if(e!==void 0&&v!=null){let P=pi(v);Array.isArray(P)&&(P=P.map(V=>DJ(fi(V)))),m(e,["setup","tools"],P)}let _=f(t,["sessionResumption"]);e!==void 0&&_!=null&&m(e,["setup","sessionResumption"],$J(_));let x=f(t,["inputAudioTranscription"]);e!==void 0&&x!=null&&m(e,["setup","inputAudioTranscription"],I$(x));let E=f(t,["outputAudioTranscription"]);e!==void 0&&E!=null&&m(e,["setup","outputAudioTranscription"],I$(E));let C=f(t,["realtimeInputConfig"]);e!==void 0&&C!=null&&m(e,["setup","realtimeInputConfig"],C);let S=f(t,["contextWindowCompression"]);e!==void 0&&S!=null&&m(e,["setup","contextWindowCompression"],S);let T=f(t,["proactivity"]);if(e!==void 0&&T!=null&&m(e,["setup","proactivity"],T),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 b=f(t,["avatarConfig"]);e!==void 0&&b!=null&&m(e,["setup","avatarConfig"],b);let R=f(t,["safetySettings"]);if(e!==void 0&&R!=null){let P=R;Array.isArray(P)&&(P=P.map(V=>NJ(V))),m(e,["setup","safetySettings"],P)}let B=f(t,["translationConfig"]);return e!==void 0&&B!=null&&m(e,["setup","generationConfig","translationConfig"],B),n}a(RJ,"liveConnectConfigToMldev");function kJ(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"],RJ(r,n)),n}a(kJ,"liveConnectConstraintsToMldev");function PJ(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"],IJ(i));let s=f(t,["functionCall"]);s!=null&&m(e,["functionCall"],AJ(s));let u=f(t,["functionResponse"]);u!=null&&m(e,["functionResponse"],u);let c=f(t,["inlineData"]);c!=null&&m(e,["inlineData"],EJ(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 y=f(t,["toolResponse"]);y!=null&&m(e,["toolResponse"],y);let v=f(t,["partMetadata"]);return v!=null&&m(e,["partMetadata"],v),e}a(PJ,"partToMldev");function NJ(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(NJ,"safetySettingToMldev");function $J(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($J,"sessionResumptionConfigToMldev");function DJ(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"],wJ(r));let i=f(t,["googleMaps"]);i!=null&&m(e,["googleMaps"],bJ(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(DJ,"toolToMldev");function OJ(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(OJ,"getFieldMasks");function MJ(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=OJ(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(MJ,"convertBidiSetupToTokenSetup");var Oh=class Oh 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=TJ(this.apiClient,e);i=q("auth_tokens",u._url),s=u._query,delete u.config,delete u._url,delete u._query;let c=MJ(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(Oh,"Tokens");var eg=Oh;function LJ(t,e){let n={},o=f(t,["force"]);return e!==void 0&&o!=null&&m(e,["_query","force"],o),n}a(LJ,"deleteDocumentConfigToMldev");function UJ(t){let e={},n=f(t,["name"]);n!=null&&m(e,["_url","name"],n);let o=f(t,["config"]);return o!=null&&LJ(o,e),e}a(UJ,"deleteDocumentParametersToMldev");function FJ(t){let e={},n=f(t,["name"]);return n!=null&&m(e,["_url","name"],n),e}a(FJ,"getDocumentParametersToMldev");function zJ(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(zJ,"listDocumentsConfigToMldev");function GJ(t){let e={},n=f(t,["parent"]);n!=null&&m(e,["_url","parent"],n);let o=f(t,["config"]);return o!=null&&zJ(o,e),e}a(GJ,"listDocumentsParametersToMldev");function BJ(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(BJ,"listDocumentsResponseFromMldev");var Mh=class Mh 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=FJ(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=UJ(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=GJ(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=BJ(c),p=new Im;return Object.assign(p,l),p})}}};a(Mh,"Documents");var tg=Mh;var Lh=class Lh extends en{constructor(e,n=new tg(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 ui){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=L2(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=z2(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=F2(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=H2(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=J2(c),p=new Am;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=W2(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=K2(c),p=new bm;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=q2(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=B2(c),p=new wm;return Object.assign(p,l),p})}}};a(Lh,"FileSearchStores");var ng=Lh;function qJ(){return"Deno"in globalThis}a(qJ,"isDeno");var Nl;function ia(){var t,e,n,o,r,i;if(Nl)return Nl;let s=globalThis,u={};return qJ()?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:{},Nl=u,Nl}a(ia,"env");function VJ(t){var e,n,o;let r=Object.assign({},t),i=ia();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(VJ,"fillGlobals");var ZJ="2026-05-20",Uh=class Uh{constructor(e){this.options=e}getDefaultHeaders(){return this.options.defaultHeaders}async resolveGoogleGenAISecurity(e){return KJ(await this.options.getAuthHeaders(e))}};a(Uh,"GoogleGenAISecurityProvider");var rg=Uh,Fh=class Fh{beforeCreateRequest(e,n){return Object.assign(Object.assign({},n),{url:HJ(n.url)})}async beforeRequest(e,n){if(b$(n.headers,WJ(e.security_source)),jJ(e,n.headers),YJ(e,n.headers),QJ(n.headers))return n;let o=await JJ(e.security_source,n.url);return b$(n.headers,o==null?void 0:o.default_headers),XJ(n.headers,o),n}};a(Fh,"GoogleGenAIAuthHook");var og=Fh;function HJ(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(HJ,"decodeSDKLevelAPIVersionPath");async function JJ(t,e){if(p0(t))return t.resolveGoogleGenAISecurity(e);let n=typeof t=="function"?await t():t;return f0(n)?A$(n):A$(void 0)}a(JJ,"resolveSecurity$1");function WJ(t){var e,n;if(p0(t))return(n=(e=t.getDefaultHeaders)===null||e===void 0?void 0:e.call(t))!==null&&n!==void 0?n:t.defaultHeaders;if(f0(t))return t.default_headers}a(WJ,"getStaticDefaultHeaders");function A$(t){var e,n;let o=ia(),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 m0(r)?r:void 0}a(A$,"withEnvSecurity");function KJ(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 m0(r)?r:void 0}a(KJ,"securityFromHeaders");function b$(t,e){if(e)for(let[n,o]of new Headers(e))t.get(n)===null&&t.set(n,o)}a(b$,"applyDefaultHeaders");function jJ(t,e){var n;e.get("api-revision")===null&&e.set("Api-Revision",(n=t.options.api_revision)!==null&&n!==void 0?n:ZJ)}a(jJ,"applyApiRevision");function YJ(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(YJ,"applyUserProject");function XJ(t,e){if(e){if(e.api_key){t.set("x-goog-api-key",e.api_key);return}e.access_token&&t.set("Authorization",eW(e.access_token))}}a(XJ,"applyAuth");function QJ(t){return t.get("authorization")!==null||t.get("x-goog-api-key")!==null}a(QJ,"hasAuthHeaders");function eW(t){return t.slice(0,7).toLowerCase()==="bearer "?t:`Bearer ${t}`}a(eW,"bearer");function f0(t){return typeof t=="object"&&t!==null}a(f0,"isSecurity");function p0(t){return typeof t=="object"&&t!==null&&"resolveGoogleGenAISecurity"in t&&typeof t.resolveGoogleGenAISecurity=="function"}a(p0,"isSecurityResolver");function m0(t){return t.api_key!==void 0||t.access_token!==void 0||t.default_headers!==void 0}a(m0,"hasSecurityValue");var zh=class zh 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(zh,"HTTPClientError");var dr=zh,Gh=class Gh extends dr{constructor(){super(...arguments),this.name="UnexpectedClientError"}};a(Gh,"UnexpectedClientError");var Xl=Gh,Bh=class Bh extends dr{constructor(){super(...arguments),this.name="InvalidRequestError"}};a(Bh,"InvalidRequestError");var ti=Bh,qh=class qh extends dr{constructor(){super(...arguments),this.name="RequestAbortedError"}};a(qh,"RequestAbortedError");var Ql=qh,Vh=class Vh extends dr{constructor(){super(...arguments),this.name="RequestTimeoutError"}};a(Vh,"RequestTimeoutError");var ec=Vh,Zh=class Zh extends dr{constructor(){super(...arguments),this.name="ConnectionError"}};a(Zh,"ConnectionError");var tc=Zh;var Hh=class Hh 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(Hh,"GoogleGenAiError");var qt=Hh;var Jh=class Jh extends Error{};a(Jh,"GeminiNextGenAPIClientError");var ig=Jh,ra=class ra extends ig{constructor(e,n,o,r){super(ra.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&&oW(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 li({message:o,cause:n instanceof Error?n:void 0}):e===400?new ug(e,n,o,r):e===401?new lg(e,n,o,r):e===403?new cg(e,n,o,r):e===404?new dg(e,n,o,r):e===409?new fg(e,n,o,r):e===422?new pg(e,n,o,r):e===429?new mg(e,n,o,r):e>=500?new gg(e,n,o,r):new ra(e,n,o,r)}};a(ra,"APIError");var _t=ra,Wh=class Wh extends _t{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}};a(Wh,"APIUserAbortError");var sg=Wh,Kh=class Kh extends _t{constructor({message:e,cause:n}){super(void 0,void 0,e||"Connection error.",void 0),this.cause=n}};a(Kh,"APIConnectionError");var li=Kh,jh=class jh extends li{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(jh,"APIConnectionTimeoutError");var ag=jh,Yh=class Yh extends _t{};a(Yh,"BadRequestError");var ug=Yh,Xh=class Xh extends _t{};a(Xh,"AuthenticationError");var lg=Xh,Qh=class Qh extends _t{};a(Qh,"PermissionDeniedError");var cg=Qh,ey=class ey extends _t{};a(ey,"NotFoundError");var dg=ey,ty=class ty extends _t{};a(ty,"ConflictError");var fg=ty,ny=class ny extends _t{};a(ny,"UnprocessableEntityError");var pg=ny,ry=class ry extends _t{};a(ry,"RateLimitError");var mg=ry,oy=class oy extends _t{};a(oy,"InternalServerError");var gg=oy;function ni(t){return iW(t)?t:t instanceof qt?tW(t):t instanceof dr?nW(t):t}a(ni,"wrapSDKError");function tW(t){let e=rW(t),n=_t.generate(t.statusCode,e,t.message,t.headers);return ta(n,"body",t.body),ta(n,"contentType",t.contentType),ta(n,"rawResponse",t.rawResponse),ta(n,"statusCode",t.statusCode),ta(n,"cause",t),n}a(tW,"wrapAPIError");function nW(t){return t instanceof ec?new ag({message:t.message}):t instanceof Ql?new sg({message:t.message}):t instanceof tc?new li({message:t.message,cause:t}):new li({message:t.message,cause:t})}a(nW,"wrapHTTPClientError");function rW(t){let e=w$(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=w$(t,"error");return n&&typeof n=="object"?n:void 0}a(rW,"getErrorPayload");function w$(t,e){return t&&typeof t=="object"?t[e]:void 0}a(w$,"getObjectProperty");function R$(t){if(!t)return"";try{return JSON.stringify(t)}catch(e){return String(t)}}a(R$,"stringifyErrorBody");function oW(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}a(oW,"isPlainObject$2");function iW(t){return typeof t=="object"&&t!==null?_t.prototype.isPrototypeOf(t):!1}a(iW,"isCompatAPIErrorInstance");function ta(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!1})}a(ta,"defineReadonly");function sW(t){let e=new og;t.registerBeforeCreateRequestHook(e),t.registerBeforeRequestHook(e)}a(sW,"initHooks");var iy=class iy{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);sW(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(iy,"SDKHooks");var nc=iy;function k$(t){return{ok:!0,value:t}}a(k$,"OK");function Un(t){return{ok:!1,error:t}}a(Un,"ERR");function Jg(t){return btoa(String.fromCodePoint(...t))}a(Jg,"bytesToBase64");function aW(t){return new TextEncoder().encode(t)}a(aW,"stringToBytes");function uW(t){return Jg(aW(t))}a(uW,"stringToBase64");var lW=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(!lW.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 P$=["https://generativelanguage.googleapis.com"];function cW(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>=P$.length)throw new Error(`Invalid server index ${i}`);n=P$[i]||""}let r=Xe(n)(o);return new URL(r)}a(cW,"serverURLFromOptions");var dW={userAgent:"speakeasy-sdk/typescript 2.4.1-preview.4 2.911.0 v1beta @google/genai"};function fW(...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):pW(e)}}a(fW,"combineSignals");function pW(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(pW,"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 fr(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(fr,"isPlainObject$1");function mW(t){return(e,n,o)=>{let r="",i=o!=null&&o.explode?h0(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(y0(l)),"encodeValue"),c=s(t);return i.forEach(([l,p])=>{var d,g;let h="",y=null;p!=null&&(Array.isArray(p)?y=(d=_0(p,v=>`${u(v)}`))===null||d===void 0?void 0:d.join(c):fr(p)?y=(g=x0(Object.entries(p),([v,_])=>`${s(v)}${c}${u(_)}`))===null||g===void 0?void 0:g.join(c):y=`${u(p)}`,y!=null&&(h=`${s(l)}=${y}`,!(!h||h==="=")&&(r+=`&${h}`)))}),r.slice(1)}}a(mW,"formEncoder");var g0=mW(",");function hi(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,v0));return n!=null&&n.explode?r:`${o(t)}=${r}`}a(hi,"encodeJSON");var Ae=a((t,e,n)=>{let o="",r=n!=null&&n.explode?h0(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(y0(u)),"encodeValue");return r.forEach(([u,c])=>{var l;let p="";if(c!=null){if(Array.isArray(c))p=(l=_0(c,d=>`${s(d)}`))===null||l===void 0?void 0:l.join(",");else if(fr(c)){let d=x0(Object.entries(c),([g,h])=>`,${i(g)},${s(h)}`);p=d==null?void 0:d.join("").slice(1)}else p=`${n!=null&&n.explode&&fr(e)?`${u}=`:""}${s(c)}`;o+=p?`,${p}`:""}}),o.slice(1)},"encodeSimple");function h0(t,e){if(Array.isArray(e))return e.map(n=>[t,n]);if(fr(e)){let n=e!=null?e:{};return Object.entries(n).map(([o,r])=>[o,r])}else return[[t,e]]}a(h0,"explode");function y0(t){return t==null?"":t instanceof Date?t.toISOString():t instanceof Uint8Array?Jg(t):typeof t=="object"?JSON.stringify(t,v0):`${t}`}a(y0,"serializeValue");function v0(t,e){return e instanceof Uint8Array?Jg(e):e}a(v0,"jsonReplacer");function _0(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(_0,"mapDefined");function x0(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(x0,"mapDefinedEntries");function gW(...t){return t.filter(Boolean).join("&")}a(gW,"queryJoin");function hW(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 gW(...l)},"bulkEncode")}a(hW,"queryEncoder");var xc=hW(g0);var yW=a((t,e)=>e==null?fetch(t):fetch(t,e),"DEFAULT_FETCHER"),fc=class fc{constructor(e={}){this.options=e,this.requestHooks=[],this.requestErrorHooks=[],this.responseHooks=[],this.fetcher=e.fetcher||yW}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 fc(this.options);return e.requestHooks=this.requestHooks.slice(),e.requestErrorHooks=this.requestErrorHooks.slice(),e.responseHooks=this.responseHooks.slice(),e}};a(fc,"HTTPClient");var hg=fc,N$=/\s*;\s*/g;function Qo(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(N$),[i="",...s]=r;if(i.split("/").length!==2)return!1;let u=o.split(N$),[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(Qo,"matchContentType");var vW=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(!vW.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 _W(t,e,n){return Je(t,e)&&Qo(t,n)}a(_W,"matchResponse");function E0(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(E0,"isConnectionError");function S0(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(S0,"isTimeoutError");function xW(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(xW,"isAbortError");var $$={initialInterval:500,maxInterval:6e4,exponent:1.5,maxElapsedTime:36e5},pc=class pc 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,pc.prototype)}};a(pc,"PermanentError");var sa=pc,mc=class mc extends Error{constructor(e,n){super(e),this.response=n,this.name="TemporaryError",Object.setPrototypeOf(this,mc.prototype)}};a(mc,"TemporaryError");var pr=mc;async function EW(t,e){var n;switch(e.config.strategy){case"backoff":return TW(D$(t,{statusCodes:e.statusCodes,retryConnectionErrors:!!e.config.retryConnectionErrors}),(n=e.config.backoff)!==null&&n!==void 0?n:$$);case"attempt-count-backoff":return IW(D$(t,{statusCodes:e.statusCodes,retryConnectionErrors:!!e.config.retryConnectionErrors}),Object.assign(Object.assign({},$$),e.config.backoff),e.config);default:return await t(0)}}a(EW,"retry");function D$(t,e){return async n=>{try{let o=await t(n);if(CW(o,e.statusCodes))throw new pr("Response failed with retryable status code",o);return o}catch(o){throw o instanceof pr||e.retryConnectionErrors&&(S0(o)||E0(o))?o:new sa("Permanent error",{cause:o})}}}a(D$,"wrapFetcher");var SW=new RegExp("^[0-9]xx$","i");function CW(t,e){let n=`${t.status}`;return e.some(o=>{if(!SW.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(CW,"isRetryableResponse");async function TW(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 sa)throw c.cause;if(Date.now()-s>n){if(c instanceof pr)return c.response;throw c}let p=0;c instanceof pr&&(p=C0(c.response)),p<=0&&(p=o*Math.pow(u,r)+Math.random()*1e3);let d=Math.min(p,i);await T0(d),u++}}a(TW,"retryBackoff");async function IW(t,e,n){let o=0;for(;;)try{return await t(o)}catch(r){if(r instanceof sa)throw r.cause;if(o>=n.maxRetries){if(r instanceof pr)return r.response;throw r}let i=0;r instanceof pr&&(i=C0(r.response)),i<=0&&(i=e.initialInterval*Math.pow(e.exponent,o)*(1-Math.random()*.25));let s=Math.min(i,e.maxInterval);await T0(s),o++}}a(IW,"retryAttemptCountBackoff");function C0(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(C0,"retryIntervalFromResponse");async function T0(t){return new Promise(e=>setTimeout(e,t))}a(T0,"delay");var $l=typeof globalThis>"u"?null:globalThis,AW=typeof $l=="object"&&$l!=null&&"importScripts"in $l&&typeof $l.importScripts=="function",bW=AW||typeof navigator<"u"&&"serviceWorker"in navigator||typeof window=="object"&&typeof window.document<"u",sy=class sy{constructor(e={}){let n=e;typeof n=="object"&&n!=null&&"hooks"in n&&n.hooks instanceof nc?this._hooks=n.hooks:this._hooks=new nc;let o=new hg;e.http_client=e.http_client||o,e=this._hooks.sdkInit(e);let r=cW(e);r&&(r.pathname=r.pathname.replace(/\/+$/,"")+"/"),this._baseURL=r,this._httpClient=e.http_client||o,this._options=Object.assign(Object.assign({},VJ(e)),{hooks:this._hooks}),this._logger=this._options.debug_logger,!this._logger&&ia().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,y=(r=n.baseURL)!==null&&r!==void 0?r:this._baseURL;if(!y)return Un(new ti("No base URL provided for operation"));let v=new URL(y),_;p?(v.pathname=v.pathname.replace(/\/+$/,"")+"/",_=new URL(p,v),!_.search&&v.search&&(_.search=v.search)):_=v,_.hash="";let x=a((N,O)=>{if(!O)return N;let X=new Set(O.split("&").filter(we=>we!=="").map(we=>{var fe;return(fe=we.split("=")[0])!==null&&fe!==void 0?fe:""}));return[...N.split("&").filter(we=>{var fe;return we!==""&&!X.has((fe=we.split("=")[0])!==null&&fe!==void 0?fe:"")}),O].join("&")},"mergeQuery"),E=a(N=>Object.entries(N).map(([O,X])=>{if(X==null)return;let be=fr(X)?JSON.stringify(X):X;return g0(O,be,{explode:Array.isArray(be),charEncoding:"percent"})}).filter(O=>typeof O<"u").join("&"),"encodeQueryRecord"),C=[d||"",E((o==null?void 0:o.extra_query)||{}),E((h==null?void 0:h.queryParams)||{})].reduce(x,_.search.slice(1));C&&(_.search=`?${C}`);let S=new Headers(g),T=h==null?void 0:h.basic.username,b=h==null?void 0:h.basic.password;if(T!=null||b!=null){let N=uW([T||"",b||""].join(":"));S.set("Authorization",`Basic ${N}`)}let R=new Headers((h==null?void 0:h.headers)||{});for(let[N,O]of R)S.set(N,O);let B=S.get("cookie")||"";for(let[N,O]of Object.entries((h==null?void 0:h.cookies)||{}))B+=`; ${N}=${O}`;B=B.startsWith("; ")?B.slice(2):B,S.set("cookie",B);let P=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[N,O]of P)S.set(N,O);bW||S.set((u=n.uaHeader)!==null&&u!==void 0?u:"user-agent",(c=n.userAgent)!==null&&c!==void 0?c:dW.userAgent);let V=n.body,de=Object.fromEntries(Object.entries((o==null?void 0:o.extra_body)||{}).filter(([,N])=>typeof N<"u"));if(Object.keys(de).length>0){let N=new Headers(g).get("content-type")||"";if(!/^(application|text)\/([^+]+\+)*json/.test(N)||typeof V!="string"&&V!=null)return Un(new ti("extra_body can only be merged into JSON object request bodies"));let X;try{X=V?JSON.parse(V):{}}catch(be){return Un(new ti("extra_body can only be merged into JSON object request bodies",{cause:be}))}if(!fr(X))return Un(new ti("extra_body can only be merged into JSON object request bodies"));V=JSON.stringify(Object.assign(Object.assign({},X),de)),S.delete("content-length")}let Ce=Object.assign(Object.assign({},o==null?void 0:o.fetch_options),o);!(Ce!=null&&Ce.signal)&&n.timeout_ms!=null&&n.timeout_ms>0&&(e.timeout_ms=n.timeout_ms),n.body instanceof ReadableStream&&Object.assign(Ce,{duplex:"half"});let De;try{De=this._hooks.beforeCreateRequest(e,{url:_,options:Object.assign(Object.assign({},Ce),{body:V!=null?V:null,headers:S,method:l})})}catch(N){return Un(new Xl("Create request hook failed to execute",{cause:N}))}return k$(new Request(De.url,De.options))}async _do(e,n){let{context:o,isErrorStatusCode:r}=n,i=o.timeout_ms;return EW(async()=>{var s;let u=e.clone(),c=u;if(i!=null&&i>0){let d=AbortSignal.timeout(i),g=(s=fW(u.signal,d))!==null&&s!==void 0?s:d;c=new Request(u,{signal:g})}let l=await this._hooks.beforeRequest(o,c);await wW(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 RW(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=>k$(s),s=>{switch(!0){case xW(s):return Un(new Ql("Request aborted by client",{cause:s}));case S0(s):return Un(new ec("Request timed out",{cause:s}));case E0(s):return Un(new tc("Unable to make request",{cause:s}));default:return Un(new Xl("Unexpected HTTP client error",{cause:s}))}})}};a(sy,"ClientSDK");var ci=sy,I0=/^(application|text)\/([^+]+\+)*json.*/,O$=/^(application|text)\/([^+]+\+)*(jsonl|x-ndjson)\b.*/;async function wW(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 I0.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(wW,"logRequest");async function RW(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(Qo(e,"application/json")||I0.test(r)&&!O$.test(r)):t.log(await e.clone().json());break;case(Qo(e,"application/jsonl")||O$.test(r)):case Qo(e,"text/event-stream"):t.log(`<${o}>`);break;case Qo(e,"text/*"):t.log(await e.clone().text());break;case Qo(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(RW,"logResponse");var ay=class ay 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(ay,"GoogleGenAiDefaultError");var rc=ay;function M$(t){try{return JSON.parse(t)}catch(e){return t}}a(M$,"tryParseJson");function kW(t,e={}){var n,o;let r=e.flattened===!0,i=(n=e.sentinel)!==null&&n!==void 0?n:"";return new yg(t,s=>i!==""&&s.data===i?{done:!0,value:void 0}:r?{done:!1,value:s.data==null?void 0:M$(s.data)}:{done:!1,value:Object.assign(Object.assign({},s),{data:s.data==null?s.data:M$(s.data)})},{dataRequired:(o=e.dataRequired)!==null&&o!==void 0?o:!0})}a(kW,"wrapEventStreamResponse");var uy=class uy 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=NW(s,u,c);if(!g){c=Math.max(0,u-PW+1);let v=await i.read();if(v.done)return d.close();if(u+v.value.length>s.length){let _=new Uint8Array(Math.max(s.length*2,u+v.value.length));_.set(s.subarray(0,u)),s=_}s.set(v.value,u),u+=v.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 v=new Uint8Array(Math.max(4096,u*2));v.set(s.subarray(0,u)),s=v}c=0;let y=$W(h,n,l,p);if(y&&!y.done)return d.enqueue(y.value);if(y!=null&&y.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(uy,"Stream");var yg=uy,Gt=13,Bt=10,A0=[[Gt,Bt,Gt,Bt],[Gt,Bt,Gt],[Gt,Bt,Bt],[Gt,Gt,Bt],[Bt,Gt,Bt],[Gt,Gt],[Bt,Gt],[Bt,Bt]],PW=A0.reduce((t,e)=>Math.max(t,e.length),0);function NW(t,e,n){for(let o=n;o<e;o++)if(!(t[o]!==Gt&&t[o]!==Bt))for(let r of A0){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(NW,"findBoundary");function $W(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($W,"parseMessage");var DW={jsonl:"application/jsonl",json:"application/json",text:"text/plain",bytes:"application/octet-stream",stream:"application/octet-stream",sse:"text/event-stream",nil:"*",fail:"*"};function mr(t,e,n){return Object.assign(Object.assign({},n),{err:!0,enc:"json",codes:t,errorClass:e})}a(mr,"jsonErr");function xt(t,e){return Object.assign(Object.assign({},e),{enc:"json",codes:t})}a(xt,"json");function b0(t,e,n){return Object.assign(Object.assign(Object.assign({},n),{enc:"sse",codes:t}),e?{sse:e}:{})}a(b0,"sse");function OW(t,e){return Object.assign(Object.assign({},e),{enc:"nil",codes:t})}a(OW,"nil");function Ne(t){return{enc:"fail",codes:t}}a(Ne,"fail");function st(...t){return a(async function(n,o,r){let i,s;for(let g of t){let{codes:h}=g,y="ctype"in g?g.ctype:DW[g.enc];if(y&&_W(n,h,y)){s=g;break}else if(!y&&Je(n,h)){s=g;break}}if(!s)return[{ok:!1,error:new rc("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=kW(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 rc("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:LW(n.headers)}:null;return"err"in s?p=Object.assign(Object.assign(Object.assign({},r==null?void 0:r.extraFields),d),fr(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),fr(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 MW=/, */;function LW(t){let e={};for(let[n,o]of t.entries())e[n]=o.split(MW);return e}a(LW,"unpackHeaders");var oc;(function(t){t.Incomplete="incomplete",t.UnrecognisedSecurityType="unrecognized_security_type"})(oc||(oc={}));var oa=class oa extends Error{constructor(e,n){super(n),this.code=e,this.name="SecurityError"}static incomplete(){return new oa(oc.Incomplete,"Security requirements not met in order to perform the operation")}static unrecognizedType(e){return new oa(oc.UnrecognisedSecurityType,`Unrecognised security type: ${e}`)}};a(oa,"SecurityError");var vg=oa;function UW(...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":FW(e,o);break;case"http:custom":break;case"http:bearer":Dl(e,o);break;case"oauth2":Dl(e,o);break;case"oauth2:password":Dl(e,o);break;case"oauth2:client_credentials":break;case"openIdConnect":Dl(e,o);break;default:throw vg.unrecognizedType(r)}}),e)}a(UW,"resolveSecurity");function FW(t,e){e.value!=null&&(t.basic=e.value)}a(FW,"applyBasic");function Dl(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(Dl,"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:ia().GOOGLE_GENAI_API_KEY},{fieldName:"accessToken",type:"http:custom",value:(o=t==null?void 0:t.access_token)!==null&&o!==void 0?o:ia().GOOGLE_GENAI_ACCESS_TOKEN},{fieldName:"defaultHeaders",type:"http:custom",value:t==null?void 0:t.default_headers}]];return UW(...r)}a(at,"resolveGlobalSecurity");async function ut(t){if(t!=null)return typeof t=="function"?t():t}a(ut,"extractSecurity");var w0,gc=class gc{constructor(e,n){this[w0]="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 gc(o,(n=this._callSource)!==null&&n!==void 0?n:void 0)}};a(gc,"APIPromise");var qe=gc;w0=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 qe(n,o)}a(ot,"unwrapAsAPIPromise");function R0(t,e,n,o){return new qe(zW(t,e,n,o))}a(R0,"agentsCreate");async function zW(t,e,n,o){var r,i,s;let c={body:e,api_version:n},l=hi("body",c.body,{explode:!0}),p={api_version:Ae("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),y=at(h),v={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: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"]},_=t._createRequest(v,{security:y,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:v,isErrorStatusCode:a(T=>Je({status:T},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:v.retry_config,retryCodes:v.retry_codes});if(!E.ok)return[E,{status:"request-error",request:x}];let C=E.value,[S]=await st(Ne("4XX"),Ne("5XX"),xt("default"))(C,x);return S.ok?[S,{status:"complete",request:x,response:C}]:[S,{status:"complete",request:x,response:C}]}a(zW,"$do$e");function k0(t,e,n,o){return new qe(GW(t,e,n,o))}a(k0,"agentsDelete");async function GW(t,e,n,o){var r,i,s;let c={id:e,api_version:n},l=null,p={api_version:Ae("api_version",(r=c.api_version)!==null&&r!==void 0?r:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ae("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),y=at(h),v={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: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"]},_=t._createRequest(v,{security:y,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:v,isErrorStatusCode:a(T=>Je({status:T},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:v.retry_config,retryCodes:v.retry_codes});if(!E.ok)return[E,{status:"request-error",request:x}];let C=E.value,[S]=await st(Ne("4XX"),Ne("5XX"),xt("default"))(C,x);return S.ok?[S,{status:"complete",request:x,response:C}]:[S,{status:"complete",request:x,response:C}]}a(GW,"$do$d");function P0(t,e,n,o){return new qe(BW(t,e,n,o))}a(P0,"agentsGet");async function BW(t,e,n,o){var r,i,s;let c={id:e,api_version:n},l=null,p={api_version:Ae("api_version",(r=c.api_version)!==null&&r!==void 0?r:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ae("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),y=at(h),v={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: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"]},_=t._createRequest(v,{security:y,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:v,isErrorStatusCode:a(T=>Je({status:T},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:v.retry_config,retryCodes:v.retry_codes});if(!E.ok)return[E,{status:"request-error",request:x}];let C=E.value,[S]=await st(Ne("4XX"),Ne("5XX"),xt("default"))(C,x);return S.ok?[S,{status:"complete",request:x,response:C}]:[S,{status:"complete",request:x,response:C}]}a(BW,"$do$c");function N0(t,e,n,o,r,i){return new qe(qW(t,e,n,o,r,i))}a(N0,"agentsList");async function qW(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:Ae("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),y=xc({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}),v=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"]},C=t._createRequest(E,{security:x,method:"GET",baseURL:i==null?void 0:i.server_url,path:h,headers:v,query:y,body:d,userAgent:t._options.user_agent,timeout_ms:(i==null?void 0:i.timeout_ms)||t._options.timeout_ms||-1},i);if(!C.ok)return[C,{status:"invalid"}];let S=C.value,T=await t._do(S,{context:E,isErrorStatusCode:a(B=>Je({status:B},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:E.retry_config,retryCodes:E.retry_codes});if(!T.ok)return[T,{status:"request-error",request:S}];let b=T.value,[R]=await st(Ne("4XX"),Ne("5XX"),xt("default"))(b,S);return R.ok?[R,{status:"complete",request:S,response:b}]:[R,{status:"complete",request:S,response:b}]}a(qW,"$do$b");var ly=class ly extends ci{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(N0(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(P0(this,e,n==null?void 0:n.api_version,o))}delete(e,n,o){return ot(k0(this,e,n==null?void 0:n.api_version,o))}};a(ly,"Agents");var _g=ly;var cy=class cy 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(cy,"CancelInteractionByIdServerError");var xg=cy,dy=class dy 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(dy,"CancelInteractionByIdClientError");var Eg=dy;var fy=class fy 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(fy,"CreateInteractionServerError");var Sg=fy,py=class py 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(py,"CreateInteractionClientError");var Cg=py;var my=class my 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(my,"DeleteInteractionServerError");var Tg=my,gy=class gy 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(gy,"DeleteInteractionClientError");var Ig=gy;var hy=class hy 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(hy,"GetInteractionByIdServerError");var Ag=hy,yy=class yy 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(yy,"GetInteractionByIdClientError");var bg=yy;function $0(t,e,n,o){return new qe(VW(t,e,n,o))}a($0,"interactionsCancel");async function VW(t,e,n,o){var r,i,s;let c={id:e,api_version:n},l=null,p={api_version:Ae("api_version",(r=c.api_version)!==null&&r!==void 0?r:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ae("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),y=at(h),v={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: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"]},_=t._createRequest(v,{security:y,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:v,isErrorStatusCode:a(b=>Je({status:b},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:v.retry_config,retryCodes:v.retry_codes});if(!E.ok)return[E,{status:"request-error",request:x}];let C=E.value,S={httpMeta:{response:C,request:x}},[T]=await st(xt(200),mr("4XX",Eg),mr("5XX",xg))(C,x,{extraFields:S});return T.ok?[T,{status:"complete",request:x,response:C}]:[T,{status:"complete",request:x,response:C}]}a(VW,"$do$a");function D0(t,e,n,o){return new qe(ZW(t,e,n,o))}a(D0,"interactionsCreate");async function ZW(t,e,n,o){var r,i,s,u;let c={body:e,api_version:n},l=c,p=hi("body",l.body,{explode:!0}),d={api_version:Ae("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"})),y=await ut(t._options.security),v=at(y),_={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: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"]},x=t._createRequest(_,{security:v,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,C=await t._do(E,{context:_,isErrorStatusCode:a(R=>Je({status:R},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:_.retry_config,retryCodes:_.retry_codes});if(!C.ok)return[C,{status:"request-error",request:E}];let S=C.value,T={httpMeta:{response:S,request:E}},[b]=await st(xt(200),b0(200,{sentinel:"[DONE]",flattened:!0}),mr("4XX",Cg),mr("5XX",Sg))(S,E,{extraFields:T});return b.ok?[b,{status:"complete",request:E,response:S}]:[b,{status:"complete",request:E,response:S}]}a(ZW,"$do$9");function HW(t,e,n,o){return new qe(JW(t,e,n,o))}a(HW,"interactionsDelete");async function JW(t,e,n,o){var r,i,s;let c={id:e,api_version:n},l=null,p={api_version:Ae("api_version",(r=c.api_version)!==null&&r!==void 0?r:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ae("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),y=at(h),v={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: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"]},_=t._createRequest(v,{security:y,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:v,isErrorStatusCode:a(b=>Je({status:b},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:v.retry_config,retryCodes:v.retry_codes});if(!E.ok)return[E,{status:"request-error",request:x}];let C=E.value,S={httpMeta:{response:C,request:x}},[T]=await st(OW(200),mr("4XX",Ig),mr("5XX",Tg))(C,x,{extraFields:S});return T.ok?[T,{status:"complete",request:x,response:C}]:[T,{status:"complete",request:x,response:C}]}a(JW,"$do$8");function O0(t,e,n,o,r,i,s){return new qe(WW(t,e,n,o,r,i,s))}a(O0,"interactionsGet");async function WW(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:Ae("api_version",(u=d.api_version)!==null&&u!==void 0?u:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ae("id",d.id,{explode:!1,charEncoding:"percent"})},y=Xe("/{api_version}/interactions/{id}")(h),v=xc({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),C={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(C,{security:E,method:"GET",baseURL:s==null?void 0:s.server_url,path:y,headers:_,query:v,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 T=S.value,b=await t._do(T,{context:C,isErrorStatusCode:a(V=>Je({status:V},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:C.retry_config,retryCodes:C.retry_codes});if(!b.ok)return[b,{status:"request-error",request:T}];let R=b.value,B={httpMeta:{response:R,request:T}},[P]=await st(xt(200),b0(200,{sentinel:"[DONE]",flattened:!0}),mr("4XX",bg),mr("5XX",Ag))(R,T,{extraFields:B});return P.ok?[P,{status:"complete",request:T,response:R}]:[P,{status:"complete",request:T,response:R}]}a(WW,"$do$7");var vy=class vy extends ci{create(e,n){let{api_version:o}=e,r=Qt(e,["api_version"]);return ot(D0(this,r,o,n))}get(e,n,o){return ot(O0(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(HW(this,e,n==null?void 0:n.api_version,o))}cancel(e,n,o){return ot($0(this,e,n==null?void 0:n.api_version,o))}};a(vy,"Interactions");var wg=vy;function M0(t,e,n,o){return new qe(KW(t,e,n,o))}a(M0,"webhooksCreate");async function KW(t,e,n,o){var r,i,s;let c={body:e,api_version:n},l=hi("body",c.body,{explode:!0}),p={api_version:Ae("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),y=at(h),v={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: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"]},_=t._createRequest(v,{security:y,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:v,isErrorStatusCode:a(T=>Je({status:T},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:v.retry_config,retryCodes:v.retry_codes});if(!E.ok)return[E,{status:"request-error",request:x}];let C=E.value,[S]=await st(Ne("4XX"),Ne("5XX"),xt("default"))(C,x);return S.ok?[S,{status:"complete",request:x,response:C}]:[S,{status:"complete",request:x,response:C}]}a(KW,"$do$6");function L0(t,e,n,o){return new qe(jW(t,e,n,o))}a(L0,"webhooksDelete");async function jW(t,e,n,o){var r,i,s;let c={id:e,api_version:n},l=null,p={api_version:Ae("api_version",(r=c.api_version)!==null&&r!==void 0?r:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ae("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),y=at(h),v={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: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"]},_=t._createRequest(v,{security:y,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:v,isErrorStatusCode:a(T=>Je({status:T},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:v.retry_config,retryCodes:v.retry_codes});if(!E.ok)return[E,{status:"request-error",request:x}];let C=E.value,[S]=await st(Ne("4XX"),Ne("5XX"),xt("default"))(C,x);return S.ok?[S,{status:"complete",request:x,response:C}]:[S,{status:"complete",request:x,response:C}]}a(jW,"$do$5");function U0(t,e,n,o){return new qe(YW(t,e,n,o))}a(U0,"webhooksGet");async function YW(t,e,n,o){var r,i,s;let c={id:e,api_version:n},l=null,p={api_version:Ae("api_version",(r=c.api_version)!==null&&r!==void 0?r:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ae("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),y=at(h),v={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: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"]},_=t._createRequest(v,{security:y,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:v,isErrorStatusCode:a(T=>Je({status:T},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:v.retry_config,retryCodes:v.retry_codes});if(!E.ok)return[E,{status:"request-error",request:x}];let C=E.value,[S]=await st(Ne("4XX"),Ne("5XX"),xt("default"))(C,x);return S.ok?[S,{status:"complete",request:x,response:C}]:[S,{status:"complete",request:x,response:C}]}a(YW,"$do$4");function F0(t,e,n,o,r){return new qe(XW(t,e,n,o,r))}a(F0,"webhooksList");async function XW(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:Ae("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=xc({page_size:l==null?void 0:l.page_size,page_token:l==null?void 0:l.page_token}),y=new Headers(it({Accept:"application/json"})),v=await ut(t._options.security),_=at(v),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:y,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 C=E.value,S=await t._do(C,{context:x,isErrorStatusCode:a(R=>Je({status:R},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:x.retry_config,retryCodes:x.retry_codes});if(!S.ok)return[S,{status:"request-error",request:C}];let T=S.value,[b]=await st(Ne("4XX"),Ne("5XX"),xt("default"))(T,C);return b.ok?[b,{status:"complete",request:C,response:T}]:[b,{status:"complete",request:C,response:T}]}a(XW,"$do$3");function z0(t,e,n,o,r){return new qe(QW(t,e,n,o,r))}a(z0,"webhooksPing");async function QW(t,e,n,o,r){var i,s,u;let l={id:e,api_version:n,body:o},p=hi("body",l.body,{explode:!0}),d={api_version:Ae("api_version",(i=l.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ae("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"})),y=await ut(t._options.security),v=at(y),_={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:v,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:v,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,C=await t._do(E,{context:_,isErrorStatusCode:a(b=>Je({status:b},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:_.retry_config,retryCodes:_.retry_codes});if(!C.ok)return[C,{status:"request-error",request:E}];let S=C.value,[T]=await st(Ne("4XX"),Ne("5XX"),xt("default"))(S,E);return T.ok?[T,{status:"complete",request:E,response:S}]:[T,{status:"complete",request:E,response:S}]}a(QW,"$do$2");function G0(t,e,n,o,r){return new qe(eK(t,e,n,o,r))}a(G0,"webhooksRotateSigningSecret");async function eK(t,e,n,o,r){var i,s,u;let l={id:e,api_version:n,body:o},p=hi("body",l.body,{explode:!0}),d={api_version:Ae("api_version",(i=l.api_version)!==null&&i!==void 0?i:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ae("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"})),y=await ut(t._options.security),v=at(y),_={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:v,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:v,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,C=await t._do(E,{context:_,isErrorStatusCode:a(b=>Je({status:b},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:_.retry_config,retryCodes:_.retry_codes});if(!C.ok)return[C,{status:"request-error",request:E}];let S=C.value,[T]=await st(Ne("4XX"),Ne("5XX"),xt("default"))(S,E);return T.ok?[T,{status:"complete",request:E,response:S}]:[T,{status:"complete",request:E,response:S}]}a(eK,"$do$1");function B0(t,e,n,o,r,i){return new qe(tK(t,e,n,o,r,i))}a(B0,"webhooksUpdate");async function tK(t,e,n,o,r,i){var s,u,c;let p={id:e,api_version:n,update_mask:o,body:r},d=hi("body",p.body,{explode:!0}),g={api_version:Ae("api_version",(s=p.api_version)!==null&&s!==void 0?s:t._options.api_version,{explode:!1,charEncoding:"percent"}),id:Ae("id",p.id,{explode:!1,charEncoding:"percent"})},h=Xe("/{api_version}/webhooks/{id}")(g),y=xc({update_mask:p.update_mask}),v=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"]},C=t._createRequest(E,{security:x,method:"PATCH",baseURL:i==null?void 0:i.server_url,path:h,headers:v,query:y,body:d,userAgent:t._options.user_agent,timeout_ms:(i==null?void 0:i.timeout_ms)||t._options.timeout_ms||-1},i);if(!C.ok)return[C,{status:"invalid"}];let S=C.value,T=await t._do(S,{context:E,isErrorStatusCode:a(B=>Je({status:B},["4XX","5XX"]),"isErrorStatusCode"),retryConfig:E.retry_config,retryCodes:E.retry_codes});if(!T.ok)return[T,{status:"request-error",request:S}];let b=T.value,[R]=await st(Ne("4XX"),Ne("5XX"),xt("default"))(b,S);return R.ok?[R,{status:"complete",request:S,response:b}]:[R,{status:"complete",request:S,response:b}]}a(tK,"$do");var _y=class _y extends ci{create(e,n){let{api_version:o}=e,r=Qt(e,["api_version"]);return ot(M0(this,r,o,n))}list(e,n){return ot(F0(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(U0(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(B0(this,e,i,s,c,o))}delete(e,n,o){return ot(L0(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(z0(this,e,n,o,r))}};a(_y,"Webhooks");var Rg=_y;var si,nK=(si=class extends ci{get interactions(){var e;return(e=this._interactions)!==null&&e!==void 0?e:this._interactions=new wg(this._options)}get webhooks(){var e;return(e=this._webhooks)!==null&&e!==void 0?e:this._webhooks=new Rg(this._options)}get agents(){var e;return(e=this._agents)!==null&&e!==void 0?e:this._agents=new _g(this._options)}},a(si,"GoogleGenAI"),si);var rK=new Set(["lyria-3-pro-preview","lyria-3-clip-preview"]);function oK(t){let e=t.getBaseUrl();if(!e)throw new Error("Base URL must be set.");return e.replace(/\/+$/,"")}a(oK,"getGoogleGenAIServerURL");function iK(t){let e=sK(t.getApiVersion()),n=t.getProject(),o=t.getLocation();return t.isVertexAI()&&e&&n&&o?`${e}/projects/${encodeURIComponent(n)}/locations/${encodeURIComponent(o)}`:e}a(iK,"getGoogleGenAIAPIVersion");function di(t,e={}){var n,o,r,i;return new nK(Object.assign(Object.assign({},e),{api_version:(n=e.api_version)!==null&&n!==void 0?n:iK(t),security:(o=e.security)!==null&&o!==void 0?o:new rg({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:oK(t)}))}a(di,"buildGoogleGenAIClient");var xy=class xy{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 pm(()=>this.getClient(o).interactions.create(Object.assign(Object.assign({},r),{stream:!0,api_version:o}),He(n,!0)));return U$(s)}let i=await yt(D0(this.getClient(o),r,o,He(n)));return mm(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 pm(()=>this.getClient(r).interactions.get(e,{stream:i,last_event_id:s,include_input:u,api_version:r},He(o,!0)));return U$(l)}let c=await yt(O0(this.getClient(r),e,i,s,u,r,He(o)));return mm(c)}async delete(e,n={},o){return pm(()=>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 mm(await yt($0(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?di(this.parentClient,{api_version:e}):((n=this.sdk)!==null&&n!==void 0||(this.sdk=di(this.parentClient)),this.sdk)}};a(xy,"GeminiNextGenInteractions");var kg=xy,Ey=class Ey{constructor(e){this.parentClient=e}async create(e={},n){let o=e!=null?e:{},{api_version:r}=o,i=Qt(o,["api_version"]);return yt(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 yt(N0(this.getClient(o),o,r,i,s,He(n)))}async get(e,n={},o){return yt(P0(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 yt(k0(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?di(this.parentClient,{api_version:e}):((n=this.sdk)!==null&&n!==void 0||(this.sdk=di(this.parentClient)),this.sdk)}};a(Ey,"GeminiNextGenAgents");var Pg=Ey,Sy=class Sy{constructor(e){this.parentClient=e}async create(e,n){let{api_version:o}=e,r=Qt(e,["api_version"]);return yt(M0(this.getClient(),r,o,He(n)))}async list(e={},n){let{api_version:o,page_size:r,page_token:i}=e!=null?e:{};return yt(F0(this.getClient(),o,r,i,He(n)))}async get(e,n={},o){return yt(U0(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 yt(B0(this.getClient(),e,i,s,u,He(o)))}async delete(e,n={},o){return yt(L0(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 yt(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 yt(z0(this.getClient(),e,r,i,He(o)))}getClient(){var e;return(e=this.sdk)!==null&&e!==void 0||(this.sdk=di(this.parentClient)),this.sdk}};a(Sy,"GeminiNextGenWebhooks");var Ng=Sy;function sK(t){return t.replace(/^\/+|\/+$/g,"")}a(sK,"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"]),y=Object.assign({},h);ic(p)?y.extra_query=p:L$("query",p),ic(d)?y.extra_body=d:L$("body",d);let v=(n=h.fetch_options)!==null&&n!==void 0?n:g;v&&(y.fetch_options=v);let _=(o=h.server_url)!==null&&o!==void 0?o:l;_&&(y.server_url=_);let x=(r=h.timeout_ms)!==null&&r!==void 0?r:u;if(x!==void 0&&(y.timeout_ms=x),c!==void 0&&(y.retries={strategy:"attempt-count-backoff",retryConnectionErrors:!0,maxRetries:c}),e){let E=new Headers((i=y.headers)!==null&&i!==void 0?i:v==null?void 0:v.headers);E.set("Accept","text/event-stream"),y.headers=E}return y}a(He,"toGoogleGenAIRequestOptions");function L$(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(L$,"warnIgnoredOption");async function yt(t){let[e,n]=await t.$inspect();if(!e.ok)throw ni(e.error);return aK(e.value,n)}a(yt,"unwrapWithSdkHttpResponse");async function pm(t){try{return await t()}catch(e){throw ni(e)}}a(pm,"wrapSDKCall");function U$(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 ni(u)}},async return(s){if(!i.return)return{done:!0,value:s};try{return await i.return(s)}catch(u){throw ni(u)}},async throw(s){if(!i.throw)throw ni(s);try{return await i.throw(s)}catch(u){throw ni(u)}},[Symbol.asyncIterator](){return this}}},"wrappedAsyncIterator")}})}a(U$,"wrapStreamErrors");function aK(t,e){return!ic(t)||e.status!=="complete"?t:Object.assign(Object.assign({},t),{sdkHttpResponse:uK(e.response,t)})}a(aK,"attachSdkHttpResponse");function uK(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(uK,"createSdkHttpResponse");function mm(t){let e=lK(t);return e?dK(e):t}a(mm,"addOutputPropertiesIfInteraction");function lK(t){if(ic(t)){if(Array.isArray(t.steps))return t;if(cK(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(lK,"normalizeInteractionShape");function cK(t){let e=t.model;return typeof e=="string"&&rK.has(e)}a(cK,"isLegacyLyriaInteraction");function ic(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(ic,"isPlainObject");function dK(t){var e,n;let o=fK(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 y=h.length-1;y>=0;y--){let v=h[y];if(v.type==="text")s=!0,i.push((n=v.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 y=g.content[h];y.type==="image"&&!u&&(u=y),y.type==="audio"&&!c&&(c=y),y.type==="video"&&!l&&(l=y)}}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(dK,"addOutputProperties");function fK(t){return Object.assign(Object.assign({},t),{created:F$(t.created),updated:F$(t.updated)})}a(fK,"normalizeInteractionDates");function F$(t){return t instanceof Date?t.toISOString():t}a(F$,"normalizeDateLike");function pK(t,e){let n={},o=f(t,["name"]);return o!=null&&m(n,["_url","name"],o),n}a(pK,"cancelTuningJobParametersToMldev");function mK(t,e){let n={},o=f(t,["name"]);return o!=null&&m(n,["_url","name"],o),n}a(mK,"cancelTuningJobParametersToVertex");function gK(t,e){let n={},o=f(t,["sdkHttpResponse"]);return o!=null&&m(n,["sdkHttpResponse"],o),n}a(gK,"cancelTuningJobResponseFromMldev");function hK(t,e){let n={},o=f(t,["sdkHttpResponse"]);return o!=null&&m(n,["sdkHttpResponse"],o),n}a(hK,"cancelTuningJobResponseFromVertex");function yK(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(yK,"codeExecutionResultToVertex");function $g(t,e){let n={},o=f(t,["parts"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>PK(s))),m(n,["parts"],i)}let r=f(t,["role"]);return r!=null&&m(n,["role"],r),n}a($g,"contentToVertex");function vK(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(vK,"createTuningJobConfigToMldev");function _K(t,e,n){let o={},r=f(n,["config","method"]);if(r===void 0&&(r="SUPERVISED_FINE_TUNING"),r==="SUPERVISED_FINE_TUNING"){let N=f(t,["validationDataset"]);e!==void 0&&N!=null&&m(e,["supervisedTuningSpec"],Ol(N))}else if(r==="PREFERENCE_TUNING"){let N=f(t,["validationDataset"]);e!==void 0&&N!=null&&m(e,["preferenceOptimizationSpec"],Ol(N))}else if(r==="DISTILLATION"){let N=f(t,["validationDataset"]);e!==void 0&&N!=null&&m(e,["distillationSpec"],Ol(N))}else if(r==="REINFORCEMENT_TUNING"){let N=f(t,["validationDataset"]);e!==void 0&&N!=null&&m(e,["reinforcementTuningSpec"],Ol(N))}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 N=f(t,["epochCount"]);e!==void 0&&N!=null&&m(e,["supervisedTuningSpec","hyperParameters","epochCount"],N)}else if(u==="PREFERENCE_TUNING"){let N=f(t,["epochCount"]);e!==void 0&&N!=null&&m(e,["preferenceOptimizationSpec","hyperParameters","epochCount"],N)}else if(u==="DISTILLATION"){let N=f(t,["epochCount"]);e!==void 0&&N!=null&&m(e,["distillationSpec","hyperParameters","epochCount"],N)}else if(u==="REINFORCEMENT_TUNING"){let N=f(t,["epochCount"]);e!==void 0&&N!=null&&m(e,["reinforcementTuningSpec","hyperParameters","epochCount"],N)}let c=f(n,["config","method"]);if(c===void 0&&(c="SUPERVISED_FINE_TUNING"),c==="SUPERVISED_FINE_TUNING"){let N=f(t,["learningRateMultiplier"]);e!==void 0&&N!=null&&m(e,["supervisedTuningSpec","hyperParameters","learningRateMultiplier"],N)}else if(c==="PREFERENCE_TUNING"){let N=f(t,["learningRateMultiplier"]);e!==void 0&&N!=null&&m(e,["preferenceOptimizationSpec","hyperParameters","learningRateMultiplier"],N)}else if(c==="DISTILLATION"){let N=f(t,["learningRateMultiplier"]);e!==void 0&&N!=null&&m(e,["distillationSpec","hyperParameters","learningRateMultiplier"],N)}else if(c==="REINFORCEMENT_TUNING"){let N=f(t,["learningRateMultiplier"]);e!==void 0&&N!=null&&m(e,["reinforcementTuningSpec","hyperParameters","learningRateMultiplier"],N)}let l=f(n,["config","method"]);if(l===void 0&&(l="SUPERVISED_FINE_TUNING"),l==="SUPERVISED_FINE_TUNING"){let N=f(t,["exportLastCheckpointOnly"]);e!==void 0&&N!=null&&m(e,["supervisedTuningSpec","exportLastCheckpointOnly"],N)}else if(l==="PREFERENCE_TUNING"){let N=f(t,["exportLastCheckpointOnly"]);e!==void 0&&N!=null&&m(e,["preferenceOptimizationSpec","exportLastCheckpointOnly"],N)}else if(l==="DISTILLATION"){let N=f(t,["exportLastCheckpointOnly"]);e!==void 0&&N!=null&&m(e,["distillationSpec","exportLastCheckpointOnly"],N)}let p=f(n,["config","method"]);if(p===void 0&&(p="SUPERVISED_FINE_TUNING"),p==="SUPERVISED_FINE_TUNING"){let N=f(t,["adapterSize"]);e!==void 0&&N!=null&&m(e,["supervisedTuningSpec","hyperParameters","adapterSize"],N)}else if(p==="PREFERENCE_TUNING"){let N=f(t,["adapterSize"]);e!==void 0&&N!=null&&m(e,["preferenceOptimizationSpec","hyperParameters","adapterSize"],N)}else if(p==="DISTILLATION"){let N=f(t,["adapterSize"]);e!==void 0&&N!=null&&m(e,["distillationSpec","hyperParameters","adapterSize"],N)}else if(p==="REINFORCEMENT_TUNING"){let N=f(t,["adapterSize"]);e!==void 0&&N!=null&&m(e,["reinforcementTuningSpec","hyperParameters","adapterSize"],N)}let d=f(n,["config","method"]);if(d===void 0&&(d="SUPERVISED_FINE_TUNING"),d==="SUPERVISED_FINE_TUNING"){let N=f(t,["tuningMode"]);e!==void 0&&N!=null&&m(e,["supervisedTuningSpec","tuningMode"],N)}else if(d==="DISTILLATION"){let N=f(t,["tuningMode"]);e!==void 0&&N!=null&&m(e,["distillationSpec","tuningMode"],N)}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 N=f(t,["batchSize"]);e!==void 0&&N!=null&&m(e,["supervisedTuningSpec","hyperParameters","batchSize"],N)}else if(h==="DISTILLATION"){let N=f(t,["batchSize"]);e!==void 0&&N!=null&&m(e,["distillationSpec","hyperParameters","batchSize"],N)}else if(h==="REINFORCEMENT_TUNING"){let N=f(t,["batchSize"]);e!==void 0&&N!=null&&m(e,["reinforcementTuningSpec","hyperParameters","batchSize"],N)}let y=f(n,["config","method"]);if(y===void 0&&(y="SUPERVISED_FINE_TUNING"),y==="SUPERVISED_FINE_TUNING"){let N=f(t,["learningRate"]);e!==void 0&&N!=null&&m(e,["supervisedTuningSpec","hyperParameters","learningRate"],N)}else if(y==="DISTILLATION"){let N=f(t,["learningRate"]);e!==void 0&&N!=null&&m(e,["distillationSpec","hyperParameters","learningRate"],N)}let v=f(t,["labels"]);e!==void 0&&v!=null&&m(e,["labels"],v);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 C=f(t,["sftLossWeightMultiplier"]);e!==void 0&&C!=null&&m(e,["distillationSpec","hyperParameters","sftLossWeightMultiplier"],C);let S=f(t,["outputUri"]);e!==void 0&&S!=null&&m(e,["outputUri"],S);let T=f(t,["encryptionSpec"]);e!==void 0&&T!=null&&m(e,["encryptionSpec"],T);let b=f(t,["rewardConfig"]);e!==void 0&&b!=null&&m(e,["reinforcementTuningSpec","singleRewardConfig"],b);let R=f(t,["compositeRewardConfig"]);e!==void 0&&R!=null&&m(e,["reinforcementTuningSpec","compositeRewardConfig"],R);let B=f(t,["samplesPerPrompt"]);e!==void 0&&B!=null&&m(e,["reinforcementTuningSpec","hyperParameters","samplesPerPrompt"],B);let P=f(t,["evaluateInterval"]);e!==void 0&&P!=null&&m(e,["reinforcementTuningSpec","hyperParameters","evaluateInterval"],P);let V=f(t,["checkpointInterval"]);e!==void 0&&V!=null&&m(e,["reinforcementTuningSpec","hyperParameters","checkpointInterval"],V);let de=f(t,["maxOutputTokens"]);e!==void 0&&de!=null&&m(e,["reinforcementTuningSpec","hyperParameters","maxOutputTokens"],de);let Ce=f(t,["thinkingLevel"]);e!==void 0&&Ce!=null&&m(e,["reinforcementTuningSpec","hyperParameters","thinkingLevel"],Ce);let De=f(t,["validationDatasetUri"]);return e!==void 0&&De!=null&&m(e,["reinforcementTuningSpec","validationDatasetUri"],De),o}a(_K,"createTuningJobConfigToVertex");function xK(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&&DK(i);let s=f(t,["config"]);return s!=null&&vK(s,n),n}a(xK,"createTuningJobParametersPrivateToMldev");function EK(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&&OK(i,n,e);let s=f(t,["config"]);return s!=null&&_K(s,n,e),n}a(EK,"createTuningJobParametersPrivateToVertex");function q0(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"],IK(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(q0,"distillationHyperParametersFromVertex");function SK(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"],q0(u)),n}a(SK,"distillationSamplingSpecFromVertex");function CK(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"],q0(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(CK,"distillationSpecFromVertex");function TK(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(TK,"executableCodeToVertex");function IK(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 y=f(t,["responseMimeType"]);y!=null&&m(n,["responseMimeType"],y);let v=f(t,["responseModalities"]);v!=null&&m(n,["responseModalities"],v);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 C=f(t,["speechConfig"]);C!=null&&m(n,["speechConfig"],C);let S=f(t,["stopSequences"]);S!=null&&m(n,["stopSequences"],S);let T=f(t,["temperature"]);T!=null&&m(n,["temperature"],T);let b=f(t,["thinkingConfig"]);b!=null&&m(n,["thinkingConfig"],b);let R=f(t,["topK"]);R!=null&&m(n,["topK"],R);let B=f(t,["topP"]);return B!=null&&m(n,["topP"],B),n}a(IK,"generationConfigFromVertex");function AK(t,e){let n={},o=f(t,["name"]);return o!=null&&m(n,["_url","name"],o),n}a(AK,"getTuningJobParametersToMldev");function bK(t,e){let n={},o=f(t,["name"]);return o!=null&&m(n,["_url","name"],o),n}a(bK,"getTuningJobParametersToVertex");function wK(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(wK,"listTuningJobsConfigToVertex");function RK(t,e){let n={},o=f(t,["config"]);return o!=null&&wK(o,n),n}a(RK,"listTuningJobsParametersToVertex");function kK(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=>Dg(u))),m(n,["tuningJobs"],s)}return n}a(kK,"listTuningJobsResponseFromVertex");function PK(t,e){let n={},o=f(t,["mediaResolution"]);o!=null&&m(n,["mediaResolution"],o);let r=f(t,["codeExecutionResult"]);r!=null&&m(n,["codeExecutionResult"],yK(r));let i=f(t,["executableCode"]);i!=null&&m(n,["executableCode"],TK(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(PK,"partToVertex");function NK(t,e){let n={},o=f(t,["contents"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(u=>$g(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"],$g(i)),n}a(NK,"reinforcementTuningExampleToVertex");function $K(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($K,"tunedModelFromMldev");function DK(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(DK,"tuningDatasetToMldev");function OK(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(OK,"tuningDatasetToVertex");function MK(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"],W$(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"],$K(g)),n}a(MK,"tuningJobFromMldev");function Dg(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"],W$(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 y=f(t,["preTunedModel"]);y!=null&&m(n,["preTunedModel"],y);let v=f(t,["supervisedTuningSpec"]);v!=null&&m(n,["supervisedTuningSpec"],v);let _=f(t,["preferenceOptimizationSpec"]);_!=null&&m(n,["preferenceOptimizationSpec"],_);let x=f(t,["distillationSpec"]);x!=null&&m(n,["distillationSpec"],CK(x));let E=f(t,["reinforcementTuningSpec"]);E!=null&&m(n,["reinforcementTuningSpec"],E);let C=f(t,["tuningDataStats"]);C!=null&&m(n,["tuningDataStats"],C);let S=f(t,["encryptionSpec"]);S!=null&&m(n,["encryptionSpec"],S);let T=f(t,["partnerModelTuningSpec"]);T!=null&&m(n,["partnerModelTuningSpec"],T);let b=f(t,["customBaseModel"]);b!=null&&m(n,["customBaseModel"],b);let R=f(t,["evaluateDatasetRuns"]);if(R!=null){let Lt=R;Array.isArray(Lt)&&(Lt=Lt.map(Lp=>Lp)),m(n,["evaluateDatasetRuns"],Lt)}let B=f(t,["experiment"]);B!=null&&m(n,["experiment"],B);let P=f(t,["fullFineTuningSpec"]);P!=null&&m(n,["fullFineTuningSpec"],P);let V=f(t,["labels"]);V!=null&&m(n,["labels"],V);let de=f(t,["outputUri"]);de!=null&&m(n,["outputUri"],de);let Ce=f(t,["pipelineJob"]);Ce!=null&&m(n,["pipelineJob"],Ce);let De=f(t,["serviceAccount"]);De!=null&&m(n,["serviceAccount"],De);let N=f(t,["tunedModelDisplayName"]);N!=null&&m(n,["tunedModelDisplayName"],N);let O=f(t,["tuningJobState"]);O!=null&&m(n,["tuningJobState"],O);let X=f(t,["veoTuningSpec"]);X!=null&&m(n,["veoTuningSpec"],X);let be=f(t,["tuningJobMetadata"]);be!=null&&m(n,["tuningJobMetadata"],be);let we=f(t,["veoLoraTuningSpec"]);we!=null&&m(n,["veoLoraTuningSpec"],we);let fe=f(t,["distillationSamplingSpec"]);return fe!=null&&m(n,["distillationSamplingSpec"],SK(fe)),n}a(Dg,"tuningJobFromVertex");function LK(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(LK,"tuningOperationFromMldev");function Ol(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(Ol,"tuningValidationDatasetToVertex");function UK(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"],$g(r));let i=f(t,["example"]);i!=null&&m(n,["example"],NK(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(UK,"validateRewardParametersToVertex");function FK(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(FK,"validateRewardResponseFromVertex");var Cy=class Cy 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:hm.JOB_STATE_QUEUED}}}}async getInternal(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=bK(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=>Dg(p))}else{let l=AK(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=>MK(p))}}async listInternal(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){let u=RK(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=kK(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 cancel(e){var n,o,r,i;let s,u="",c={};if(this.apiClient.isVertexAI()){let l=mK(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=hK(p),g=new Hl;return Object.assign(g,d),g})}else{let l=pK(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=gK(p),g=new Hl;return Object.assign(g,d),g})}}async tuneInternal(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){let u=EK(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=>Dg(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=xK(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=>LK(c))}}async validateReward(e){var n,o;let r,i="",s={};if(this.apiClient.isVertexAI()){let u=UK(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=FK(c),p=new Tm;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(Cy,"Tunings");var Og=Cy;var Ty=class Ty{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(Ty,"BrowserDownloader");var Mg=Ty,zK=1024*1024*8,GK=3,BK=1e3,qK=2,sc="x-goog-upload-status";async function VK(t,e,n,o){var r;let i=await V0(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[sc])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return s.file}a(VK,"uploadBlob");async function ZK(t,e,n,o){var r;let i=await V0(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[sc])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");let u=G$(s),c=new Om;return Object.assign(c,u),c}a(ZK,"uploadBlobToFileSearchStore");async function V0(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),y=new URL(e);y.protocol=h.protocol,y.host=h.host,y.port=h.port,u=y.toString()}let l=0,p=0,d=new ui(new Response),g="upload";for(l=t.size;p<l;){let h=Math.min(zK,l-p),y=t.slice(p,p+h);p+h>=l&&(g+=", finalize");let v=0,_=BK;for(;v<GK;){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:y,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[sc])break;v++,await JK(_),_=_*qK}if(p+=h,((s=d==null?void 0:d.headers)===null||s===void 0?void 0:s[sc])!=="active")break;if(l<=p)throw new Error("All content has been uploaded, but the upload status is not finalized.")}return d}a(V0,"uploadBlobInternal");async function HK(t){return{size:t.size,type:t.type}}a(HK,"getBlobStat");function JK(t){return new Promise(e=>setTimeout(e,t))}a(JK,"sleep");var Iy=class Iy{async upload(e,n,o,r){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await VK(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 ZK(e,n,o,r)}async stat(e){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await HK(e)}};a(Iy,"BrowserUploader");var Lg=Iy;var Ay=class Ay{create(e,n,o){return new Fg(e,n,o)}};a(Ay,"BrowserWebSocketFactory");var Ug=Ay,by=class by{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(by,"BrowserWebSocket");var Fg=by;var z$="x-goog-api-key",wy=class wy{constructor(e){this.apiKey=e}async addAuthHeaders(e,n){if(e.get(z$)===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(z$,this.apiKey)}}};a(wy,"WebAuth");var zg=wy;var WK="gl-node/",Ry=class Ry{getNextGenClient(){let e=this.httpOptions;return this._nextGenClient===void 0&&(this._nextGenClient=di(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 kg(this.apiClient),this._interactions)}get webhooks(){return this._webhooks!==void 0?this._webhooks:(this._webhooks=new Ng(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 Pg(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=Q4(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 zg(this.apiKey);this.apiClient=new Hm({auth:r,apiVersion:this.apiVersion,apiKey:this.apiKey,vertexai:this.vertexai,httpOptions:this.httpOptions,userAgentExtra:WK+"web",uploader:new Lg,downloader:new Mg}),this.models=new Xm(this.apiClient),this.live=new jm(this.apiClient,r,new Ug),this.batches=new Um(this.apiClient),this.chats=new zm(this.models,this.apiClient),this.caches=new Fm(this.apiClient),this.files=new Bm(this.apiClient),this.operations=new Qm(this.apiClient),this.authTokens=new eg(this.apiClient),this.tunings=new Og(this.apiClient),this.fileSearchStores=new ng(this.apiClient)}};a(Ry,"GoogleGenAI");var Hr=Ry;var H0=Symbol("Let zodToJsonSchema decide on which parser to use");var Z0={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"},J0=a(t=>typeof t=="string"?{...Z0,name:t}:{...Z0,...t},"getDefaultOptions");var W0=a(t=>{let e=J0(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 ky(t,e,n,o){o!=null&&o.errorMessages&&n&&(t.errorMessage={...t.errorMessage,[e]:n})}a(ky,"addErrorMessage");function se(t,e,n,o,r){t[e]=n,ky(t,e,o,r)}a(se,"setResponseValueAndErrors");var Ec=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 ie;(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})(ie||(ie={}));var K0;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(K0||(K0={}));var Z=ie.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 L=ie.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 Sc=class Sc 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 Sc))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ie.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(Sc,"ZodError");var Rt=Sc;Rt.create=t=>new Rt(t);var KK=a((t,e)=>{let n;switch(t.code){case L.invalid_type:t.received===Z.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case L.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ie.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:n=`Unrecognized key(s) in object: ${ie.joinValues(t.keys,", ")}`;break;case L.invalid_union:n="Invalid input";break;case L.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ie.joinValues(t.options)}`;break;case L.invalid_enum_value:n=`Invalid enum value. Expected ${ie.joinValues(t.options)}, received '${t.received}'`;break;case L.invalid_arguments:n="Invalid function arguments";break;case L.invalid_return_type:n="Invalid function return type";break;case L.invalid_date:n="Invalid date";break;case L.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}"`:ie.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case L.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 L.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 L.custom:n="Invalid input";break;case L.invalid_intersection_types:n="Intersection results could not be merged";break;case L.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case L.not_finite:n="Number must be finite";break;default:n=e.defaultError,ie.assertNever(t)}return{message:n}},"errorMap"),hr=KK;var jK=hr;function ua(){return jK}a(ua,"getErrorMap");var Tc=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=ua(),o=Tc({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===hr?void 0:hr].filter(r=>!!r)});t.common.issues.push(o)}a(z,"addIssueToContext");var Cc=class Cc{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 Cc.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(Cc,"ParseStatus");var Qe=Cc,K=Object.freeze({status:"aborted"}),yi=a(t=>({status:"dirty",value:t}),"DIRTY"),lt=a(t=>({status:"valid",value:t}),"OK"),Py=a(t=>t.status==="aborted","isAborted"),Ny=a(t=>t.status==="dirty","isDirty"),Jr=a(t=>t.status==="valid","isValid"),la=a(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync");var J;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(J||(J={}));var Uy=class Uy{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(Uy,"ParseInputLazyPath");var Vt=Uy,j0=a((t,e)=>{if(Jr(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 Fy=class Fy{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(la(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 j0(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 Jr(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=>Jr(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(la(r)?r:Promise.resolve(r));return j0(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:L.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 vr.create(this)}promise(){return Kr.create(this,this._def)}or(e){return Ti.create([this,e],this._def)}and(e){return Ii.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 ki({...Q(this._def),innerType:this,defaultValue:n,typeName:U.ZodDefault})}brand(){return new Ic({typeName:U.ZodBranded,type:this,...Q(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Pi({...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 Ac.create(this,e)}readonly(){return Ni.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};a(Fy,"ZodType");var ne=Fy,YK=/^c[^\s-]{8,}$/i,XK=/^[0-9a-z]+$/,QK=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ej=/^[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,tj=/^[a-z0-9_-]{21}$/i,nj=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,rj=/^[-+]?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)?)??$/,oj=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ij="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",$y,sj=/^(?:(?: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])$/,aj=/^(?:(?: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])$/,uj=/^(([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]))$/,lj=/^(([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])$/,cj=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dj=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Y0="((\\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])))",fj=new RegExp(`^${Y0}$`);function X0(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(X0,"timeRegexSource");function pj(t){return new RegExp(`^${X0(t)}$`)}a(pj,"timeRegex");function mj(t){let e=`${Y0}T${X0(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(mj,"datetimeRegex");function gj(t,e){return!!((e==="v4"||!e)&&sj.test(t)||(e==="v6"||!e)&&uj.test(t))}a(gj,"isValidIP");function hj(t,e){if(!nj.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(hj,"isValidJWT");function yj(t,e){return!!((e==="v4"||!e)&&aj.test(t)||(e==="v6"||!e)&&lj.test(t))}a(yj,"isValidCidr");var Wr=class Wr 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:L.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:L.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:L.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:L.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&z(r,{code:L.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),o.dirty())}else if(i.kind==="email")oj.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"email",code:L.invalid_string,message:i.message}),o.dirty());else if(i.kind==="emoji")$y||($y=new RegExp(ij,"u")),$y.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"emoji",code:L.invalid_string,message:i.message}),o.dirty());else if(i.kind==="uuid")ej.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"uuid",code:L.invalid_string,message:i.message}),o.dirty());else if(i.kind==="nanoid")tj.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"nanoid",code:L.invalid_string,message:i.message}),o.dirty());else if(i.kind==="cuid")YK.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"cuid",code:L.invalid_string,message:i.message}),o.dirty());else if(i.kind==="cuid2")XK.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"cuid2",code:L.invalid_string,message:i.message}),o.dirty());else if(i.kind==="ulid")QK.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"ulid",code:L.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:L.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:L.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:L.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:L.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:L.invalid_string,validation:{endsWith:i.value},message:i.message}),o.dirty()):i.kind==="datetime"?mj(i).test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{code:L.invalid_string,validation:"datetime",message:i.message}),o.dirty()):i.kind==="date"?fj.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{code:L.invalid_string,validation:"date",message:i.message}),o.dirty()):i.kind==="time"?pj(i).test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{code:L.invalid_string,validation:"time",message:i.message}),o.dirty()):i.kind==="duration"?rj.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"duration",code:L.invalid_string,message:i.message}),o.dirty()):i.kind==="ip"?gj(e.data,i.version)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"ip",code:L.invalid_string,message:i.message}),o.dirty()):i.kind==="jwt"?hj(e.data,i.alg)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"jwt",code:L.invalid_string,message:i.message}),o.dirty()):i.kind==="cidr"?yj(e.data,i.version)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"cidr",code:L.invalid_string,message:i.message}),o.dirty()):i.kind==="base64"?cj.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"base64",code:L.invalid_string,message:i.message}),o.dirty()):i.kind==="base64url"?dj.test(e.data)||(r=this._getOrReturnCtx(e,r),z(r,{validation:"base64url",code:L.invalid_string,message:i.message}),o.dirty()):ie.assertNever(i);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(r=>e.test(r),{validation:n,code:L.invalid_string,...J.errToObj(o)})}_addCheck(e){return new Wr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...J.errToObj(e)})}url(e){return this._addCheck({kind:"url",...J.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...J.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...J.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...J.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...J.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...J.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...J.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...J.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...J.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...J.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...J.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...J.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,...J.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,...J.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...J.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...J.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...J.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...J.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...J.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...J.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...J.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...J.errToObj(n)})}nonempty(e){return this.min(1,J.errToObj(e))}trim(){return new Wr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Wr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Wr({...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(Wr,"ZodString");var Ei=Wr;Ei.create=t=>{var e;return new Ei({checks:[],typeName:U.ZodString,coerce:(e=t==null?void 0:t.coerce)!=null?e:!1,...Q(t)})};function vj(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(vj,"floatSafeRemainder");var ca=class ca 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:L.invalid_type,expected:Z.number,received:i.parsedType}),K}let o,r=new Qe;for(let i of this._def.checks)i.kind==="int"?ie.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),z(o,{code:L.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:L.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:L.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?vj(e.data,i.value)!==0&&(o=this._getOrReturnCtx(e,o),z(o,{code:L.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:L.not_finite,message:i.message}),r.dirty()):ie.assertNever(i);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,J.toString(n))}gt(e,n){return this.setLimit("min",e,!1,J.toString(n))}lte(e,n){return this.setLimit("max",e,!0,J.toString(n))}lt(e,n){return this.setLimit("max",e,!1,J.toString(n))}setLimit(e,n,o,r){return new ca({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:J.toString(r)}]})}_addCheck(e){return new ca({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:J.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:J.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:J.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:J.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:J.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:J.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:J.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:J.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:J.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"&&ie.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(ca,"ZodNumber");var ga=ca;ga.create=t=>new ga({checks:[],typeName:U.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Q(t)});var da=class da 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:L.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:L.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:L.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):ie.assertNever(i);return{status:r.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return z(n,{code:L.invalid_type,expected:Z.bigint,received:n.parsedType}),K}gte(e,n){return this.setLimit("min",e,!0,J.toString(n))}gt(e,n){return this.setLimit("min",e,!1,J.toString(n))}lte(e,n){return this.setLimit("max",e,!0,J.toString(n))}lt(e,n){return this.setLimit("max",e,!1,J.toString(n))}setLimit(e,n,o,r){return new da({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:J.toString(r)}]})}_addCheck(e){return new da({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:J.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:J.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:J.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:J.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:J.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(da,"ZodBigInt");var ha=da;ha.create=t=>{var e;return new ha({checks:[],typeName:U.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!=null?e:!1,...Q(t)})};var zy=class zy 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:L.invalid_type,expected:Z.boolean,received:o.parsedType}),K}return lt(e.data)}};a(zy,"ZodBoolean");var ya=zy;ya.create=t=>new ya({typeName:U.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Q(t)});var bc=class bc 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:L.invalid_type,expected:Z.date,received:i.parsedType}),K}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return z(i,{code:L.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:L.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:L.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),o.dirty()):ie.assertNever(i);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new bc({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:J.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:J.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(bc,"ZodDate");var va=bc;va.create=t=>new va({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:U.ZodDate,...Q(t)});var Gy=class Gy extends ne{_parse(e){if(this._getType(e)!==Z.symbol){let o=this._getOrReturnCtx(e);return z(o,{code:L.invalid_type,expected:Z.symbol,received:o.parsedType}),K}return lt(e.data)}};a(Gy,"ZodSymbol");var _a=Gy;_a.create=t=>new _a({typeName:U.ZodSymbol,...Q(t)});var By=class By extends ne{_parse(e){if(this._getType(e)!==Z.undefined){let o=this._getOrReturnCtx(e);return z(o,{code:L.invalid_type,expected:Z.undefined,received:o.parsedType}),K}return lt(e.data)}};a(By,"ZodUndefined");var Si=By;Si.create=t=>new Si({typeName:U.ZodUndefined,...Q(t)});var qy=class qy extends ne{_parse(e){if(this._getType(e)!==Z.null){let o=this._getOrReturnCtx(e);return z(o,{code:L.invalid_type,expected:Z.null,received:o.parsedType}),K}return lt(e.data)}};a(qy,"ZodNull");var Ci=qy;Ci.create=t=>new Ci({typeName:U.ZodNull,...Q(t)});var Vy=class Vy extends ne{constructor(){super(...arguments),this._any=!0}_parse(e){return lt(e.data)}};a(Vy,"ZodAny");var xa=Vy;xa.create=t=>new xa({typeName:U.ZodAny,...Q(t)});var Zy=class Zy extends ne{constructor(){super(...arguments),this._unknown=!0}_parse(e){return lt(e.data)}};a(Zy,"ZodUnknown");var yr=Zy;yr.create=t=>new yr({typeName:U.ZodUnknown,...Q(t)});var Hy=class Hy extends ne{_parse(e){let n=this._getOrReturnCtx(e);return z(n,{code:L.invalid_type,expected:Z.never,received:n.parsedType}),K}};a(Hy,"ZodNever");var hn=Hy;hn.create=t=>new hn({typeName:U.ZodNever,...Q(t)});var Jy=class Jy extends ne{_parse(e){if(this._getType(e)!==Z.undefined){let o=this._getOrReturnCtx(e);return z(o,{code:L.invalid_type,expected:Z.void,received:o.parsedType}),K}return lt(e.data)}};a(Jy,"ZodVoid");var Ea=Jy;Ea.create=t=>new Ea({typeName:U.ZodVoid,...Q(t)});var _i=class _i extends ne{_parse(e){let{ctx:n,status:o}=this._processInputParams(e),r=this._def;if(n.parsedType!==Z.array)return z(n,{code:L.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?L.too_big:L.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:L.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:L.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 _i({...this._def,minLength:{value:e,message:J.toString(n)}})}max(e,n){return new _i({...this._def,maxLength:{value:e,message:J.toString(n)}})}length(e,n){return new _i({...this._def,exactLength:{value:e,message:J.toString(n)}})}nonempty(e){return this.min(1,e)}};a(_i,"ZodArray");var vr=_i;vr.create=(t,e)=>new vr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:U.ZodArray,...Q(e)});function vi(t){if(t instanceof Pt){let e={};for(let n in t.shape){let o=t.shape[n];e[n]=nn.create(vi(o))}return new Pt({...t._def,shape:a(()=>e,"shape")})}else return t instanceof vr?new vr({...t._def,type:vi(t.element)}):t instanceof nn?nn.create(vi(t.unwrap())):t instanceof Zn?Zn.create(vi(t.unwrap())):t instanceof Vn?Vn.create(t.items.map(e=>vi(e))):t}a(vi,"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=ie.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:L.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:L.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 J.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=J.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 ie.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 ie.objectKeys(this.shape))e[o]||(n[o]=this.shape[o]);return new kt({...this._def,shape:a(()=>n,"shape")})}deepPartial(){return vi(this)}partial(e){let n={};for(let o of ie.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 ie.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 Q0(ie.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 Wy=class Wy 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:L.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:L.invalid_union,unionErrors:u}),K}}get options(){return this._def.options}};a(Wy,"ZodUnion");var Ti=Wy;Ti.create=(t,e)=>new Ti({options:t,typeName:U.ZodUnion,...Q(e)});var qn=a(t=>t instanceof Ai?qn(t.schema):t instanceof rn?qn(t.innerType()):t instanceof bi?[t.value]:t instanceof wi?t.options:t instanceof Ri?ie.objectValues(t.enum):t instanceof ki?qn(t._def.innerType):t instanceof Si?[void 0]:t instanceof Ci?[null]:t instanceof nn?[void 0,...qn(t.unwrap())]:t instanceof Zn?[null,...qn(t.unwrap())]:t instanceof Ic||t instanceof Ni?qn(t.unwrap()):t instanceof Pi?qn(t._def.innerType):[],"getDiscriminator"),wc=class wc extends ne{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Z.object)return z(n,{code:L.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:L.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 wc({typeName:U.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...Q(o)})}};a(wc,"ZodDiscriminatedUnion");var Dy=wc;function Oy(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=ie.objectKeys(e),i=ie.objectKeys(t).filter(u=>r.indexOf(u)!==-1),s={...t,...e};for(let u of i){let c=Oy(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=Oy(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(Oy,"mergeValues");var Ky=class Ky extends ne{_parse(e){let{status:n,ctx:o}=this._processInputParams(e),r=a((i,s)=>{if(Py(i)||Py(s))return K;let u=Oy(i.value,s.value);return u.valid?((Ny(i)||Ny(s))&&n.dirty(),{status:n.value,value:u.data}):(z(o,{code:L.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(Ky,"ZodIntersection");var Ii=Ky;Ii.create=(t,e,n)=>new Ii({left:t,right:e,typeName:U.ZodIntersection,...Q(n)});var Rc=class Rc extends ne{_parse(e){let{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==Z.array)return z(o,{code:L.invalid_type,expected:Z.array,received:o.parsedType}),K;if(o.data.length<this._def.items.length)return z(o,{code:L.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:L.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 Rc({...this._def,rest:e})}};a(Rc,"ZodTuple");var Vn=Rc;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 fa=class fa 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:L.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 fa({keyType:e,valueType:n,typeName:U.ZodRecord,...Q(o)}):new fa({keyType:Ei.create(),valueType:e,typeName:U.ZodRecord,...Q(n)})}};a(fa,"ZodRecord");var My=fa,jy=class jy 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:L.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(jy,"ZodMap");var Sa=jy;Sa.create=(t,e,n)=>new Sa({valueType:e,keyType:t,typeName:U.ZodMap,...Q(n)});var pa=class pa extends ne{_parse(e){let{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==Z.set)return z(o,{code:L.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:L.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:L.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 pa({...this._def,minSize:{value:e,message:J.toString(n)}})}max(e,n){return new pa({...this._def,maxSize:{value:e,message:J.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};a(pa,"ZodSet");var Ca=pa;Ca.create=(t,e)=>new Ca({valueType:t,minSize:null,maxSize:null,typeName:U.ZodSet,...Q(e)});var xi=class xi 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:L.invalid_type,expected:Z.function,received:n.parsedType}),K;function o(u,c){return Tc({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ua(),hr].filter(l=>!!l),issueData:{code:L.invalid_arguments,argumentsError:c}})}a(o,"makeArgsIssue");function r(u,c){return Tc({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ua(),hr].filter(l=>!!l),issueData:{code:L.invalid_return_type,returnTypeError:c}})}a(r,"makeReturnsIssue");let i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof Kr){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 xi({...this._def,args:Vn.create(e).rest(yr.create())})}returns(e){return new xi({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new xi({args:e||Vn.create([]).rest(yr.create()),returns:n||yr.create(),typeName:U.ZodFunction,...Q(o)})}};a(xi,"ZodFunction");var Ly=xi,Yy=class Yy 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(Yy,"ZodLazy");var Ai=Yy;Ai.create=(t,e)=>new Ai({getter:t,typeName:U.ZodLazy,...Q(e)});var Xy=class Xy extends ne{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return z(n,{received:n.data,code:L.invalid_literal,expected:this._def.value}),K}return{status:"valid",value:e.data}}get value(){return this._def.value}};a(Xy,"ZodLiteral");var bi=Xy;bi.create=(t,e)=>new bi({value:t,typeName:U.ZodLiteral,...Q(e)});function Q0(t,e){return new wi({values:t,typeName:U.ZodEnum,...Q(e)})}a(Q0,"createZodEnum");var ma=class ma extends ne{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),o=this._def.values;return z(n,{expected:ie.joinValues(o),received:n.parsedType,code:L.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:L.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 ma.create(e,{...this._def,...n})}exclude(e,n=this._def){return ma.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}};a(ma,"ZodEnum");var wi=ma;wi.create=Q0;var Qy=class Qy extends ne{_parse(e){let n=ie.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==Z.string&&o.parsedType!==Z.number){let r=ie.objectValues(n);return z(o,{expected:ie.joinValues(r),received:o.parsedType,code:L.invalid_type}),K}if(this._cache||(this._cache=new Set(ie.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=ie.objectValues(n);return z(o,{received:o.data,code:L.invalid_enum_value,options:r}),K}return lt(e.data)}get enum(){return this._def.values}};a(Qy,"ZodNativeEnum");var Ri=Qy;Ri.create=(t,e)=>new Ri({values:t,typeName:U.ZodNativeEnum,...Q(e)});var ev=class ev 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:L.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(ev,"ZodPromise");var Kr=ev;Kr.create=(t,e)=>new Kr({type:t,typeName:U.ZodPromise,...Q(e)});var tv=class tv 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"?yi(c.value):n.value==="dirty"?yi(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"?yi(u.value):n.value==="dirty"?yi(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(!Jr(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=>Jr(s)?Promise.resolve(r.transform(s.value,i)).then(u=>({status:n.value,value:u})):K);ie.assertNever(r)}};a(tv,"ZodEffects");var rn=tv;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 nv=class nv extends ne{_parse(e){return this._getType(e)===Z.undefined?lt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a(nv,"ZodOptional");var nn=nv;nn.create=(t,e)=>new nn({innerType:t,typeName:U.ZodOptional,...Q(e)});var rv=class rv extends ne{_parse(e){return this._getType(e)===Z.null?lt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a(rv,"ZodNullable");var Zn=rv;Zn.create=(t,e)=>new Zn({innerType:t,typeName:U.ZodNullable,...Q(e)});var ov=class ov 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(ov,"ZodDefault");var ki=ov;ki.create=(t,e)=>new ki({innerType:t,typeName:U.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Q(e)});var iv=class iv 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 la(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(iv,"ZodCatch");var Pi=iv;Pi.create=(t,e)=>new Pi({innerType:t,typeName:U.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Q(e)});var sv=class sv extends ne{_parse(e){if(this._getType(e)!==Z.nan){let o=this._getOrReturnCtx(e);return z(o,{code:L.invalid_type,expected:Z.nan,received:o.parsedType}),K}return{status:"valid",value:e.data}}};a(sv,"ZodNaN");var Ta=sv;Ta.create=t=>new Ta({typeName:U.ZodNaN,...Q(t)});var av=class av 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(av,"ZodBranded");var Ic=av,kc=class kc 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(),yi(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 kc({in:e,out:n,typeName:U.ZodPipeline})}};a(kc,"ZodPipeline");var Ac=kc,uv=class uv extends ne{_parse(e){let n=this._def.innerType._parse(e),o=a(r=>(Jr(r)&&(r.value=Object.freeze(r.value)),r),"freeze");return la(n)?n.then(r=>o(r)):o(n)}unwrap(){return this._def.innerType}};a(uv,"ZodReadonly");var Ni=uv;Ni.create=(t,e)=>new Ni({innerType:t,typeName:U.ZodReadonly,...Q(e)});var sce={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 ace=Ei.create,uce=ga.create,lce=Ta.create,cce=ha.create,dce=ya.create,fce=va.create,pce=_a.create,mce=Si.create,gce=Ci.create,hce=xa.create,yce=yr.create,vce=hn.create,_ce=Ea.create,xce=vr.create,Ece=Pt.create,Sce=Pt.strictCreate,Cce=Ti.create,Tce=Dy.create,Ice=Ii.create,Ace=Vn.create,bce=My.create,wce=Sa.create,Rce=Ca.create,kce=Ly.create,Pce=Ai.create,Nce=bi.create,$ce=wi.create,Dce=Ri.create,Oce=Kr.create,Mce=rn.create,Lce=nn.create,Uce=Zn.create,Fce=rn.createWithPreprocess,zce=Ac.create;function Re(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?Ec(e,t.currentPath):e.join("/")}}a(Re,"parseAnyDef");function eD(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=j(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&se(n,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&se(n,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(se(n,"minItems",t.exactLength.value,t.exactLength.message,e),se(n,"maxItems",t.exactLength.value,t.exactLength.message,e)),n}a(eD,"parseArrayDef");function tD(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?se(n,"minimum",o.value,o.message,e):se(n,"exclusiveMinimum",o.value,o.message,e):(o.inclusive||(n.exclusiveMinimum=!0),se(n,"minimum",o.value,o.message,e));break;case"max":e.target==="jsonSchema7"?o.inclusive?se(n,"maximum",o.value,o.message,e):se(n,"exclusiveMaximum",o.value,o.message,e):(o.inclusive||(n.exclusiveMaximum=!0),se(n,"maximum",o.value,o.message,e));break;case"multipleOf":se(n,"multipleOf",o.value,o.message,e);break}return n}a(tD,"parseBigintDef");function nD(){return{type:"boolean"}}a(nD,"parseBooleanDef");function Pc(t,e){return j(t.type._def,e)}a(Pc,"parseBrandedDef");var rD=a((t,e)=>j(t.innerType._def,e),"parseCatchDef");function lv(t,e,n){let o=n!=null?n:e.dateStrategy;if(Array.isArray(o))return{anyOf:o.map((r,i)=>lv(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 _j(t,e)}}a(lv,"parseDateDef");var _j=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":se(n,"minimum",o.value,o.message,e);break;case"max":se(n,"maximum",o.value,o.message,e);break}return n},"integerDateParser");function oD(t,e){return{...j(t.innerType._def,e),default:t.defaultValue()}}a(oD,"parseDefaultDef");function iD(t,e){return e.effectStrategy==="input"?j(t.schema._def,e):Re(e)}a(iD,"parseEffectsDef");function sD(t){return{type:"string",enum:Array.from(t.values)}}a(sD,"parseEnumDef");var xj=a(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"isJsonSchema7AllOfType");function aD(t,e){let n=[j(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),j(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(xj(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(aD,"parseIntersectionDef");function uD(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(uD,"parseLiteralDef");var cv,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(()=>(cv===void 0&&(cv=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),cv),"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 Nc(t,e){let n={type:"string"};if(t.checks)for(let o of t.checks)switch(o.kind){case"min":se(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value,o.message,e);break;case"max":se(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(`^${dv(o.value,e)}`),o.message,e);break;case"endsWith":ct(n,RegExp(`${dv(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":se(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value,o.message,e),se(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value,o.message,e);break;case"includes":{ct(n,RegExp(dv(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":{se(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(Nc,"parseStringDef");function dv(t,e){return e.patternStrategy==="escape"?Sj(t):t}a(dv,"escapeLiteralCheckValue");var Ej=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Sj(t){let e="";for(let n=0;n<t.length;n++)Ej.has(t[n])||(e+="\\"),e+=t[n];return e}a(Sj,"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}}})):se(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:lD(e,o),...n&&o.errorMessages&&{errorMessage:{pattern:n}}})):se(t,"pattern",lD(e,o),n,o)}a(ct,"addPattern");function lD(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(lD,"stringifyRegExpWithFlags");function $c(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=j(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",d]}))!=null?g:Re(e)}},{}),additionalProperties:e.rejectedAdditionalProperties};let n={type:"object",additionalProperties:(r=j(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}=Nc(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}=Pc(t.keyType._def,e);return{...n,propertyNames:d}}}return n}a($c,"parseRecordDef");function cD(t,e){if(e.mapStrategy==="record")return $c(t,e);let n=j(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||Re(e),o=j(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||Re(e);return{type:"array",maxItems:125,items:{type:"array",items:[n,o],minItems:2,maxItems:2}}}a(cD,"parseMapDef");function dD(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(dD,"parseNativeEnumDef");function fD(t){return t.target==="openAi"?void 0:{not:Re({...t,currentPath:[...t.currentPath,"not"]})}}a(fD,"parseNeverDef");function pD(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}a(pD,"parseNullDef");var Ia={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function gD(t,e){if(e.target==="openApi3")return mD(t,e);let n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(o=>o._def.typeName in Ia&&(!o._def.checks||!o._def.checks.length))){let o=n.reduce((r,i)=>{let s=Ia[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 mD(t,e)}a(gD,"parseUnionDef");var mD=a((t,e)=>{let n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((o,r)=>j(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 hD(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:Ia[t.innerType._def.typeName],nullable:!0}:{type:[Ia[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let o=j(t.innerType._def,{...e,currentPath:[...e.currentPath]});return o&&"$ref"in o?{allOf:[o],nullable:!0}:o&&{...o,nullable:!0}}let n=j(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}a(hD,"parseNullableDef");function yD(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",ky(n,"type",o.message,e);break;case"min":e.target==="jsonSchema7"?o.inclusive?se(n,"minimum",o.value,o.message,e):se(n,"exclusiveMinimum",o.value,o.message,e):(o.inclusive||(n.exclusiveMinimum=!0),se(n,"minimum",o.value,o.message,e));break;case"max":e.target==="jsonSchema7"?o.inclusive?se(n,"maximum",o.value,o.message,e):se(n,"exclusiveMaximum",o.value,o.message,e):(o.inclusive||(n.exclusiveMaximum=!0),se(n,"maximum",o.value,o.message,e));break;case"multipleOf":se(n,"multipleOf",o.value,o.message,e);break}return n}a(yD,"parseNumberDef");function vD(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=Tj(c);l&&n&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),l=!1);let p=j(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=Cj(t,e);return s!==void 0&&(o.additionalProperties=s),o}a(vD,"parseObjectDef");function Cj(t,e){if(t.catchall._def.typeName!=="ZodNever")return j(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(Cj,"decideAdditionalProperties");function Tj(t){try{return t.isOptional()}catch(e){return!0}}a(Tj,"safeIsOptional");var _D=a((t,e)=>{var o;if(e.currentPath.toString()===((o=e.propertyPath)==null?void 0:o.toString()))return j(t.innerType._def,e);let n=j(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Re(e)},n]}:Re(e)},"parseOptionalDef");var xD=a((t,e)=>{if(e.pipeStrategy==="input")return j(t.in._def,e);if(e.pipeStrategy==="output")return j(t.out._def,e);let n=j(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),o=j(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,o].filter(r=>r!==void 0)}},"parsePipelineDef");function ED(t,e){return j(t.type._def,e)}a(ED,"parsePromiseDef");function SD(t,e){let o={type:"array",uniqueItems:!0,items:j(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&se(o,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&se(o,"maxItems",t.maxSize.value,t.maxSize.message,e),o}a(SD,"parseSetDef");function CD(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,o)=>j(n._def,{...e,currentPath:[...e.currentPath,"items",`${o}`]})).reduce((n,o)=>o===void 0?n:[...n,o],[]),additionalItems:j(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,o)=>j(n._def,{...e,currentPath:[...e.currentPath,"items",`${o}`]})).reduce((n,o)=>o===void 0?n:[...n,o],[])}}a(CD,"parseTupleDef");function TD(t){return{not:Re(t)}}a(TD,"parseUndefinedDef");function ID(t){return Re(t)}a(ID,"parseUnknownDef");var AD=a((t,e)=>j(t.innerType._def,e),"parseReadonlyDef");var bD=a((t,e,n)=>{switch(e){case U.ZodString:return Nc(t,n);case U.ZodNumber:return yD(t,n);case U.ZodObject:return vD(t,n);case U.ZodBigInt:return tD(t,n);case U.ZodBoolean:return nD();case U.ZodDate:return lv(t,n);case U.ZodUndefined:return TD(n);case U.ZodNull:return pD(n);case U.ZodArray:return eD(t,n);case U.ZodUnion:case U.ZodDiscriminatedUnion:return gD(t,n);case U.ZodIntersection:return aD(t,n);case U.ZodTuple:return CD(t,n);case U.ZodRecord:return $c(t,n);case U.ZodLiteral:return uD(t,n);case U.ZodEnum:return sD(t);case U.ZodNativeEnum:return dD(t);case U.ZodNullable:return hD(t,n);case U.ZodOptional:return _D(t,n);case U.ZodMap:return cD(t,n);case U.ZodSet:return SD(t,n);case U.ZodLazy:return()=>t.getter()._def;case U.ZodPromise:return ED(t,n);case U.ZodNaN:case U.ZodNever:return fD(n);case U.ZodEffects:return iD(t,n);case U.ZodAny:return Re(n);case U.ZodUnknown:return ID(n);case U.ZodDefault:return oD(t,n);case U.ZodBranded:return Pc(t,n);case U.ZodReadonly:return AD(t,n);case U.ZodCatch:return rD(t,n);case U.ZodPipeline:return xD(t,n);case U.ZodFunction:case U.ZodVoid:case U.ZodSymbol:return;default:return(o=>{})(e)}},"selectParser");function j(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!==H0)return c}if(o&&!n){let c=Ij(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=bD(t,t.typeName,e),s=typeof i=="function"?j(i(),e):i;if(s&&Aj(t,e,s),e.postProcess){let c=e.postProcess(s,t,e);return r.jsonSchema=s,c}return r.jsonSchema=s,s}a(j,"parseDef");var Ij=a((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Ec(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`),Re(e)):e.$refStrategy==="seen"?Re(e):void 0}},"get$ref"),Aj=a((t,e,n)=>(t.description&&(n.description=t.description,e.markdownDescription&&(n.markdownDescription=t.description)),n),"addMeta");var Aa=a((t,e)=>{var c;let n=W0(e),o=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[p,d])=>{var g;return{...l,[p]:(g=j(d._def,{...n,currentPath:[...n.basePath,n.definitionPath,p]},!0))!=null?g:Re(n)}},{}):void 0,r=typeof e=="string"?e:(e==null?void 0:e.nameStrategy)==="title"||e==null?void 0:e.name,i=(c=j(t._def,r===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,r]},!1))!=null?c:Re(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:()=>pv,$input:()=>$E,$output:()=>NE,NEVER:()=>fv,TimePrecision:()=>UE,ZodAny:()=>RC,ZodArray:()=>$C,ZodBase64:()=>nf,ZodBase64URL:()=>rf,ZodBigInt:()=>us,ZodBigIntFormat:()=>af,ZodBoolean:()=>as,ZodCIDRv4:()=>ef,ZodCIDRv6:()=>tf,ZodCUID:()=>Jd,ZodCUID2:()=>Wd,ZodCatch:()=>tT,ZodCodec:()=>su,ZodCustom:()=>au,ZodCustomStringFormat:()=>is,ZodDate:()=>tu,ZodDefault:()=>KC,ZodDiscriminatedUnion:()=>OC,ZodE164:()=>of,ZodEmail:()=>Vd,ZodEmoji:()=>Zd,ZodEnum:()=>rs,ZodError:()=>rX,ZodExactOptional:()=>HC,ZodFile:()=>VC,ZodFirstPartyTypeKind:()=>mT,ZodFunction:()=>dT,ZodGUID:()=>ja,ZodIPv4:()=>Xd,ZodIPv6:()=>Qd,ZodISODate:()=>Ud,ZodISODateTime:()=>Ld,ZodISODuration:()=>zd,ZodISOTime:()=>Fd,ZodIntersection:()=>MC,ZodIssueCode:()=>iX,ZodJWT:()=>sf,ZodKSUID:()=>Yd,ZodLazy:()=>uT,ZodLiteral:()=>qC,ZodMAC:()=>SC,ZodMap:()=>GC,ZodNaN:()=>rT,ZodNanoID:()=>Hd,ZodNever:()=>PC,ZodNonOptional:()=>pf,ZodNull:()=>bC,ZodNullable:()=>WC,ZodNumber:()=>ss,ZodNumberFormat:()=>so,ZodObject:()=>ru,ZodOptional:()=>ff,ZodPipe:()=>iu,ZodPrefault:()=>YC,ZodPreprocess:()=>oT,ZodPromise:()=>cT,ZodReadonly:()=>iT,ZodRealError:()=>Tt,ZodRecord:()=>ns,ZodSet:()=>BC,ZodString:()=>os,ZodStringFormat:()=>ve,ZodSuccess:()=>eT,ZodSymbol:()=>IC,ZodTemplateLiteral:()=>aT,ZodTransform:()=>ZC,ZodTuple:()=>UC,ZodType:()=>ee,ZodULID:()=>Kd,ZodURL:()=>eu,ZodUUID:()=>En,ZodUndefined:()=>AC,ZodUnion:()=>ou,ZodUnknown:()=>kC,ZodVoid:()=>NC,ZodXID:()=>jd,ZodXor:()=>DC,_ZodString:()=>qd,_default:()=>jC,_function:()=>EM,any:()=>XO,array:()=>nu,base64:()=>OO,base64url:()=>MO,bigint:()=>JO,boolean:()=>TC,catch:()=>nT,check:()=>SM,cidrv4:()=>$O,cidrv6:()=>DO,clone:()=>dt,codec:()=>yM,coerce:()=>mf,config:()=>$e,core:()=>xn,cuid:()=>IO,cuid2:()=>AO,custom:()=>CM,date:()=>eM,decode:()=>gC,decodeAsync:()=>yC,describe:()=>TM,discriminatedUnion:()=>sM,e164:()=>LO,email:()=>gO,emoji:()=>CO,encode:()=>mC,encodeAsync:()=>hC,endsWith:()=>Ji,enum:()=>cf,exactOptional:()=>JC,file:()=>pM,flattenError:()=>Da,float32:()=>qO,float64:()=>VO,formatError:()=>Oa,fromJSONSchema:()=>PM,function:()=>EM,getErrorMap:()=>aX,globalRegistry:()=>We,gt:()=>vn,gte:()=>pt,guid:()=>hO,hash:()=>BO,hex:()=>GO,hostname:()=>zO,httpUrl:()=>SO,includes:()=>Zi,instanceof:()=>AM,int:()=>Gd,int32:()=>ZO,int64:()=>WO,intersection:()=>LC,invertCodec:()=>vM,ipv4:()=>kO,ipv6:()=>NO,iso:()=>oo,json:()=>wM,jwt:()=>UO,keyof:()=>tM,ksuid:()=>RO,lazy:()=>lT,length:()=>ro,literal:()=>fM,locales:()=>eo,looseObject:()=>oM,looseRecord:()=>uM,lowercase:()=>qi,lt:()=>yn,lte:()=>Nt,mac:()=>PO,map:()=>lM,maxLength:()=>no,maxSize:()=>Ir,meta:()=>IM,mime:()=>Wi,minLength:()=>Jn,minSize:()=>_n,multipleOf:()=>Tr,nan:()=>hM,nanoid:()=>TO,nativeEnum:()=>dM,negative:()=>wd,never:()=>uf,nonnegative:()=>kd,nonoptional:()=>QC,nonpositive:()=>Rd,normalize:()=>Ki,null:()=>wC,nullable:()=>Xa,nullish:()=>mM,number:()=>CC,object:()=>nM,optional:()=>Ya,overwrite:()=>un,parse:()=>cC,parseAsync:()=>dC,partialRecord:()=>aM,pipe:()=>Bd,positive:()=>bd,prefault:()=>XC,preprocess:()=>RM,prettifyError:()=>Rv,promise:()=>xM,property:()=>Pd,readonly:()=>sT,record:()=>zC,refine:()=>fT,regex:()=>Bi,regexes:()=>Ct,registry:()=>sd,safeDecode:()=>_C,safeDecodeAsync:()=>EC,safeEncode:()=>vC,safeEncodeAsync:()=>xC,safeParse:()=>fC,safeParseAsync:()=>pC,set:()=>cM,setErrorMap:()=>sX,size:()=>to,slugify:()=>Qi,startsWith:()=>Hi,strictObject:()=>rM,string:()=>Ka,stringFormat:()=>FO,stringbool:()=>bM,success:()=>gM,superRefine:()=>pT,symbol:()=>jO,templateLiteral:()=>_M,toJSONSchema:()=>Rr,toLowerCase:()=>Yi,toUpperCase:()=>Xi,transform:()=>df,treeifyError:()=>wv,trim:()=>ji,tuple:()=>FC,uint32:()=>HO,uint64:()=>KO,ulid:()=>bO,undefined:()=>YO,union:()=>lf,unknown:()=>io,uppercase:()=>Vi,url:()=>EO,util:()=>M,uuid:()=>yO,uuidv4:()=>vO,uuidv6:()=>_O,uuidv7:()=>xO,void:()=>QO,xid:()=>wO,xor:()=>iM});var xn={};Rn(xn,{$ZodAny:()=>ix,$ZodArray:()=>cx,$ZodAsyncError:()=>an,$ZodBase64:()=>K_,$ZodBase64URL:()=>j_,$ZodBigInt:()=>td,$ZodBigIntFormat:()=>tx,$ZodBoolean:()=>Fa,$ZodCIDRv4:()=>H_,$ZodCIDRv6:()=>J_,$ZodCUID:()=>D_,$ZodCUID2:()=>O_,$ZodCatch:()=>wx,$ZodCheck:()=>_e,$ZodCheckBigIntFormat:()=>l_,$ZodCheckEndsWith:()=>E_,$ZodCheckGreaterThan:()=>Kc,$ZodCheckIncludes:()=>__,$ZodCheckLengthEquals:()=>g_,$ZodCheckLessThan:()=>Wc,$ZodCheckLowerCase:()=>y_,$ZodCheckMaxLength:()=>p_,$ZodCheckMaxSize:()=>c_,$ZodCheckMimeType:()=>C_,$ZodCheckMinLength:()=>m_,$ZodCheckMinSize:()=>d_,$ZodCheckMultipleOf:()=>a_,$ZodCheckNumberFormat:()=>u_,$ZodCheckOverwrite:()=>T_,$ZodCheckProperty:()=>S_,$ZodCheckRegex:()=>h_,$ZodCheckSizeEquals:()=>f_,$ZodCheckStartsWith:()=>x_,$ZodCheckStringFormat:()=>zi,$ZodCheckUpperCase:()=>v_,$ZodCodec:()=>Ga,$ZodCustom:()=>Mx,$ZodCustomStringFormat:()=>Q_,$ZodDate:()=>lx,$ZodDefault:()=>Tx,$ZodDiscriminatedUnion:()=>px,$ZodE164:()=>Y_,$ZodEmail:()=>k_,$ZodEmoji:()=>N_,$ZodEncodeError:()=>_r,$ZodEnum:()=>vx,$ZodError:()=>$a,$ZodExactOptional:()=>Sx,$ZodFile:()=>xx,$ZodFunction:()=>$x,$ZodGUID:()=>w_,$ZodIPv4:()=>q_,$ZodIPv6:()=>V_,$ZodISODate:()=>z_,$ZodISODateTime:()=>F_,$ZodISODuration:()=>B_,$ZodISOTime:()=>G_,$ZodIntersection:()=>mx,$ZodJWT:()=>X_,$ZodKSUID:()=>U_,$ZodLazy:()=>Ox,$ZodLiteral:()=>_x,$ZodMAC:()=>Z_,$ZodMap:()=>hx,$ZodNaN:()=>Rx,$ZodNanoID:()=>$_,$ZodNever:()=>ax,$ZodNonOptional:()=>Ax,$ZodNull:()=>ox,$ZodNullable:()=>Cx,$ZodNumber:()=>ed,$ZodNumberFormat:()=>ex,$ZodObject:()=>iO,$ZodObjectJIT:()=>dx,$ZodOptional:()=>rd,$ZodPipe:()=>od,$ZodPrefault:()=>Ix,$ZodPreprocess:()=>kx,$ZodPromise:()=>Dx,$ZodReadonly:()=>Px,$ZodRealError:()=>St,$ZodRecord:()=>gx,$ZodRegistry:()=>id,$ZodSet:()=>yx,$ZodString:()=>Qr,$ZodStringFormat:()=>ye,$ZodSuccess:()=>bx,$ZodSymbol:()=>nx,$ZodTemplateLiteral:()=>Nx,$ZodTransform:()=>Ex,$ZodTuple:()=>nd,$ZodType:()=>Y,$ZodULID:()=>M_,$ZodURL:()=>P_,$ZodUUID:()=>R_,$ZodUndefined:()=>rx,$ZodUnion:()=>za,$ZodUnknown:()=>sx,$ZodVoid:()=>ux,$ZodXID:()=>L_,$ZodXor:()=>fx,$brand:()=>pv,$constructor:()=>I,$input:()=>$E,$output:()=>NE,Doc:()=>Ua,JSONSchema:()=>iC,JSONSchemaGenerator:()=>Od,NEVER:()=>fv,TimePrecision:()=>UE,_any:()=>iS,_array:()=>fS,_base64:()=>Cd,_base64url:()=>Td,_bigint:()=>XE,_boolean:()=>jE,_catch:()=>KY,_check:()=>fO,_cidrv4:()=>Ed,_cidrv6:()=>Sd,_coercedBigint:()=>QE,_coercedBoolean:()=>YE,_coercedDate:()=>cS,_coercedNumber:()=>VE,_coercedString:()=>ME,_cuid:()=>md,_cuid2:()=>gd,_custom:()=>mS,_date:()=>lS,_decode:()=>Fc,_decodeAsync:()=>Gc,_default:()=>HY,_discriminatedUnion:()=>DY,_e164:()=>Id,_email:()=>ad,_emoji:()=>fd,_encode:()=>Uc,_encodeAsync:()=>zc,_endsWith:()=>Ji,_enum:()=>zY,_file:()=>pS,_float32:()=>HE,_float64:()=>JE,_gt:()=>vn,_gte:()=>pt,_guid:()=>Ha,_includes:()=>Zi,_int:()=>ZE,_int32:()=>WE,_int64:()=>eS,_intersection:()=>OY,_ipv4:()=>_d,_ipv6:()=>xd,_isoDate:()=>zE,_isoDateTime:()=>FE,_isoDuration:()=>BE,_isoTime:()=>GE,_jwt:()=>Ad,_ksuid:()=>vd,_lazy:()=>QY,_length:()=>ro,_literal:()=>BY,_lowercase:()=>qi,_lt:()=>yn,_lte:()=>Nt,_mac:()=>LE,_map:()=>UY,_max:()=>Nt,_maxLength:()=>no,_maxSize:()=>Ir,_mime:()=>Wi,_min:()=>pt,_minLength:()=>Jn,_minSize:()=>_n,_multipleOf:()=>Tr,_nan:()=>dS,_nanoid:()=>pd,_nativeEnum:()=>GY,_negative:()=>wd,_never:()=>aS,_nonnegative:()=>kd,_nonoptional:()=>JY,_nonpositive:()=>Rd,_normalize:()=>Ki,_null:()=>oS,_nullable:()=>ZY,_number:()=>qE,_optional:()=>VY,_overwrite:()=>un,_parse:()=>Mi,_parseAsync:()=>Li,_pipe:()=>jY,_positive:()=>bd,_promise:()=>eX,_property:()=>Pd,_readonly:()=>YY,_record:()=>LY,_refine:()=>gS,_regex:()=>Bi,_safeDecode:()=>qc,_safeDecodeAsync:()=>Zc,_safeEncode:()=>Bc,_safeEncodeAsync:()=>Vc,_safeParse:()=>Ui,_safeParseAsync:()=>Fi,_set:()=>FY,_size:()=>to,_slugify:()=>Qi,_startsWith:()=>Hi,_string:()=>OE,_stringFormat:()=>es,_stringbool:()=>_S,_success:()=>WY,_superRefine:()=>hS,_symbol:()=>nS,_templateLiteral:()=>XY,_toLowerCase:()=>Yi,_toUpperCase:()=>Xi,_transform:()=>qY,_trim:()=>ji,_tuple:()=>MY,_uint32:()=>KE,_uint64:()=>tS,_ulid:()=>hd,_undefined:()=>rS,_union:()=>NY,_unknown:()=>sS,_uppercase:()=>Vi,_url:()=>Ja,_uuid:()=>ud,_uuidv4:()=>ld,_uuidv6:()=>cd,_uuidv7:()=>dd,_void:()=>uS,_xid:()=>yd,_xor:()=>$Y,clone:()=>dt,config:()=>$e,createStandardJSONSchemaMethod:()=>ts,createToJSONSchemaMethod:()=>xS,decode:()=>e9,decodeAsync:()=>n9,describe:()=>yS,encode:()=>Qj,encodeAsync:()=>t9,extractDefs:()=>br,finalize:()=>wr,flattenError:()=>Da,formatError:()=>Oa,globalConfig:()=>jr,globalRegistry:()=>We,initializeContext:()=>Ar,isValidBase64:()=>W_,isValidBase64URL:()=>tO,isValidJWT:()=>nO,locales:()=>eo,meta:()=>vS,parse:()=>Mc,parseAsync:()=>Lc,prettifyError:()=>Rv,process:()=>ge,regexes:()=>Ct,registry:()=>sd,safeDecode:()=>o9,safeDecodeAsync:()=>s9,safeEncode:()=>r9,safeEncodeAsync:()=>i9,safeParse:()=>kv,safeParseAsync:()=>Pv,toDotPath:()=>DD,toJSONSchema:()=>Rr,treeifyError:()=>wv,util:()=>M,version:()=>A_});var wD,fv=Object.freeze({status:"aborted"});function I(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 y=g[h];y in l||(l[y]=d[y].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(I,"$constructor");var pv=Symbol("zod_brand"),gv=class gv extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};a(gv,"$ZodAsyncError");var an=gv,hv=class hv extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};a(hv,"$ZodEncodeError");var _r=hv,RD;(RD=(wD=globalThis).__zod_globalConfig)!=null||(wD.__zod_globalConfig={});var jr=globalThis.__zod_globalConfig;function $e(t){return t&&Object.assign(jr,t),jr}a($e,"config");var M={};Rn(M,{BIGINT_FORMAT_RANGES:()=>Iv,Class:()=>yv,NUMBER_FORMAT_RANGES:()=>Tv,aborted:()=>Cr,allowsEval:()=>xv,assert:()=>Pj,assertEqual:()=>bj,assertIs:()=>Rj,assertNever:()=>kj,assertNotEqual:()=>wj,assignProp:()=>Er,base64ToUint8Array:()=>PD,base64urlToUint8Array:()=>Wj,cached:()=>Di,captureStackTrace:()=>Oc,cleanEnum:()=>Jj,cleanRegex:()=>Ra,clone:()=>dt,cloneDef:()=>$j,createTransparentProxy:()=>Fj,defineLazy:()=>re,esc:()=>Dc,escapeRegex:()=>Zt,explicitlyAborted:()=>Av,extend:()=>Bj,finalizeIssue:()=>ft,floatSafeRemainder:()=>vv,getElementAtPath:()=>Dj,getEnumValues:()=>wa,getLengthableOrigin:()=>Na,getParsedType:()=>Uj,getSizableOrigin:()=>Pa,hexToUint8Array:()=>jj,isObject:()=>Yr,isPlainObject:()=>Sr,issue:()=>Oi,joinValues:()=>A,jsonStringifyReplacer:()=>$i,merge:()=>Vj,mergeDefs:()=>Hn,normalizeParams:()=>F,nullish:()=>xr,numKeys:()=>Lj,objectClone:()=>Nj,omit:()=>Gj,optionalKeys:()=>Cv,parsedType:()=>D,partial:()=>Zj,pick:()=>zj,prefixIssues:()=>Et,primitiveTypes:()=>Sv,promiseAllObject:()=>Oj,propertyKeyTypes:()=>ka,randomString:()=>Mj,required:()=>Hj,safeExtend:()=>qj,shallowClone:()=>Ev,slugify:()=>_v,stringifyPrimitive:()=>$,uint8ArrayToBase64:()=>ND,uint8ArrayToBase64url:()=>Kj,uint8ArrayToHex:()=>Yj,unwrapMessage:()=>ba});function bj(t){return t}a(bj,"assertEqual");function wj(t){return t}a(wj,"assertNotEqual");function Rj(t){}a(Rj,"assertIs");function kj(t){throw new Error("Unexpected value in exhaustive check")}a(kj,"assertNever");function Pj(t){}a(Pj,"assert");function wa(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(wa,"getEnumValues");function A(t,e="|"){return t.map(n=>$(n)).join(e)}a(A,"joinValues");function $i(t,e){return typeof e=="bigint"?e.toString():e}a($i,"jsonStringifyReplacer");function Di(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}a(Di,"cached");function xr(t){return t==null}a(xr,"nullish");function Ra(t){let e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}a(Ra,"cleanRegex");function vv(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(vv,"floatSafeRemainder");var kD=Symbol("evaluating");function re(t,e,n){let o;Object.defineProperty(t,e,{get(){if(o!==kD)return o===void 0&&(o=kD,o=n()),o},set(r){Object.defineProperty(t,e,{value:r})},configurable:!0})}a(re,"defineLazy");function Nj(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}a(Nj,"objectClone");function Er(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}a(Er,"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 $j(t){return Hn(t._zod.def)}a($j,"cloneDef");function Dj(t,e){return e?e.reduce((n,o)=>n==null?void 0:n[o],t):t}a(Dj,"getElementAtPath");function Oj(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(Oj,"promiseAllObject");function Mj(t=10){let e="abcdefghijklmnopqrstuvwxyz",n="";for(let o=0;o<t;o++)n+=e[Math.floor(Math.random()*e.length)];return n}a(Mj,"randomString");function Dc(t){return JSON.stringify(t)}a(Dc,"esc");function _v(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}a(_v,"slugify");var Oc="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Yr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(Yr,"isObject");var xv=Di(()=>{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 Sr(t){if(Yr(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let n=e.prototype;return!(Yr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}a(Sr,"isPlainObject");function Ev(t){return Sr(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}a(Ev,"shallowClone");function Lj(t){let e=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}a(Lj,"numKeys");var Uj=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"),ka=new Set(["string","number","symbol"]),Sv=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 Fj(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(Fj,"createTransparentProxy");function $(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}a($,"stringifyPrimitive");function Cv(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}a(Cv,"optionalKeys");var Tv={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]},Iv={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function zj(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 Er(this,"shape",s),s},checks:[]});return dt(t,i)}a(zj,"pick");function Gj(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 Er(this,"shape",s),s},checks:[]});return dt(t,i)}a(Gj,"omit");function Bj(t,e){if(!Sr(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 Er(this,"shape",i),i}});return dt(t,r)}a(Bj,"extend");function qj(t,e){if(!Sr(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 Er(this,"shape",o),o}});return dt(t,n)}a(qj,"safeExtend");function Vj(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 Er(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:(r=e._zod.def.checks)!=null?r:[]});return dt(t,n)}a(Vj,"merge");function Zj(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 Er(this,"shape",c),c},checks:[]});return dt(e,s)}a(Zj,"partial");function Hj(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 Er(this,"shape",i),i}});return dt(e,o)}a(Hj,"required");function Cr(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(Cr,"aborted");function Av(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(Av,"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 ba(t){return typeof t=="string"?t:t==null?void 0:t.message}a(ba,"unwrapMessage");function ft(t,e,n){var c,l,p,d,g,h,y,v,_,x,E;let o=t.message?t.message:(x=(_=(y=(g=ba((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:ba((d=e==null?void 0:e.error)==null?void 0:d.call(e,t)))!=null?y:ba((h=n.customError)==null?void 0:h.call(n,t)))!=null?_:ba((v=n.localeError)==null?void 0:v.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 Pa(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}a(Pa,"getSizableOrigin");function Na(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}a(Na,"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 Oi(...t){let[e,n,o]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:o}:{...e}}a(Oi,"issue");function Jj(t){return Object.entries(t).filter(([e,n])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a(Jj,"cleanEnum");function PD(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(PD,"base64ToUint8Array");function ND(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}a(ND,"uint8ArrayToBase64");function Wj(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-e.length%4)%4);return PD(e+n)}a(Wj,"base64urlToUint8Array");function Kj(t){return ND(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}a(Kj,"uint8ArrayToBase64url");function jj(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(jj,"hexToUint8Array");function Yj(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}a(Yj,"uint8ArrayToHex");var bv=class bv{constructor(...e){}};a(bv,"Class");var yv=bv;var $D=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,$i,2),Object.defineProperty(t,"toString",{value:a(()=>t.message,"value"),enumerable:!1})},"initializer"),$a=I("$ZodError",$D),St=I("$ZodError",$D,{Parent:Error});function Da(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(Da,"flattenError");function Oa(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(Oa,"formatError");function wv(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 y=n,v=0;for(;v<h.length;){let _=h[v],x=v===h.length-1;typeof _=="string"?((c=y.properties)!=null||(y.properties={}),(l=(s=y.properties)[_])!=null||(s[_]={errors:[]}),y=y.properties[_]):((p=y.items)!=null||(y.items=[]),(d=(u=y.items)[_])!=null||(u[_]={errors:[]}),y=y.items[_]),x&&y.errors.push(e(g)),v++}}},"processError");return o(t),n}a(wv,"treeifyError");function DD(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(DD,"toDotPath");function Rv(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 ${DD(r.path)}`);return e.join(`
|
|
18
|
+
`)}a(Rv,"prettifyError");var Mi=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,$e())));throw Oc(c,r==null?void 0:r.callee),c}return s.value},"_parse"),Mc=Mi(St),Li=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,$e())));throw Oc(c,r==null?void 0:r.callee),c}return s.value},"_parseAsync"),Lc=Li(St),Ui=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:$a)(i.issues.map(s=>ft(s,r,$e())))}:{success:!0,data:i.value}},"_safeParse"),kv=Ui(St),Fi=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,$e())))}:{success:!0,data:i.value}},"_safeParseAsync"),Pv=Fi(St),Uc=a(t=>(e,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return Mi(t)(e,n,r)},"_encode"),Qj=Uc(St),Fc=a(t=>(e,n,o)=>Mi(t)(e,n,o),"_decode"),e9=Fc(St),zc=a(t=>async(e,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return Li(t)(e,n,r)},"_encodeAsync"),t9=zc(St),Gc=a(t=>async(e,n,o)=>Li(t)(e,n,o),"_decodeAsync"),n9=Gc(St),Bc=a(t=>(e,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return Ui(t)(e,n,r)},"_safeEncode"),r9=Bc(St),qc=a(t=>(e,n,o)=>Ui(t)(e,n,o),"_safeDecode"),o9=qc(St),Vc=a(t=>async(e,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return Fi(t)(e,n,r)},"_safeEncodeAsync"),i9=Vc(St),Zc=a(t=>async(e,n,o)=>Fi(t)(e,n,o),"_safeDecodeAsync"),s9=Zc(St);var Ct={};Rn(Ct,{base64:()=>Jv,base64url:()=>Hc,bigint:()=>e_,boolean:()=>n_,browserEmail:()=>m9,cidrv4:()=>Zv,cidrv6:()=>Hv,cuid:()=>Nv,cuid2:()=>$v,date:()=>jv,datetime:()=>Xv,domain:()=>y9,duration:()=>Uv,e164:()=>Kv,email:()=>zv,emoji:()=>Gv,extendedDuration:()=>a9,guid:()=>Fv,hex:()=>v9,hostname:()=>h9,html5Email:()=>d9,httpProtocol:()=>Wv,idnEmail:()=>p9,integer:()=>t_,ipv4:()=>Bv,ipv6:()=>qv,ksuid:()=>Mv,lowercase:()=>i_,mac:()=>Vv,md5_base64:()=>x9,md5_base64url:()=>E9,md5_hex:()=>_9,nanoid:()=>Lv,null:()=>r_,number:()=>Jc,rfc5322Email:()=>f9,sha1_base64:()=>C9,sha1_base64url:()=>T9,sha1_hex:()=>S9,sha256_base64:()=>A9,sha256_base64url:()=>b9,sha256_hex:()=>I9,sha384_base64:()=>R9,sha384_base64url:()=>k9,sha384_hex:()=>w9,sha512_base64:()=>N9,sha512_base64url:()=>$9,sha512_hex:()=>P9,string:()=>Qv,time:()=>Yv,ulid:()=>Dv,undefined:()=>o_,unicodeEmail:()=>OD,uppercase:()=>s_,uuid:()=>Xr,uuid4:()=>u9,uuid6:()=>l9,uuid7:()=>c9,xid:()=>Ov});var Nv=/^[cC][0-9a-z]{6,}$/,$v=/^[0-9a-z]+$/,Dv=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ov=/^[0-9a-vA-V]{20}$/,Mv=/^[A-Za-z0-9]{27}$/,Lv=/^[a-zA-Z0-9_-]{21}$/,Uv=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,a9=/^[-+]?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)?)??$/,Fv=/^([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})$/,Xr=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"),u9=Xr(4),l9=Xr(6),c9=Xr(7),zv=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,d9=/^[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])?)*$/,f9=/^(([^<>()\[\]\\.,;:\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,}))$/,OD=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,p9=OD,m9=/^[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])?)*$/,g9="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Gv(){return new RegExp(g9,"u")}a(Gv,"emoji");var Bv=/^(?:(?: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])$/,qv=/^(([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}|:))$/,Vv=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"),Zv=/^((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])$/,Hv=/^(([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])$/,Jv=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Hc=/^[A-Za-z0-9_-]*$/,h9=/^(?=.{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])?)*\.?$/,y9=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Wv=/^https?$/,Kv=/^\+[1-9]\d{6,14}$/,MD="(?:(?:\\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])))",jv=new RegExp(`^${MD}$`);function LD(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(LD,"timeSource");function Yv(t){return new RegExp(`^${LD(t)}$`)}a(Yv,"time");function Xv(t){let e=LD({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(`^${MD}T(?:${o})$`)}a(Xv,"datetime");var Qv=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"),e_=/^-?\d+n?$/,t_=/^-?\d+$/,Jc=/^-?\d+(?:\.\d+)?$/,n_=/^(?:true|false)$/i,r_=/^null$/i;var o_=/^undefined$/i;var i_=/^[^A-Z]*$/,s_=/^[^a-z]*$/,v9=/^[0-9a-fA-F]*$/;function Ma(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}a(Ma,"fixedBase64");function La(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}a(La,"fixedBase64url");var _9=/^[0-9a-fA-F]{32}$/,x9=Ma(22,"=="),E9=La(22),S9=/^[0-9a-fA-F]{40}$/,C9=Ma(27,"="),T9=La(27),I9=/^[0-9a-fA-F]{64}$/,A9=Ma(43,"="),b9=La(43),w9=/^[0-9a-fA-F]{96}$/,R9=Ma(64,""),k9=La(64),P9=/^[0-9a-fA-F]{128}$/,N9=Ma(86,"=="),$9=La(86);var _e=I("$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=[])}),FD={number:"number",bigint:"bigint",object:"date"},Wc=I("$ZodCheckLessThan",(t,e)=>{_e.init(t,e);let n=FD[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})}}),Kc=I("$ZodCheckGreaterThan",(t,e)=>{_e.init(t,e);let n=FD[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})}}),a_=I("$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):vv(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})}}),u_=I("$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]=Tv[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=t_)}),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})}}),l_=I("$ZodCheckBigIntFormat",(t,e)=>{_e.init(t,e);let[n,o]=Iv[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})}}),c_=I("$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!xr(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:Pa(i),code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),d_=I("$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!xr(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:Pa(i),code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),f_=I("$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!xr(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:Pa(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})}}),p_=I("$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!xr(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=Na(i);r.issues.push({origin:u,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),m_=I("$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!xr(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=Na(i);r.issues.push({origin:u,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),g_=I("$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!xr(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=Na(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})}}),zi=I("$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=()=>{})}),h_=I("$ZodCheckRegex",(t,e)=>{zi.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})}}),y_=I("$ZodCheckLowerCase",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=i_),zi.init(t,e)}),v_=I("$ZodCheckUpperCase",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=s_),zi.init(t,e)}),__=I("$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})}}),x_=I("$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})}}),E_=I("$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 UD(t,e,n){t.issues.length&&e.issues.push(...Et(n,t.issues))}a(UD,"handleCheckPropertyResult");var S_=I("$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=>UD(r,n,e.property));UD(o,n,e.property)}}),C_=I("$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})}}),T_=I("$ZodCheckOverwrite",(t,e)=>{_e.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});var I_=class I_{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(I_,"Doc");var Ua=I_;var A_={major:4,minor:4,patch:3};var Y=I("$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=A_;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=Cr(l),h;for(let y of p){if(y._zod.def.when){if(Av(l)||!y._zod.def.when(l))continue}else if(g)continue;let v=l.issues.length,_=y._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!==v&&(g||(g=Cr(l,v)))});else{if(l.issues.length===v)continue;g||(g=Cr(l,v))}}return h?h.then(()=>l):l},"runChecks"),c=a((l,p,d)=>{if(Cr(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=kv(t,u);return l.success?{value:l.data}:{issues:(c=l.error)==null?void 0:c.issues}}catch(l){return Pv(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}))}),Qr=I("$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:Qv(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}}),ye=I("$ZodStringFormat",(t,e)=>{zi.init(t,e),Qr.init(t,e)}),w_=I("$ZodGUID",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Fv),ye.init(t,e)}),R_=I("$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=Xr(i))}else(o=e.pattern)!=null||(e.pattern=Xr());ye.init(t,e)}),k_=I("$ZodEmail",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=zv),ye.init(t,e)}),P_=I("$ZodURL",(t,e)=>{ye.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)===Wv.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})}}}),N_=I("$ZodEmoji",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Gv()),ye.init(t,e)}),$_=I("$ZodNanoID",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Lv),ye.init(t,e)}),D_=I("$ZodCUID",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Nv),ye.init(t,e)}),O_=I("$ZodCUID2",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=$v),ye.init(t,e)}),M_=I("$ZodULID",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Dv),ye.init(t,e)}),L_=I("$ZodXID",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Ov),ye.init(t,e)}),U_=I("$ZodKSUID",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Mv),ye.init(t,e)}),F_=I("$ZodISODateTime",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Xv(e)),ye.init(t,e)}),z_=I("$ZodISODate",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=jv),ye.init(t,e)}),G_=I("$ZodISOTime",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Yv(e)),ye.init(t,e)}),B_=I("$ZodISODuration",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Uv),ye.init(t,e)}),q_=I("$ZodIPv4",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Bv),ye.init(t,e),t._zod.bag.format="ipv4"}),V_=I("$ZodIPv6",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=qv),ye.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})}}}),Z_=I("$ZodMAC",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Vv(e.delimiter)),ye.init(t,e),t._zod.bag.format="mac"}),H_=I("$ZodCIDRv4",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Zv),ye.init(t,e)}),J_=I("$ZodCIDRv6",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Hv),ye.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 W_(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(W_,"isValidBase64");var K_=I("$ZodBase64",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Jv),ye.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=o=>{W_(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:t,continue:!e.abort})}});function tO(t){if(!Hc.test(t))return!1;let e=t.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return W_(n)}a(tO,"isValidBase64URL");var j_=I("$ZodBase64URL",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Hc),ye.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=o=>{tO(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:t,continue:!e.abort})}}),Y_=I("$ZodE164",(t,e)=>{var n;(n=e.pattern)!=null||(e.pattern=Kv),ye.init(t,e)});function nO(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(nO,"isValidJWT");var X_=I("$ZodJWT",(t,e)=>{ye.init(t,e),t._zod.check=n=>{nO(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),Q_=I("$ZodCustomStringFormat",(t,e)=>{ye.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})}}),ed=I("$ZodNumber",(t,e)=>{var n;Y.init(t,e),t._zod.pattern=(n=t._zod.bag.pattern)!=null?n:Jc,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}}),ex=I("$ZodNumberFormat",(t,e)=>{u_.init(t,e),ed.init(t,e)}),Fa=I("$ZodBoolean",(t,e)=>{Y.init(t,e),t._zod.pattern=n_,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}}),td=I("$ZodBigInt",(t,e)=>{Y.init(t,e),t._zod.pattern=e_,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}}),tx=I("$ZodBigIntFormat",(t,e)=>{l_.init(t,e),td.init(t,e)}),nx=I("$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}}),rx=I("$ZodUndefined",(t,e)=>{Y.init(t,e),t._zod.pattern=o_,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}}),ox=I("$ZodNull",(t,e)=>{Y.init(t,e),t._zod.pattern=r_,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}}),ix=I("$ZodAny",(t,e)=>{Y.init(t,e),t._zod.parse=n=>n}),sx=I("$ZodUnknown",(t,e)=>{Y.init(t,e),t._zod.parse=n=>n}),ax=I("$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)}),ux=I("$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}}),lx=I("$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 cx=I("$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 Qc(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(Qc,"handlePropertyResult");function rO(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=Cv(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}a(rO,"normalizeDef");function oO(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(y=>Qc(y,n,g,e,p,d))):Qc(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(oO,"handleCatchall");var iO=I("$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=Di(()=>rO(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=Yr,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],y=h._zod.optin==="optional",v=h._zod.optout==="optional",_=h._zod.run({value:l[g],issues:[]},c);_ instanceof Promise?p.push(_.then(x=>Qc(x,u,g,l,y,v))):Qc(_,u,g,l,y,v)}return i?oO(p,l,u,c,o.value,t):p.length?Promise.all(p).then(()=>u):u}}),dx=I("$ZodObjectJIT",(t,e)=>{iO.init(t,e);let n=t._zod.parse,o=Di(()=>rO(e)),r=a(g=>{var C,S;let h=new Ua(["shape","payload","ctx"]),y=o.value,v=a(T=>{let b=Dc(T);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`},"parseStr");h.write("const input = payload.value;");let _=Object.create(null),x=0;for(let T of y.keys)_[T]=`key_${x++}`;h.write("const newResult = {};");for(let T of y.keys){let b=_[T],R=Dc(T),B=g[T],P=((C=B==null?void 0:B._zod)==null?void 0:C.optin)==="optional",V=((S=B==null?void 0:B._zod)==null?void 0:S.optout)==="optional";h.write(`const ${b} = ${v(T)};`),P&&V?h.write(`
|
|
21
|
+
if (${b}.issues.length) {
|
|
22
|
+
if (${R} in input) {
|
|
23
|
+
payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
|
|
24
|
+
...iss,
|
|
25
|
+
path: iss.path ? [${R}, ...iss.path] : [${R}]
|
|
26
|
+
})));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (${b}.value === undefined) {
|
|
31
|
+
if (${R} in input) {
|
|
32
|
+
newResult[${R}] = undefined;
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
newResult[${R}] = ${b}.value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
`):P?h.write(`
|
|
39
|
+
if (${b}.issues.length) {
|
|
40
|
+
payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
|
|
41
|
+
...iss,
|
|
42
|
+
path: iss.path ? [${R}, ...iss.path] : [${R}]
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (${b}.value === undefined) {
|
|
47
|
+
if (${R} in input) {
|
|
48
|
+
newResult[${R}] = undefined;
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
newResult[${R}] = ${b}.value;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
`):h.write(`
|
|
55
|
+
const ${b}_present = ${R} in input;
|
|
56
|
+
if (${b}.issues.length) {
|
|
57
|
+
payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
|
|
58
|
+
...iss,
|
|
59
|
+
path: iss.path ? [${R}, ...iss.path] : [${R}]
|
|
60
|
+
})));
|
|
61
|
+
}
|
|
62
|
+
if (!${b}_present && !${b}.issues.length) {
|
|
63
|
+
payload.issues.push({
|
|
64
|
+
code: "invalid_type",
|
|
65
|
+
expected: "nonoptional",
|
|
66
|
+
input: undefined,
|
|
67
|
+
path: [${R}]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (${b}_present) {
|
|
72
|
+
if (${b}.value === undefined) {
|
|
73
|
+
newResult[${R}] = undefined;
|
|
74
|
+
} else {
|
|
75
|
+
newResult[${R}] = ${b}.value;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
`)}h.write("payload.value = newResult;"),h.write("return payload;");let E=h.compile();return(T,b)=>E(g,T,b)},"generateFastpass"),i,s=Yr,u=!jr.jitless,l=u&&xv.value,p=e.catchall,d;t._zod.parse=(g,h)=>{d!=null||(d=o.value);let y=g.value;return s(y)?u&&l&&(h==null?void 0:h.async)===!1&&h.jitless!==!0?(i||(i=r(e.shape)),g=i(g,h),p?oO([],y,g,h,d,t):g):n(g,h):(g.issues.push({expected:"object",code:"invalid_type",input:y,inst:t}),g)}});function BD(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=>!Cr(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,$e())))}),e)}a(BD,"handleUnionResults");var za=I("$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=>Ra(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=>BD(u,o,t,r)):BD(s,o,t,r)}});function qD(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,$e())))}):e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:[],inclusive:!1}),e)}a(qD,"handleExclusiveUnionResults");var fx=I("$ZodXor",(t,e)=>{za.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=>qD(u,o,t,r)):qD(s,o,t,r)}}),px=I("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,za.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=Di(()=>{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(!Yr(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)}}),mx=I("$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])=>VD(n,c,l)):VD(n,i,s)}});function b_(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(Sr(t)&&Sr(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=b_(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=b_(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(b_,"mergeValues");function VD(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}),Cr(t))return t;let s=b_(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(VD,"handleIntersectionResults");var nd=I("$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=ZD(n,"optin"),c=ZD(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(y=>HD(y,o,p))):HD(h,o,p)}}return s.length?Promise.all(s).then(()=>JD(l,o,n,i,c)):JD(l,o,n,i,c)}});function ZD(t,e){for(let n=t.length-1;n>=0;n--)if(t[n]._zod[e]!=="optional")return n+1;return 0}a(ZD,"getTupleOptStart");function HD(t,e,n){t.issues.length&&e.issues.push(...Et(n,t.issues)),e.value[n]=t.value}a(HD,"handleTupleResult");function JD(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(JD,"handleTupleResults");var gx=I("$ZodRecord",(t,e)=>{Y.init(t,e),t._zod.parse=(n,o)=>{let r=n.value;if(!Sr(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,$e())),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"&&Jc.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,$e())),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}}),hx=I("$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])=>{WD(p,d,n,s,r,t,o)})):WD(c,l,n,s,r,t,o)}return i.length?Promise.all(i).then(()=>n):n}});function WD(t,e,n,o,r,i,s){t.issues.length&&(ka.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,$e()))})),e.issues.length&&(ka.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,$e()))})),n.value.set(t.value,e.value)}a(WD,"handleMapResult");var yx=I("$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=>KD(c,n))):KD(u,n)}return i.length?Promise.all(i).then(()=>n):n}});function KD(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}a(KD,"handleSetResult");var vx=I("$ZodEnum",(t,e)=>{Y.init(t,e);let n=wa(e.entries),o=new Set(n);t._zod.values=o,t._zod.pattern=new RegExp(`^(${n.filter(r=>ka.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}}),_x=I("$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}}),xx=I("$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}}),Ex=I("$ZodTransform",(t,e)=>{Y.init(t,e),t._zod.optin="optional",t._zod.parse=(n,o)=>{if(o.direction==="backward")throw new _r(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 jD(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}a(jD,"handleOptionalResult");var rd=I("$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(`^(${Ra(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=>jD(s,r)):jD(i,r)}return n.value===void 0?n:e.innerType._zod.run(n,o)}}),Sx=I("$ZodExactOptional",(t,e)=>{rd.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)}),Cx=I("$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(`^(${Ra(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)}),Tx=I("$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=>YD(i,e)):YD(r,e)}});function YD(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}a(YD,"handleDefaultResult");var Ix=I("$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))}),Ax=I("$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=>XD(i,t)):XD(r,t)}});function XD(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(XD,"handleNonOptionalResult");var bx=I("$ZodSuccess",(t,e)=>{Y.init(t,e),t._zod.parse=(n,o)=>{if(o.direction==="backward")throw new _r("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)}}),wx=I("$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,$e()))},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,$e()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),Rx=I("$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)}),od=I("$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=>jc(s,e.in,o)):jc(i,e.in,o)}let r=e.in._zod.run(n,o);return r instanceof Promise?r.then(i=>jc(i,e.out,o)):jc(r,e.out,o)}});function jc(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(jc,"handlePipeResult");var Ga=I("$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=>Yc(s,e,o)):Yc(i,e,o)}else{let i=e.out._zod.run(n,o);return i instanceof Promise?i.then(s=>Yc(s,e,o)):Yc(i,e,o)}}});function Yc(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=>Xc(t,i,e.out,n)):Xc(t,r,e.out,n)}else{let r=e.reverseTransform(t.value,t);return r instanceof Promise?r.then(i=>Xc(t,i,e.in,n)):Xc(t,r,e.in,n)}}a(Yc,"handleCodecAResult");function Xc(t,e,n,o){return t.issues.length?(t.aborted=!0,t):n._zod.run({value:e,issues:t.issues},o)}a(Xc,"handleCodecTxResult");var kx=I("$ZodPreprocess",(t,e)=>{od.init(t,e)}),Px=I("$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(QD):QD(r)}});function QD(t){return t.value=Object.freeze(t.value),t}a(QD,"handleReadonlyResult");var Nx=I("$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||Sv.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)}}),$x=I("$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?Mc(t._def.input,o):o,i=Reflect.apply(n,this,r);return t._def.output?Mc(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 Lc(t._def.input,o):o,i=await Reflect.apply(n,this,r);return t._def.output?await Lc(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 nd({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)),Dx=I("$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))}),Ox=I("$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)}),Mx=I("$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=>eO(i,n,o,t));eO(r,n,o,t)}});function eO(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(Oi(i))}}a(eO,"handleRefineResult");var eo={};Rn(eo,{ar:()=>Lx,az:()=>Ux,be:()=>Fx,bg:()=>zx,ca:()=>Gx,cs:()=>Bx,da:()=>qx,de:()=>Vx,el:()=>Zx,en:()=>Ba,eo:()=>Hx,es:()=>Jx,fa:()=>Wx,fi:()=>Kx,fr:()=>jx,frCA:()=>Yx,he:()=>Xx,hr:()=>Qx,hu:()=>eE,hy:()=>tE,id:()=>nE,is:()=>rE,it:()=>oE,ja:()=>iE,ka:()=>sE,kh:()=>aE,km:()=>qa,ko:()=>uE,lt:()=>lE,mk:()=>cE,ms:()=>dE,nl:()=>fE,no:()=>pE,ota:()=>mE,pl:()=>hE,ps:()=>gE,pt:()=>yE,ro:()=>vE,ru:()=>_E,sl:()=>xE,sv:()=>EE,ta:()=>SE,th:()=>CE,tr:()=>TE,ua:()=>IE,uk:()=>Za,ur:()=>AE,uz:()=>bE,vi:()=>wE,yo:()=>PE,zhCN:()=>RE,zhTW:()=>kE});var O9=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 Lx(){return{localeError:O9()}}a(Lx,"default");var M9=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 Ux(){return{localeError:M9()}}a(Ux,"default");function sO(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(sO,"getBelarusianPlural");var L9=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=sO(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=sO(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 Fx(){return{localeError:L9()}}a(Fx,"default");var U9=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 zx(){return{localeError:U9()}}a(zx,"default");var F9=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 Gx(){return{localeError:F9()}}a(Gx,"default");var z9=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 y=(i=o[r.expected])!=null?i:r.expected,v=D(r.input),_=(s=o[v])!=null?s:v;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 ${y}, 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 y=r.inclusive?"<=":"<",v=e(r.origin);return v?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${(u=r.origin)!=null?u:"hodnota"} mus\xED m\xEDt ${y}${r.maximum.toString()} ${(c=v.unit)!=null?c:"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${(l=r.origin)!=null?l:"hodnota"} mus\xED b\xFDt ${y}${r.maximum.toString()}`}case"too_small":{let y=r.inclusive?">=":">",v=e(r.origin);return v?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${(p=r.origin)!=null?p:"hodnota"} mus\xED m\xEDt ${y}${r.minimum.toString()} ${(d=v.unit)!=null?d:"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${(g=r.origin)!=null?g:"hodnota"} mus\xED b\xFDt ${y}${r.minimum.toString()}`}case"invalid_format":{let y=r;return y.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${y.prefix}"`:y.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${y.suffix}"`:y.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${y.includes}"`:y.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${y.pattern}`:`Neplatn\xFD form\xE1t ${(h=n[y.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 Bx(){return{localeError:z9()}}a(Bx,"default");var G9=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 qx(){return{localeError:G9()}}a(qx,"default");var B9=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 Vx(){return{localeError:B9()}}a(Vx,"default");var q9=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 Zx(){return{localeError:q9()}}a(Zx,"default");var V9=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 Ba(){return{localeError:V9()}}a(Ba,"default");var Z9=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 Hx(){return{localeError:Z9()}}a(Hx,"default");var H9=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,y=D(r.input),v=(s=o[y])!=null?s:y;return/^[A-Z]/.test(r.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${v}`:`Entrada inv\xE1lida: se esperaba ${h}, recibido ${v}`}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?"<=":"<",y=e(r.origin),v=(u=o[r.origin])!=null?u:r.origin;return y?`Demasiado grande: se esperaba que ${v!=null?v:"valor"} tuviera ${h}${r.maximum.toString()} ${(c=y.unit)!=null?c:"elementos"}`:`Demasiado grande: se esperaba que ${v!=null?v:"valor"} fuera ${h}${r.maximum.toString()}`}case"too_small":{let h=r.inclusive?">=":">",y=e(r.origin),v=(l=o[r.origin])!=null?l:r.origin;return y?`Demasiado peque\xF1o: se esperaba que ${v} tuviera ${h}${r.minimum.toString()} ${y.unit}`:`Demasiado peque\xF1o: se esperaba que ${v} 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 Jx(){return{localeError:H9()}}a(Jx,"default");var J9=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 Wx(){return{localeError:J9()}}a(Wx,"default");var W9=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 Kx(){return{localeError:W9()}}a(Kx,"default");var K9=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,y=D(r.input),v=(s=o[y])!=null?s:y;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : instanceof ${r.expected} attendu, ${v} re\xE7u`:`Entr\xE9e invalide : ${h} attendu, ${v} 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?"<=":"<",y=e(r.origin);return y?`Trop grand : ${(u=o[r.origin])!=null?u:"valeur"} doit ${y.verb} ${h}${r.maximum.toString()} ${(c=y.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?">=":">",y=e(r.origin);return y?`Trop petit : ${(p=o[r.origin])!=null?p:"valeur"} doit ${y.verb} ${h}${r.minimum.toString()} ${y.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 jx(){return{localeError:K9()}}a(jx,"default");var j9=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 Yx(){return{localeError:j9()}}a(Yx,"default");var Y9=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,y,v,_,x,E,C,S,T,b,R,B,P,V,de,Ce,De,N;switch(l.code){case"invalid_type":{let O=l.expected,X=(p=c[O!=null?O:""])!=null?p:o(O),be=D(l.input),we=(h=(g=c[be])!=null?g:(d=t[be])==null?void 0:d.label)!=null?h:be;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((y=l.origin)!=null?y:"value");if(l.origin==="string")return`${(v=O==null?void 0:O.longLabel)!=null?v:"\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 fe=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 ${fe}`}if(l.origin==="array"||l.origin==="set"){let fe=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",Lt=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} ${fe} \u05DC\u05D4\u05DB\u05D9\u05DC ${Lt}`.trim()}let be=l.inclusive?"<=":"<",we=i((C=l.origin)!=null?C:"value");return O!=null&&O.unit?`${O.longLabel} \u05DE\u05D3\u05D9: ${X} ${we} ${be}${l.maximum.toString()} ${O.unit}`:`${(S=O==null?void 0:O.longLabel)!=null?S:"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${X} ${we} ${be}${l.maximum.toString()}`}case"too_small":{let O=s(l.origin),X=r((T=l.origin)!=null?T:"value");if(l.origin==="string")return`${(b=O==null?void 0:O.shortLabel)!=null?b:"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${X} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${(R=O==null?void 0:O.unit)!=null?R:""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let fe=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 ${fe}`}if(l.origin==="array"||l.origin==="set"){let fe=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let Lp=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${X} ${fe} \u05DC\u05D4\u05DB\u05D9\u05DC ${Lp}`}let Lt=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} ${(P=O==null?void 0:O.unit)!=null?P:""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${X} ${fe} \u05DC\u05D4\u05DB\u05D9\u05DC ${Lt}`.trim()}let be=l.inclusive?">=":">",we=i((V=l.origin)!=null?V:"value");return O!=null&&O.unit?`${O.shortLabel} \u05DE\u05D3\u05D9: ${X} ${we} ${be}${l.minimum.toString()} ${O.unit}`:`${(de=O==null?void 0:O.shortLabel)!=null?de:"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${X} ${we} ${be}${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],be=(Ce=X==null?void 0:X.label)!=null?Ce:O.format,fe=((De=X==null?void 0:X.gender)!=null?De:"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${be} \u05DC\u05D0 ${fe}`}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((N=l.origin)!=null?N:"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function Xx(){return{localeError:Y9()}}a(Xx,"default");var X9=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,y=D(r.input),v=(s=o[y])!=null?s:y;return/^[A-Z]/.test(r.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${r.expected}, a primljeno je ${v}`:`Neispravan unos: o\u010Dekuje se ${h}, a primljeno je ${v}`}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?"<=":"<",y=e(r.origin),v=(u=o[r.origin])!=null?u:r.origin;return y?`Preveliko: o\u010Dekivano da ${v!=null?v:"vrijednost"} ima ${h}${r.maximum.toString()} ${(c=y.unit)!=null?c:"elemenata"}`:`Preveliko: o\u010Dekivano da ${v!=null?v:"vrijednost"} bude ${h}${r.maximum.toString()}`}case"too_small":{let h=r.inclusive?">=":">",y=e(r.origin),v=(l=o[r.origin])!=null?l:r.origin;return y?`Premalo: o\u010Dekivano da ${v} ima ${h}${r.minimum.toString()} ${y.unit}`:`Premalo: o\u010Dekivano da ${v} 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 Qx(){return{localeError:X9()}}a(Qx,"default");var Q9=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 eE(){return{localeError:Q9()}}a(eE,"default");function aO(t,e,n){return Math.abs(t)===1?e:n}a(aO,"getArmenianPlural");function Gi(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(Gi,"withDefiniteArticle");var eY=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=aO(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 ${Gi((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 ${Gi((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=aO(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 ${Gi(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 ${Gi(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 ${Gi(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 ${Gi(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}},"error");function tE(){return{localeError:eY()}}a(tE,"default");var tY=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 nE(){return{localeError:tY()}}a(nE,"default");var nY=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 rE(){return{localeError:nY()}}a(rE,"default");var rY=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 oE(){return{localeError:rY()}}a(oE,"default");var oY=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 iE(){return{localeError:oY()}}a(iE,"default");var iY=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 sE(){return{localeError:iY()}}a(sE,"default");var sY=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 qa(){return{localeError:sY()}}a(qa,"default");function aE(){return qa()}a(aE,"default");var aY=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 y=(i=o[r.expected])!=null?i:r.expected,v=D(r.input),_=(s=o[v])!=null?s:v;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 ${y}, \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 y=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",v=y==="\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} ${y}${v}`:`${(l=r.origin)!=null?l:"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${y}${v}`}case"too_small":{let y=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",v=y==="\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} ${y}${v}`:`${(g=r.origin)!=null?g:"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${y}${v}`}case"invalid_format":{let y=r;return y.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${y.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:y.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${y.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:y.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${y.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:y.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${y.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${(h=n[y.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 uE(){return{localeError:aY()}}a(uE,"default");var Va=a(t=>t.charAt(0).toUpperCase()+t.slice(1),"capitalizeFirstCharacter");function uO(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(uO,"getUnitTypeFromNumber");var uY=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,y,v,_,x,E,C;switch(r.code){case"invalid_type":{let S=(i=o[r.expected])!=null?i:r.expected,T=D(r.input),b=(s=o[T])!=null?s:T;return/^[A-Z]/.test(r.expected)?`Gautas tipas ${b}, o tik\u0117tasi - instanceof ${r.expected}`:`Gautas tipas ${b}, 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,T=e(r.origin,uO(Number(r.maximum)),(c=r.inclusive)!=null?c:!1,"smaller");if(T!=null&&T.verb)return`${Va((l=S!=null?S:r.origin)!=null?l:"reik\u0161m\u0117")} ${T.verb} ${r.maximum.toString()} ${(p=T.unit)!=null?p:"element\u0173"}`;let b=r.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Va((d=S!=null?S:r.origin)!=null?d:"reik\u0161m\u0117")} turi b\u016Bti ${b} ${r.maximum.toString()} ${T==null?void 0:T.unit}`}case"too_small":{let S=(g=o[r.origin])!=null?g:r.origin,T=e(r.origin,uO(Number(r.minimum)),(h=r.inclusive)!=null?h:!1,"bigger");if(T!=null&&T.verb)return`${Va((y=S!=null?S:r.origin)!=null?y:"reik\u0161m\u0117")} ${T.verb} ${r.minimum.toString()} ${(v=T.unit)!=null?v:"element\u0173"}`;let b=r.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Va((_=S!=null?S:r.origin)!=null?_:"reik\u0161m\u0117")} turi b\u016Bti ${b} ${r.minimum.toString()} ${T==null?void 0:T.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`${Va((C=S!=null?S:r.origin)!=null?C:"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}},"error");function lE(){return{localeError:uY()}}a(lE,"default");var lY=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 cE(){return{localeError:lY()}}a(cE,"default");var cY=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 dE(){return{localeError:cY()}}a(dE,"default");var dY=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 fE(){return{localeError:dY()}}a(fE,"default");var fY=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 pE(){return{localeError:fY()}}a(pE,"default");var pY=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 mE(){return{localeError:pY()}}a(mE,"default");var mY=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 gE(){return{localeError:mY()}}a(gE,"default");var gY=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 y=(i=o[r.expected])!=null?i:r.expected,v=D(r.input),_=(s=o[v])!=null?s:v;return/^[A-Z]/.test(r.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${_}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${y}, 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 y=r.inclusive?"<=":"<",v=e(r.origin);return v?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${(u=r.origin)!=null?u:"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${y}${r.maximum.toString()} ${(c=v.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 ${y}${r.maximum.toString()}`}case"too_small":{let y=r.inclusive?">=":">",v=e(r.origin);return v?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${(p=r.origin)!=null?p:"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${y}${r.minimum.toString()} ${(d=v.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 ${y}${r.minimum.toString()}`}case"invalid_format":{let y=r;return y.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${y.prefix}"`:y.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${y.suffix}"`:y.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${y.includes}"`:y.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${y.pattern}`:`Nieprawid\u0142ow(y/a/e) ${(h=n[y.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 hE(){return{localeError:gY()}}a(hE,"default");var hY=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 yE(){return{localeError:hY()}}a(yE,"default");var yY=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 vE(){return{localeError:yY()}}a(vE,"default");function lO(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(lO,"getRussianPlural");var vY=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=lO(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=lO(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 _E(){return{localeError:vY()}}a(_E,"default");var _Y=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 xE(){return{localeError:_Y()}}a(xE,"default");var xY=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,y;switch(r.code){case"invalid_type":{let v=(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 ${v}, 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 v=r.inclusive?"<=":"<",_=e(r.origin);return _?`F\xF6r stor(t): f\xF6rv\xE4ntade ${(u=r.origin)!=null?u:"v\xE4rdet"} att ha ${v}${r.maximum.toString()} ${(c=_.unit)!=null?c:"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${(l=r.origin)!=null?l:"v\xE4rdet"} att ha ${v}${r.maximum.toString()}`}case"too_small":{let v=r.inclusive?">=":">",_=e(r.origin);return _?`F\xF6r lite(t): f\xF6rv\xE4ntade ${(p=r.origin)!=null?p:"v\xE4rdet"} att ha ${v}${r.minimum.toString()} ${_.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${(d=r.origin)!=null?d:"v\xE4rdet"} att ha ${v}${r.minimum.toString()}`}case"invalid_format":{let v=r;return v.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${v.prefix}"`:v.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${v.suffix}"`:v.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${v.includes}"`:v.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${v.pattern}"`:`Ogiltig(t) ${(g=n[v.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 ${(y=r.origin)!=null?y:"v\xE4rdet"}`;default:return"Ogiltig input"}}},"error");function EE(){return{localeError:xY()}}a(EE,"default");var EY=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 SE(){return{localeError:EY()}}a(SE,"default");var SY=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 CE(){return{localeError:SY()}}a(CE,"default");var CY=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 TE(){return{localeError:CY()}}a(TE,"default");var TY=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 Za(){return{localeError:TY()}}a(Za,"default");function IE(){return Za()}a(IE,"default");var IY=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 AE(){return{localeError:IY()}}a(AE,"default");var AY=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 bE(){return{localeError:AY()}}a(bE,"default");var bY=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 wE(){return{localeError:bY()}}a(wE,"default");var wY=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 RE(){return{localeError:wY()}}a(RE,"default");var RY=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 kE(){return{localeError:RY()}}a(kE,"default");var kY=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 PE(){return{localeError:kY()}}a(PE,"default");var cO,NE=Symbol("ZodOutput"),$E=Symbol("ZodInput"),DE=class DE{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(DE,"$ZodRegistry");var id=DE;function sd(){return new id}a(sd,"registry");var dO;(dO=(cO=globalThis).__zod_globalRegistry)!=null||(cO.__zod_globalRegistry=sd());var We=globalThis.__zod_globalRegistry;function OE(t,e){return new t({type:"string",...F(e)})}a(OE,"_string");function ME(t,e){return new t({type:"string",coerce:!0,...F(e)})}a(ME,"_coercedString");function ad(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...F(e)})}a(ad,"_email");function Ha(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...F(e)})}a(Ha,"_guid");function ud(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...F(e)})}a(ud,"_uuid");function ld(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...F(e)})}a(ld,"_uuidv4");function cd(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...F(e)})}a(cd,"_uuidv6");function dd(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...F(e)})}a(dd,"_uuidv7");function Ja(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...F(e)})}a(Ja,"_url");function fd(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...F(e)})}a(fd,"_emoji");function pd(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...F(e)})}a(pd,"_nanoid");function md(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...F(e)})}a(md,"_cuid");function gd(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...F(e)})}a(gd,"_cuid2");function hd(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...F(e)})}a(hd,"_ulid");function yd(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...F(e)})}a(yd,"_xid");function vd(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...F(e)})}a(vd,"_ksuid");function _d(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...F(e)})}a(_d,"_ipv4");function xd(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...F(e)})}a(xd,"_ipv6");function LE(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...F(e)})}a(LE,"_mac");function Ed(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...F(e)})}a(Ed,"_cidrv4");function Sd(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...F(e)})}a(Sd,"_cidrv6");function Cd(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...F(e)})}a(Cd,"_base64");function Td(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...F(e)})}a(Td,"_base64url");function Id(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...F(e)})}a(Id,"_e164");function Ad(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...F(e)})}a(Ad,"_jwt");var UE={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function FE(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...F(e)})}a(FE,"_isoDateTime");function zE(t,e){return new t({type:"string",format:"date",check:"string_format",...F(e)})}a(zE,"_isoDate");function GE(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...F(e)})}a(GE,"_isoTime");function BE(t,e){return new t({type:"string",format:"duration",check:"string_format",...F(e)})}a(BE,"_isoDuration");function qE(t,e){return new t({type:"number",checks:[],...F(e)})}a(qE,"_number");function VE(t,e){return new t({type:"number",coerce:!0,checks:[],...F(e)})}a(VE,"_coercedNumber");function ZE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...F(e)})}a(ZE,"_int");function HE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...F(e)})}a(HE,"_float32");function JE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...F(e)})}a(JE,"_float64");function WE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...F(e)})}a(WE,"_int32");function KE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...F(e)})}a(KE,"_uint32");function jE(t,e){return new t({type:"boolean",...F(e)})}a(jE,"_boolean");function YE(t,e){return new t({type:"boolean",coerce:!0,...F(e)})}a(YE,"_coercedBoolean");function XE(t,e){return new t({type:"bigint",...F(e)})}a(XE,"_bigint");function QE(t,e){return new t({type:"bigint",coerce:!0,...F(e)})}a(QE,"_coercedBigint");function eS(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...F(e)})}a(eS,"_int64");function tS(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...F(e)})}a(tS,"_uint64");function nS(t,e){return new t({type:"symbol",...F(e)})}a(nS,"_symbol");function rS(t,e){return new t({type:"undefined",...F(e)})}a(rS,"_undefined");function oS(t,e){return new t({type:"null",...F(e)})}a(oS,"_null");function iS(t){return new t({type:"any"})}a(iS,"_any");function sS(t){return new t({type:"unknown"})}a(sS,"_unknown");function aS(t,e){return new t({type:"never",...F(e)})}a(aS,"_never");function uS(t,e){return new t({type:"void",...F(e)})}a(uS,"_void");function lS(t,e){return new t({type:"date",...F(e)})}a(lS,"_date");function cS(t,e){return new t({type:"date",coerce:!0,...F(e)})}a(cS,"_coercedDate");function dS(t,e){return new t({type:"nan",...F(e)})}a(dS,"_nan");function yn(t,e){return new Wc({check:"less_than",...F(e),value:t,inclusive:!1})}a(yn,"_lt");function Nt(t,e){return new Wc({check:"less_than",...F(e),value:t,inclusive:!0})}a(Nt,"_lte");function vn(t,e){return new Kc({check:"greater_than",...F(e),value:t,inclusive:!1})}a(vn,"_gt");function pt(t,e){return new Kc({check:"greater_than",...F(e),value:t,inclusive:!0})}a(pt,"_gte");function bd(t){return vn(0,t)}a(bd,"_positive");function wd(t){return yn(0,t)}a(wd,"_negative");function Rd(t){return Nt(0,t)}a(Rd,"_nonpositive");function kd(t){return pt(0,t)}a(kd,"_nonnegative");function Tr(t,e){return new a_({check:"multiple_of",...F(e),value:t})}a(Tr,"_multipleOf");function Ir(t,e){return new c_({check:"max_size",...F(e),maximum:t})}a(Ir,"_maxSize");function _n(t,e){return new d_({check:"min_size",...F(e),minimum:t})}a(_n,"_minSize");function to(t,e){return new f_({check:"size_equals",...F(e),size:t})}a(to,"_size");function no(t,e){return new p_({check:"max_length",...F(e),maximum:t})}a(no,"_maxLength");function Jn(t,e){return new m_({check:"min_length",...F(e),minimum:t})}a(Jn,"_minLength");function ro(t,e){return new g_({check:"length_equals",...F(e),length:t})}a(ro,"_length");function Bi(t,e){return new h_({check:"string_format",format:"regex",...F(e),pattern:t})}a(Bi,"_regex");function qi(t){return new y_({check:"string_format",format:"lowercase",...F(t)})}a(qi,"_lowercase");function Vi(t){return new v_({check:"string_format",format:"uppercase",...F(t)})}a(Vi,"_uppercase");function Zi(t,e){return new __({check:"string_format",format:"includes",...F(e),includes:t})}a(Zi,"_includes");function Hi(t,e){return new x_({check:"string_format",format:"starts_with",...F(e),prefix:t})}a(Hi,"_startsWith");function Ji(t,e){return new E_({check:"string_format",format:"ends_with",...F(e),suffix:t})}a(Ji,"_endsWith");function Pd(t,e,n){return new S_({check:"property",property:t,schema:e,...F(n)})}a(Pd,"_property");function Wi(t,e){return new C_({check:"mime_type",mime:t,...F(e)})}a(Wi,"_mime");function un(t){return new T_({check:"overwrite",tx:t})}a(un,"_overwrite");function Ki(t){return un(e=>e.normalize(t))}a(Ki,"_normalize");function ji(){return un(t=>t.trim())}a(ji,"_trim");function Yi(){return un(t=>t.toLowerCase())}a(Yi,"_toLowerCase");function Xi(){return un(t=>t.toUpperCase())}a(Xi,"_toUpperCase");function Qi(){return un(t=>_v(t))}a(Qi,"_slugify");function fS(t,e,n){return new t({type:"array",element:e,...F(n)})}a(fS,"_array");function NY(t,e,n){return new t({type:"union",options:e,...F(n)})}a(NY,"_union");function $Y(t,e,n){return new t({type:"union",options:e,inclusive:!1,...F(n)})}a($Y,"_xor");function DY(t,e,n,o){return new t({type:"union",options:n,discriminator:e,...F(o)})}a(DY,"_discriminatedUnion");function OY(t,e,n){return new t({type:"intersection",left:e,right:n})}a(OY,"_intersection");function MY(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(MY,"_tuple");function LY(t,e,n,o){return new t({type:"record",keyType:e,valueType:n,...F(o)})}a(LY,"_record");function UY(t,e,n,o){return new t({type:"map",keyType:e,valueType:n,...F(o)})}a(UY,"_map");function FY(t,e,n){return new t({type:"set",valueType:e,...F(n)})}a(FY,"_set");function zY(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(zY,"_enum");function GY(t,e,n){return new t({type:"enum",entries:e,...F(n)})}a(GY,"_nativeEnum");function BY(t,e,n){return new t({type:"literal",values:Array.isArray(e)?e:[e],...F(n)})}a(BY,"_literal");function pS(t,e){return new t({type:"file",...F(e)})}a(pS,"_file");function qY(t,e){return new t({type:"transform",transform:e})}a(qY,"_transform");function VY(t,e){return new t({type:"optional",innerType:e})}a(VY,"_optional");function ZY(t,e){return new t({type:"nullable",innerType:e})}a(ZY,"_nullable");function HY(t,e,n){return new t({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():Ev(n)}})}a(HY,"_default");function JY(t,e,n){return new t({type:"nonoptional",innerType:e,...F(n)})}a(JY,"_nonoptional");function WY(t,e){return new t({type:"success",innerType:e})}a(WY,"_success");function KY(t,e,n){return new t({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}a(KY,"_catch");function jY(t,e,n){return new t({type:"pipe",in:e,out:n})}a(jY,"_pipe");function YY(t,e){return new t({type:"readonly",innerType:e})}a(YY,"_readonly");function XY(t,e,n){return new t({type:"template_literal",parts:e,...F(n)})}a(XY,"_templateLiteral");function QY(t,e){return new t({type:"lazy",getter:e})}a(QY,"_lazy");function eX(t,e){return new t({type:"promise",innerType:e})}a(eX,"_promise");function mS(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(mS,"_custom");function gS(t,e,n){return new t({type:"custom",check:"custom",fn:e,...F(n)})}a(gS,"_refine");function hS(t,e){let n=fO(o=>(o.addIssue=r=>{var i,s,u,c;if(typeof r=="string")o.issues.push(Oi(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(Oi(l))}},t(o.value,o)),e);return n}a(hS,"_superRefine");function fO(t,e){let n=new _e({check:"custom",...F(e)});return n._zod.check=t,n}a(fO,"_check");function yS(t){let e=new _e({check:"describe"});return e._zod.onattach=[n=>{var r;let o=(r=We.get(n))!=null?r:{};We.add(n,{...o,description:t})}],e._zod.check=()=>{},e}a(yS,"describe");function vS(t){let e=new _e({check:"meta"});return e._zod.onattach=[n=>{var r;let o=(r=We.get(n))!=null?r:{};We.add(n,{...o,...t})}],e._zod.check=()=>{},e}a(vS,"meta");function _S(t,e){var h,y,v,_,x;let n=F(e),o=(h=n.truthy)!=null?h:["true","1","yes","on","y","enabled"],r=(y=n.falsy)!=null?y:["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=(v=t.Codec)!=null?v:Ga,c=(_=t.Boolean)!=null?_:Fa,l=(x=t.String)!=null?x:Qr,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,C)=>{let S=E;return n.case!=="sensitive"&&(S=S.toLowerCase()),i.has(S)?!0:s.has(S)?!1:(C.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:C.value,inst:g,continue:!1}),{})}),"transform"),reverseTransform:a(((E,C)=>E===!0?o[0]||"true":r[0]||"false"),"reverseTransform"),error:n.error});return g}a(_S,"_stringbool");function es(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(es,"_stringFormat");function Ar(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:We,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(Ar,"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 v=s.schema,_=e.processors[r.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);_(t,e,v,h)}let y=t._zod.parent;y&&(s.ref||(s.ref=y),ge(y,e,h),e.seen.get(y).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 br(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 v,_,x,E,C;let d=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let S=(v=t.external.registry.get(p[0]))==null?void 0:v.id,T=(_=t.external.uri)!=null?_:(R=>R);if(S)return{ref:T(S)};let b=(E=(x=p[1].defId)!=null?x:p[1].schema.id)!=null?E:`schema${t.counter++}`;return p[1].defId=b,{defId:b,ref:`${T("__shared")}#/${d}/${b}`}}if(p[1]===n)return{ref:"#"};let h=`#/${d}/`,y=(C=p[1].schema.id)!=null?C:`__schema${t.counter++}`;return{defId:y,ref:h+y}},"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 y=d.schema;for(let v in y)delete y[v];y.$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(br,"extractDefs");function wr(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 C,S,T;let y=t.seen.get(h);if(y.ref===null)return;let v=(C=y.def)!=null?C:y.schema,_={...v},x=y.ref;if(y.ref=null,x){o(x);let b=t.seen.get(x),R=b.schema;if(R.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(v.allOf=(S=v.allOf)!=null?S:[],v.allOf.push(R)):Object.assign(v,R),Object.assign(v,_),h._zod.parent===x)for(let P in v)P==="$ref"||P==="allOf"||P in _||delete v[P];if(R.$ref&&b.def)for(let P in v)P==="$ref"||P==="allOf"||P in b.def&&JSON.stringify(v[P])===JSON.stringify(b.def[P])&&delete v[P]}let E=h._zod.parent;if(E&&E!==x){o(E);let b=t.seen.get(E);if(b!=null&&b.schema.$ref&&(v.$ref=b.schema.$ref,b.def))for(let R in v)R==="$ref"||R==="allOf"||R in b.def&&JSON.stringify(v[R])===JSON.stringify(b.def[R])&&delete v[R]}t.override({zodSchema:h,jsonSchema:v,path:(T=y.path)!=null?T:[]})},"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 y=h[1];y.def&&y.defId&&(y.def.id===y.defId&&delete y.def.id,s[y.defId]=y.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:ts(e,"input",t.processors),output:ts(e,"output",t.processors)}},enumerable:!1,writable:!1}),h}catch(h){throw new Error("Error converting schema to JSON.")}}a(wr,"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 xS=a((t,e={})=>n=>{let o=Ar({...n,processors:e});return ge(t,o),br(o,t),wr(o,t)},"createToJSONSchemaMethod"),ts=a((t,e,n={})=>o=>{let{libraryOptions:r,target:i}=o!=null?o:{},s=Ar({...r!=null?r:{},target:i,io:e,processors:n});return ge(t,s),br(s,t),wr(s,t)},"createStandardJSONSchemaMethod");var tX={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ES=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=tX[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"),SS=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"),CS=a((t,e,n,o)=>{n.type="boolean"},"booleanProcessor"),TS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},"bigintProcessor"),IS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},"symbolProcessor"),AS=a((t,e,n,o)=>{e.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},"nullProcessor"),bS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),wS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},"voidProcessor"),RS=a((t,e,n,o)=>{n.not={}},"neverProcessor"),kS=a((t,e,n,o)=>{},"anyProcessor"),PS=a((t,e,n,o)=>{},"unknownProcessor"),NS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},"dateProcessor"),$S=a((t,e,n,o)=>{let r=t._zod.def,i=wa(r.entries);i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},"enumProcessor"),DS=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"),OS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},"nanProcessor"),MS=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"),LS=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"),US=a((t,e,n,o)=>{n.type="boolean"},"successProcessor"),FS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},"customProcessor"),zS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},"functionProcessor"),GS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},"transformProcessor"),BS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},"mapProcessor"),qS=a((t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},"setProcessor"),VS=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"),ZS=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"),$d=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"),HS=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"),JS=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"),WS=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"),KS=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"),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},"nonoptionalProcessor"),YS=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"),XS=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"),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;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"),eC=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"),tC=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"),nC=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"),Dd=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"),rC=a((t,e,n,o)=>{let r=t._zod.innerType;ge(r,e,o);let i=e.seen.get(t);i.ref=r},"lazyProcessor"),Nd={string:ES,number:SS,boolean:CS,bigint:TS,symbol:IS,null:AS,undefined:bS,void:wS,never:RS,any:kS,unknown:PS,date:NS,enum:$S,literal:DS,nan:OS,template_literal:MS,file:LS,success:US,custom:FS,function:zS,transform:GS,map:BS,set:qS,array:VS,object:ZS,union:$d,intersection:HS,tuple:JS,record:WS,nullable:KS,nonoptional:jS,default:YS,prefault:XS,catch:QS,pipe:eC,readonly:tC,promise:nC,optional:Dd,lazy:rC};function Rr(t,e){if("_idmap"in t){let o=t,r=Ar({...e,processors:Nd}),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;br(r,p),s[l]=wr(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=Ar({...e,processors:Nd});return ge(t,n),br(n,t),wr(n,t)}a(Rr,"toJSONSchema");var oC=class oC{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=Ar({processors:Nd,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)),br(this.ctx,e);let o=wr(this.ctx,e),{"~standard":r,...i}=o;return i}};a(oC,"JSONSchemaGenerator");var Od=oC;var iC={};var Wa={};Rn(Wa,{ZodAny:()=>RC,ZodArray:()=>$C,ZodBase64:()=>nf,ZodBase64URL:()=>rf,ZodBigInt:()=>us,ZodBigIntFormat:()=>af,ZodBoolean:()=>as,ZodCIDRv4:()=>ef,ZodCIDRv6:()=>tf,ZodCUID:()=>Jd,ZodCUID2:()=>Wd,ZodCatch:()=>tT,ZodCodec:()=>su,ZodCustom:()=>au,ZodCustomStringFormat:()=>is,ZodDate:()=>tu,ZodDefault:()=>KC,ZodDiscriminatedUnion:()=>OC,ZodE164:()=>of,ZodEmail:()=>Vd,ZodEmoji:()=>Zd,ZodEnum:()=>rs,ZodExactOptional:()=>HC,ZodFile:()=>VC,ZodFunction:()=>dT,ZodGUID:()=>ja,ZodIPv4:()=>Xd,ZodIPv6:()=>Qd,ZodIntersection:()=>MC,ZodJWT:()=>sf,ZodKSUID:()=>Yd,ZodLazy:()=>uT,ZodLiteral:()=>qC,ZodMAC:()=>SC,ZodMap:()=>GC,ZodNaN:()=>rT,ZodNanoID:()=>Hd,ZodNever:()=>PC,ZodNonOptional:()=>pf,ZodNull:()=>bC,ZodNullable:()=>WC,ZodNumber:()=>ss,ZodNumberFormat:()=>so,ZodObject:()=>ru,ZodOptional:()=>ff,ZodPipe:()=>iu,ZodPrefault:()=>YC,ZodPreprocess:()=>oT,ZodPromise:()=>cT,ZodReadonly:()=>iT,ZodRecord:()=>ns,ZodSet:()=>BC,ZodString:()=>os,ZodStringFormat:()=>ve,ZodSuccess:()=>eT,ZodSymbol:()=>IC,ZodTemplateLiteral:()=>aT,ZodTransform:()=>ZC,ZodTuple:()=>UC,ZodType:()=>ee,ZodULID:()=>Kd,ZodURL:()=>eu,ZodUUID:()=>En,ZodUndefined:()=>AC,ZodUnion:()=>ou,ZodUnknown:()=>kC,ZodVoid:()=>NC,ZodXID:()=>jd,ZodXor:()=>DC,_ZodString:()=>qd,_default:()=>jC,_function:()=>EM,any:()=>XO,array:()=>nu,base64:()=>OO,base64url:()=>MO,bigint:()=>JO,boolean:()=>TC,catch:()=>nT,check:()=>SM,cidrv4:()=>$O,cidrv6:()=>DO,codec:()=>yM,cuid:()=>IO,cuid2:()=>AO,custom:()=>CM,date:()=>eM,describe:()=>TM,discriminatedUnion:()=>sM,e164:()=>LO,email:()=>gO,emoji:()=>CO,enum:()=>cf,exactOptional:()=>JC,file:()=>pM,float32:()=>qO,float64:()=>VO,function:()=>EM,guid:()=>hO,hash:()=>BO,hex:()=>GO,hostname:()=>zO,httpUrl:()=>SO,instanceof:()=>AM,int:()=>Gd,int32:()=>ZO,int64:()=>WO,intersection:()=>LC,invertCodec:()=>vM,ipv4:()=>kO,ipv6:()=>NO,json:()=>wM,jwt:()=>UO,keyof:()=>tM,ksuid:()=>RO,lazy:()=>lT,literal:()=>fM,looseObject:()=>oM,looseRecord:()=>uM,mac:()=>PO,map:()=>lM,meta:()=>IM,nan:()=>hM,nanoid:()=>TO,nativeEnum:()=>dM,never:()=>uf,nonoptional:()=>QC,null:()=>wC,nullable:()=>Xa,nullish:()=>mM,number:()=>CC,object:()=>nM,optional:()=>Ya,partialRecord:()=>aM,pipe:()=>Bd,prefault:()=>XC,preprocess:()=>RM,promise:()=>xM,readonly:()=>sT,record:()=>zC,refine:()=>fT,set:()=>cM,strictObject:()=>rM,string:()=>Ka,stringFormat:()=>FO,stringbool:()=>bM,success:()=>gM,superRefine:()=>pT,symbol:()=>jO,templateLiteral:()=>_M,transform:()=>df,tuple:()=>FC,uint32:()=>HO,uint64:()=>KO,ulid:()=>bO,undefined:()=>YO,union:()=>lf,unknown:()=>io,url:()=>EO,uuid:()=>yO,uuidv4:()=>vO,uuidv6:()=>_O,uuidv7:()=>xO,void:()=>QO,xid:()=>wO,xor:()=>iM});var Md={};Rn(Md,{endsWith:()=>Ji,gt:()=>vn,gte:()=>pt,includes:()=>Zi,length:()=>ro,lowercase:()=>qi,lt:()=>yn,lte:()=>Nt,maxLength:()=>no,maxSize:()=>Ir,mime:()=>Wi,minLength:()=>Jn,minSize:()=>_n,multipleOf:()=>Tr,negative:()=>wd,nonnegative:()=>kd,nonpositive:()=>Rd,normalize:()=>Ki,overwrite:()=>un,positive:()=>bd,property:()=>Pd,regex:()=>Bi,size:()=>to,slugify:()=>Qi,startsWith:()=>Hi,toLowerCase:()=>Yi,toUpperCase:()=>Xi,trim:()=>ji,uppercase:()=>Vi});var oo={};Rn(oo,{ZodISODate:()=>Ud,ZodISODateTime:()=>Ld,ZodISODuration:()=>zd,ZodISOTime:()=>Fd,date:()=>aC,datetime:()=>sC,duration:()=>lC,time:()=>uC});var Ld=I("ZodISODateTime",(t,e)=>{F_.init(t,e),ve.init(t,e)});function sC(t){return FE(Ld,t)}a(sC,"datetime");var Ud=I("ZodISODate",(t,e)=>{z_.init(t,e),ve.init(t,e)});function aC(t){return zE(Ud,t)}a(aC,"date");var Fd=I("ZodISOTime",(t,e)=>{G_.init(t,e),ve.init(t,e)});function uC(t){return GE(Fd,t)}a(uC,"time");var zd=I("ZodISODuration",(t,e)=>{B_.init(t,e),ve.init(t,e)});function lC(t){return BE(zd,t)}a(lC,"duration");var pO=a((t,e)=>{$a.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(n=>Oa(t,n),"value")},flatten:{value:a(n=>Da(t,n),"value")},addIssue:{value:a(n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,$i,2)},"value")},addIssues:{value:a(n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,$i,2)},"value")},isEmpty:{get(){return t.issues.length===0}}})},"initializer"),rX=I("ZodError",pO),Tt=I("ZodError",pO,{Parent:Error});var cC=Mi(Tt),dC=Li(Tt),fC=Ui(Tt),pC=Fi(Tt),mC=Uc(Tt),gC=Fc(Tt),hC=zc(Tt),yC=Gc(Tt),vC=Bc(Tt),_C=qc(Tt),xC=Vc(Tt),EC=Zc(Tt);var mO=new WeakMap;function Qa(t,e,n){let o=Object.getPrototypeOf(t),r=mO.get(o);if(r||(r=new Set,mO.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(Qa,"_installLazyMethods");var ee=I("ZodType",(t,e)=>(Y.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:ts(t,"input"),output:ts(t,"output")}}),t.toJSONSchema=xS(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(n,o)=>cC(t,n,o,{callee:t.parse}),t.safeParse=(n,o)=>fC(t,n,o),t.parseAsync=async(n,o)=>dC(t,n,o,{callee:t.parseAsync}),t.safeParseAsync=async(n,o)=>pC(t,n,o),t.spa=t.safeParseAsync,t.encode=(n,o)=>mC(t,n,o),t.decode=(n,o)=>gC(t,n,o),t.encodeAsync=async(n,o)=>hC(t,n,o),t.decodeAsync=async(n,o)=>yC(t,n,o),t.safeEncode=(n,o)=>vC(t,n,o),t.safeDecode=(n,o)=>_C(t,n,o),t.safeEncodeAsync=async(n,o)=>xC(t,n,o),t.safeDecodeAsync=async(n,o)=>EC(t,n,o),Qa(t,"ZodType",{check(...n){var r;let o=this.def;return this.clone(M.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(fT(n,o))},superRefine(n,o){return this.check(pT(n,o))},overwrite(n){return this.check(un(n))},optional(){return Ya(this)},exactOptional(){return JC(this)},nullable(){return Xa(this)},nullish(){return Ya(Xa(this))},nonoptional(n){return QC(this,n)},array(){return nu(this)},or(n){return lf([this,n])},and(n){return LC(this,n)},transform(n){return Bd(this,df(n))},default(n){return jC(this,n)},prefault(n){return XC(this,n)},catch(n){return nT(this,n)},pipe(n){return Bd(this,n)},readonly(){return sT(this)},describe(n){let o=this.clone();return We.add(o,{description:n}),o},meta(...n){if(n.length===0)return We.get(this);let o=this.clone();return We.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=We.get(t))==null?void 0:n.description},configurable:!0}),t)),qd=I("_ZodString",(t,e)=>{var o,r,i;Qr.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(s,u,c)=>ES(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,Qa(t,"_ZodString",{regex(...s){return this.check(Bi(...s))},includes(...s){return this.check(Zi(...s))},startsWith(...s){return this.check(Hi(...s))},endsWith(...s){return this.check(Ji(...s))},min(...s){return this.check(Jn(...s))},max(...s){return this.check(no(...s))},length(...s){return this.check(ro(...s))},nonempty(...s){return this.check(Jn(1,...s))},lowercase(s){return this.check(qi(s))},uppercase(s){return this.check(Vi(s))},trim(){return this.check(ji())},normalize(...s){return this.check(Ki(...s))},toLowerCase(){return this.check(Yi())},toUpperCase(){return this.check(Xi())},slugify(){return this.check(Qi())}})}),os=I("ZodString",(t,e)=>{Qr.init(t,e),qd.init(t,e),t.email=n=>t.check(ad(Vd,n)),t.url=n=>t.check(Ja(eu,n)),t.jwt=n=>t.check(Ad(sf,n)),t.emoji=n=>t.check(fd(Zd,n)),t.guid=n=>t.check(Ha(ja,n)),t.uuid=n=>t.check(ud(En,n)),t.uuidv4=n=>t.check(ld(En,n)),t.uuidv6=n=>t.check(cd(En,n)),t.uuidv7=n=>t.check(dd(En,n)),t.nanoid=n=>t.check(pd(Hd,n)),t.guid=n=>t.check(Ha(ja,n)),t.cuid=n=>t.check(md(Jd,n)),t.cuid2=n=>t.check(gd(Wd,n)),t.ulid=n=>t.check(hd(Kd,n)),t.base64=n=>t.check(Cd(nf,n)),t.base64url=n=>t.check(Td(rf,n)),t.xid=n=>t.check(yd(jd,n)),t.ksuid=n=>t.check(vd(Yd,n)),t.ipv4=n=>t.check(_d(Xd,n)),t.ipv6=n=>t.check(xd(Qd,n)),t.cidrv4=n=>t.check(Ed(ef,n)),t.cidrv6=n=>t.check(Sd(tf,n)),t.e164=n=>t.check(Id(of,n)),t.datetime=n=>t.check(sC(n)),t.date=n=>t.check(aC(n)),t.time=n=>t.check(uC(n)),t.duration=n=>t.check(lC(n))});function Ka(t){return OE(os,t)}a(Ka,"string");var ve=I("ZodStringFormat",(t,e)=>{ye.init(t,e),qd.init(t,e)}),Vd=I("ZodEmail",(t,e)=>{k_.init(t,e),ve.init(t,e)});function gO(t){return ad(Vd,t)}a(gO,"email");var ja=I("ZodGUID",(t,e)=>{w_.init(t,e),ve.init(t,e)});function hO(t){return Ha(ja,t)}a(hO,"guid");var En=I("ZodUUID",(t,e)=>{R_.init(t,e),ve.init(t,e)});function yO(t){return ud(En,t)}a(yO,"uuid");function vO(t){return ld(En,t)}a(vO,"uuidv4");function _O(t){return cd(En,t)}a(_O,"uuidv6");function xO(t){return dd(En,t)}a(xO,"uuidv7");var eu=I("ZodURL",(t,e)=>{P_.init(t,e),ve.init(t,e)});function EO(t){return Ja(eu,t)}a(EO,"url");function SO(t){return Ja(eu,{protocol:Ct.httpProtocol,hostname:Ct.domain,...M.normalizeParams(t)})}a(SO,"httpUrl");var Zd=I("ZodEmoji",(t,e)=>{N_.init(t,e),ve.init(t,e)});function CO(t){return fd(Zd,t)}a(CO,"emoji");var Hd=I("ZodNanoID",(t,e)=>{$_.init(t,e),ve.init(t,e)});function TO(t){return pd(Hd,t)}a(TO,"nanoid");var Jd=I("ZodCUID",(t,e)=>{D_.init(t,e),ve.init(t,e)});function IO(t){return md(Jd,t)}a(IO,"cuid");var Wd=I("ZodCUID2",(t,e)=>{O_.init(t,e),ve.init(t,e)});function AO(t){return gd(Wd,t)}a(AO,"cuid2");var Kd=I("ZodULID",(t,e)=>{M_.init(t,e),ve.init(t,e)});function bO(t){return hd(Kd,t)}a(bO,"ulid");var jd=I("ZodXID",(t,e)=>{L_.init(t,e),ve.init(t,e)});function wO(t){return yd(jd,t)}a(wO,"xid");var Yd=I("ZodKSUID",(t,e)=>{U_.init(t,e),ve.init(t,e)});function RO(t){return vd(Yd,t)}a(RO,"ksuid");var Xd=I("ZodIPv4",(t,e)=>{q_.init(t,e),ve.init(t,e)});function kO(t){return _d(Xd,t)}a(kO,"ipv4");var SC=I("ZodMAC",(t,e)=>{Z_.init(t,e),ve.init(t,e)});function PO(t){return LE(SC,t)}a(PO,"mac");var Qd=I("ZodIPv6",(t,e)=>{V_.init(t,e),ve.init(t,e)});function NO(t){return xd(Qd,t)}a(NO,"ipv6");var ef=I("ZodCIDRv4",(t,e)=>{H_.init(t,e),ve.init(t,e)});function $O(t){return Ed(ef,t)}a($O,"cidrv4");var tf=I("ZodCIDRv6",(t,e)=>{J_.init(t,e),ve.init(t,e)});function DO(t){return Sd(tf,t)}a(DO,"cidrv6");var nf=I("ZodBase64",(t,e)=>{K_.init(t,e),ve.init(t,e)});function OO(t){return Cd(nf,t)}a(OO,"base64");var rf=I("ZodBase64URL",(t,e)=>{j_.init(t,e),ve.init(t,e)});function MO(t){return Td(rf,t)}a(MO,"base64url");var of=I("ZodE164",(t,e)=>{Y_.init(t,e),ve.init(t,e)});function LO(t){return Id(of,t)}a(LO,"e164");var sf=I("ZodJWT",(t,e)=>{X_.init(t,e),ve.init(t,e)});function UO(t){return Ad(sf,t)}a(UO,"jwt");var is=I("ZodCustomStringFormat",(t,e)=>{Q_.init(t,e),ve.init(t,e)});function FO(t,e,n={}){return es(is,t,e,n)}a(FO,"stringFormat");function zO(t){return es(is,"hostname",Ct.hostname,t)}a(zO,"hostname");function GO(t){return es(is,"hex",Ct.hex,t)}a(GO,"hex");function BO(t,e){var i;let n=(i=e==null?void 0:e.enc)!=null?i:"hex",o=`${t}_${n}`,r=Ct[o];if(!r)throw new Error(`Unrecognized hash format: ${o}`);return es(is,o,r,e)}a(BO,"hash");var ss=I("ZodNumber",(t,e)=>{var o,r,i,s,u,c,l,p,d;ed.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(g,h,y)=>SS(t,g,h,y),Qa(t,"ZodNumber",{gt(g,h){return this.check(vn(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(yn(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(Gd(g))},safe(g){return this.check(Gd(g))},positive(g){return this.check(vn(0,g))},nonnegative(g){return this.check(pt(0,g))},negative(g){return this.check(yn(0,g))},nonpositive(g){return this.check(Nt(0,g))},multipleOf(g,h){return this.check(Tr(g,h))},step(g,h){return this.check(Tr(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 CC(t){return qE(ss,t)}a(CC,"number");var so=I("ZodNumberFormat",(t,e)=>{ex.init(t,e),ss.init(t,e)});function Gd(t){return ZE(so,t)}a(Gd,"int");function qO(t){return HE(so,t)}a(qO,"float32");function VO(t){return JE(so,t)}a(VO,"float64");function ZO(t){return WE(so,t)}a(ZO,"int32");function HO(t){return KE(so,t)}a(HO,"uint32");var as=I("ZodBoolean",(t,e)=>{Fa.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>CS(t,n,o,r)});function TC(t){return jE(as,t)}a(TC,"boolean");var us=I("ZodBigInt",(t,e)=>{var o,r,i;td.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(s,u,c)=>TS(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(vn(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(yn(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(vn(BigInt(0),s)),t.negative=s=>t.check(yn(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(Tr(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 JO(t){return XE(us,t)}a(JO,"bigint");var af=I("ZodBigIntFormat",(t,e)=>{tx.init(t,e),us.init(t,e)});function WO(t){return eS(af,t)}a(WO,"int64");function KO(t){return tS(af,t)}a(KO,"uint64");var IC=I("ZodSymbol",(t,e)=>{nx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>IS(t,n,o,r)});function jO(t){return nS(IC,t)}a(jO,"symbol");var AC=I("ZodUndefined",(t,e)=>{rx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>bS(t,n,o,r)});function YO(t){return rS(AC,t)}a(YO,"_undefined");var bC=I("ZodNull",(t,e)=>{ox.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>AS(t,n,o,r)});function wC(t){return oS(bC,t)}a(wC,"_null");var RC=I("ZodAny",(t,e)=>{ix.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>kS(t,n,o,r)});function XO(){return iS(RC)}a(XO,"any");var kC=I("ZodUnknown",(t,e)=>{sx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>PS(t,n,o,r)});function io(){return sS(kC)}a(io,"unknown");var PC=I("ZodNever",(t,e)=>{ax.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>RS(t,n,o,r)});function uf(t){return aS(PC,t)}a(uf,"never");var NC=I("ZodVoid",(t,e)=>{ux.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>wS(t,n,o,r)});function QO(t){return uS(NC,t)}a(QO,"_void");var tu=I("ZodDate",(t,e)=>{lx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(o,r,i)=>NS(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 eM(t){return lS(tu,t)}a(eM,"date");var $C=I("ZodArray",(t,e)=>{cx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>VS(t,n,o,r),t.element=e.element,Qa(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(no(n,o))},length(n,o){return this.check(ro(n,o))},unwrap(){return this.element}})});function nu(t,e){return fS($C,t,e)}a(nu,"array");function tM(t){let e=t._zod.def.shape;return cf(Object.keys(e))}a(tM,"keyof");var ru=I("ZodObject",(t,e)=>{dx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>ZS(t,n,o,r),M.defineLazy(t,"shape",()=>e.shape),Qa(t,"ZodObject",{keyof(){return cf(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:io()})},loose(){return this.clone({...this._zod.def,catchall:io()})},strict(){return this.clone({...this._zod.def,catchall:uf()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return M.extend(this,n)},safeExtend(n){return M.safeExtend(this,n)},merge(n){return M.merge(this,n)},pick(n){return M.pick(this,n)},omit(n){return M.omit(this,n)},partial(...n){return M.partial(ff,this,n[0])},required(...n){return M.required(pf,this,n[0])}})});function nM(t,e){let n={type:"object",shape:t!=null?t:{},...M.normalizeParams(e)};return new ru(n)}a(nM,"object");function rM(t,e){return new ru({type:"object",shape:t,catchall:uf(),...M.normalizeParams(e)})}a(rM,"strictObject");function oM(t,e){return new ru({type:"object",shape:t,catchall:io(),...M.normalizeParams(e)})}a(oM,"looseObject");var ou=I("ZodUnion",(t,e)=>{za.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>$d(t,n,o,r),t.options=e.options});function lf(t,e){return new ou({type:"union",options:t,...M.normalizeParams(e)})}a(lf,"union");var DC=I("ZodXor",(t,e)=>{ou.init(t,e),fx.init(t,e),t._zod.processJSONSchema=(n,o,r)=>$d(t,n,o,r),t.options=e.options});function iM(t,e){return new DC({type:"union",options:t,inclusive:!1,...M.normalizeParams(e)})}a(iM,"xor");var OC=I("ZodDiscriminatedUnion",(t,e)=>{ou.init(t,e),px.init(t,e)});function sM(t,e,n){return new OC({type:"union",options:e,discriminator:t,...M.normalizeParams(n)})}a(sM,"discriminatedUnion");var MC=I("ZodIntersection",(t,e)=>{mx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>HS(t,n,o,r)});function LC(t,e){return new MC({type:"intersection",left:t,right:e})}a(LC,"intersection");var UC=I("ZodTuple",(t,e)=>{nd.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>JS(t,n,o,r),t.rest=n=>t.clone({...t._zod.def,rest:n})});function FC(t,e,n){let o=e instanceof Y,r=o?n:e,i=o?e:null;return new UC({type:"tuple",items:t,rest:i,...M.normalizeParams(r)})}a(FC,"tuple");var ns=I("ZodRecord",(t,e)=>{gx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>WS(t,n,o,r),t.keyType=e.keyType,t.valueType=e.valueType});function zC(t,e,n){return!e||!e._zod?new ns({type:"record",keyType:Ka(),valueType:t,...M.normalizeParams(e)}):new ns({type:"record",keyType:t,valueType:e,...M.normalizeParams(n)})}a(zC,"record");function aM(t,e,n){let o=dt(t);return o._zod.values=void 0,new ns({type:"record",keyType:o,valueType:e,...M.normalizeParams(n)})}a(aM,"partialRecord");function uM(t,e,n){return new ns({type:"record",keyType:t,valueType:e,mode:"loose",...M.normalizeParams(n)})}a(uM,"looseRecord");var GC=I("ZodMap",(t,e)=>{hx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>BS(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(Ir(...n)),t.size=(...n)=>t.check(to(...n))});function lM(t,e,n){return new GC({type:"map",keyType:t,valueType:e,...M.normalizeParams(n)})}a(lM,"map");var BC=I("ZodSet",(t,e)=>{yx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>qS(t,n,o,r),t.min=(...n)=>t.check(_n(...n)),t.nonempty=n=>t.check(_n(1,n)),t.max=(...n)=>t.check(Ir(...n)),t.size=(...n)=>t.check(to(...n))});function cM(t,e){return new BC({type:"set",valueType:t,...M.normalizeParams(e)})}a(cM,"set");var rs=I("ZodEnum",(t,e)=>{vx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(o,r,i)=>$S(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 rs({...e,checks:[],...M.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 rs({...e,checks:[],...M.normalizeParams(r),entries:i})}});function cf(t,e){let n=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new rs({type:"enum",entries:n,...M.normalizeParams(e)})}a(cf,"_enum");function dM(t,e){return new rs({type:"enum",entries:t,...M.normalizeParams(e)})}a(dM,"nativeEnum");var qC=I("ZodLiteral",(t,e)=>{_x.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>DS(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 fM(t,e){return new qC({type:"literal",values:Array.isArray(t)?t:[t],...M.normalizeParams(e)})}a(fM,"literal");var VC=I("ZodFile",(t,e)=>{xx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>LS(t,n,o,r),t.min=(n,o)=>t.check(_n(n,o)),t.max=(n,o)=>t.check(Ir(n,o)),t.mime=(n,o)=>t.check(Wi(Array.isArray(n)?n:[n],o))});function pM(t){return pS(VC,t)}a(pM,"file");var ZC=I("ZodTransform",(t,e)=>{Ex.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>GS(t,n,o,r),t._zod.parse=(n,o)=>{if(o.direction==="backward")throw new _r(t.constructor.name);n.addIssue=i=>{var s,u,c;if(typeof i=="string")n.issues.push(M.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(M.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 df(t){return new ZC({type:"transform",transform:t})}a(df,"transform");var ff=I("ZodOptional",(t,e)=>{rd.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>Dd(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function Ya(t){return new ff({type:"optional",innerType:t})}a(Ya,"optional");var HC=I("ZodExactOptional",(t,e)=>{Sx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>Dd(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function JC(t){return new HC({type:"optional",innerType:t})}a(JC,"exactOptional");var WC=I("ZodNullable",(t,e)=>{Cx.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 Xa(t){return new WC({type:"nullable",innerType:t})}a(Xa,"nullable");function mM(t){return Ya(Xa(t))}a(mM,"nullish");var KC=I("ZodDefault",(t,e)=>{Tx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>YS(t,n,o,r),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function jC(t,e){return new KC({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():M.shallowClone(e)}})}a(jC,"_default");var YC=I("ZodPrefault",(t,e)=>{Ix.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>XS(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function XC(t,e){return new YC({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():M.shallowClone(e)}})}a(XC,"prefault");var pf=I("ZodNonOptional",(t,e)=>{Ax.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 QC(t,e){return new pf({type:"nonoptional",innerType:t,...M.normalizeParams(e)})}a(QC,"nonoptional");var eT=I("ZodSuccess",(t,e)=>{bx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>US(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function gM(t){return new eT({type:"success",innerType:t})}a(gM,"success");var tT=I("ZodCatch",(t,e)=>{wx.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.removeCatch=t.unwrap});function nT(t,e){return new tT({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}a(nT,"_catch");var rT=I("ZodNaN",(t,e)=>{Rx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>OS(t,n,o,r)});function hM(t){return dS(rT,t)}a(hM,"nan");var iu=I("ZodPipe",(t,e)=>{od.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>eC(t,n,o,r),t.in=e.in,t.out=e.out});function Bd(t,e){return new iu({type:"pipe",in:t,out:e})}a(Bd,"pipe");var su=I("ZodCodec",(t,e)=>{iu.init(t,e),Ga.init(t,e)});function yM(t,e,n){return new su({type:"pipe",in:t,out:e,transform:n.decode,reverseTransform:n.encode})}a(yM,"codec");function vM(t){let e=t._zod.def;return new su({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}a(vM,"invertCodec");var oT=I("ZodPreprocess",(t,e)=>{iu.init(t,e),kx.init(t,e)}),iT=I("ZodReadonly",(t,e)=>{Px.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>tC(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function sT(t){return new iT({type:"readonly",innerType:t})}a(sT,"readonly");var aT=I("ZodTemplateLiteral",(t,e)=>{Nx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>MS(t,n,o,r)});function _M(t,e){return new aT({type:"template_literal",parts:t,...M.normalizeParams(e)})}a(_M,"templateLiteral");var uT=I("ZodLazy",(t,e)=>{Ox.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>rC(t,n,o,r),t.unwrap=()=>t._zod.def.getter()});function lT(t){return new uT({type:"lazy",getter:t})}a(lT,"lazy");var cT=I("ZodPromise",(t,e)=>{Dx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>nC(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function xM(t){return new cT({type:"promise",innerType:t})}a(xM,"promise");var dT=I("ZodFunction",(t,e)=>{$x.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>zS(t,n,o,r)});function EM(t){var e,n;return new dT({type:"function",input:Array.isArray(t==null?void 0:t.input)?FC(t==null?void 0:t.input):(e=t==null?void 0:t.input)!=null?e:nu(io()),output:(n=t==null?void 0:t.output)!=null?n:io()})}a(EM,"_function");var au=I("ZodCustom",(t,e)=>{Mx.init(t,e),ee.init(t,e),t._zod.processJSONSchema=(n,o,r)=>FS(t,n,o,r)});function SM(t){let e=new _e({check:"custom"});return e._zod.check=t,e}a(SM,"check");function CM(t,e){return mS(au,t!=null?t:(()=>!0),e)}a(CM,"custom");function fT(t,e={}){return gS(au,t,e)}a(fT,"refine");function pT(t,e){return hS(t,e)}a(pT,"superRefine");var TM=yS,IM=vS;function AM(t,e={}){let n=new au({type:"custom",check:"custom",fn:a(o=>o instanceof t,"fn"),abort:!0,...M.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(AM,"_instanceof");var bM=a((...t)=>_S({Codec:su,Boolean:as,String:os},...t),"stringbool");function wM(t){let e=lT(()=>lf([Ka(t),CC(),TC(),wC(),nu(e),zC(Ka(),e)]));return e}a(wM,"json");function RM(t,e){return new oT({type:"pipe",in:df(t),out:e})}a(RM,"preprocess");var iX={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 sX(t){$e({customError:t})}a(sX,"setErrorMap");function aX(){return $e().customError}a(aX,"getErrorMap");var mT;mT||(mT={});var G={...Wa,...Md,iso:oo},uX=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 lX(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(lX,"detectVersion");function cX(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(cX,"resolveRef");function kM(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=cX(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 kM(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),y=G.string().regex(new RegExp(g));p.push(G.looseRecord(y,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(kM,"convertBaseSchema");function et(t,e){if(typeof t=="boolean")return t?G.any():G.never();let n=kM(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))uX.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 PM(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=lX(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:We};return et(n,i)}a(PM,"fromJSONSchema");var mf={};Rn(mf,{bigint:()=>mX,boolean:()=>pX,date:()=>gX,number:()=>fX,string:()=>dX});function dX(t){return ME(os,t)}a(dX,"string");function fX(t){return VE(ss,t)}a(fX,"number");function pX(t){return YE(as,t)}a(pX,"boolean");function mX(t){return QE(us,t)}a(mX,"bigint");function gX(t){return cS(tu,t)}a(gX,"date");$e(Ba());var hX=["minItems","maxItems","minLength","maxLength","minProperties","maxProperties"],yX=new Set(["propertyOrdering","example"]),vX={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||yX.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]=hX.includes(r)?Number(i):i}let o=typeof t.type=="string"?vX[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 uu(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}a(uu,"isZodSchema");function gT(t){return uu(t)&&!("_zod"in t)}a(gT,"isZodV3Schema");function hT(t){return uu(t)&&"_zod"in t}a(hT,"isZodV4Schema");function _X(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(_X,"getZodTypeName");function Cn(t){return uu(t)&&_X(t)==="ZodObject"}a(Cn,"isZodObject");function kr(t){if(!Cn(t))throw new Error("Expected a Zod Object");if(hT(t))return Rr(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=H.NULL,delete n.enum),n.type!==void 0&&(n.type=n.type.toUpperCase())},"override")});if(gT(t))return Aa(t,{target:"openApi3",$refStrategy:"none",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=H.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(kr,"zodObjectToSchema");var NM=new WeakMap;function xX(t){let e=NM.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 NM.set(t,n),n!=null?n:void 0}a(xX,"genaiSchemaValidator");function lu(t,e){if(t===void 0)return e;if(uu(t))return t.parse(e);let n=xX(t);return n?n.parse(e):e}a(lu,"parseWithSchema");function yT(t){return hT(t)?Rr(t):gT(t)?Aa(t):Sn(t)}a(yT,"toJsonSchema");function vT(t){if(!(t===null||typeof t!="object"))try{return pe.fromJSONSchema(t)}catch(e){return}}a(vT,"compileJsonSchema");var $M=new WeakMap;function DM(t){let e=$M.get(t);if(e!==void 0)return e!=null?e:void 0;let n=null;try{let o=yT(t),r=o.properties;r&&typeof r=="object"&&(n=new Map(Object.entries(r).map(([i,s])=>[i,EX(s,o)])))}catch(o){n=null}return $M.set(t,n),n!=null?n:void 0}a(DM,"objectSchemaFields");var gf=Symbol("unresolvable-ref");function EX(t,e){try{return vT(hf(t,e))}catch(n){return}}a(EX,"compileField");function SX(t,e){if(!e.startsWith("#"))throw gf;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 gf;n=n[r]}if(n===void 0)throw gf;return n}a(SX,"resolvePointer");function hf(t,e,n=new Set){if(Array.isArray(t))return t.map(i=>hf(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 gf;let i=hf(SX(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,hf(s,e,n)]))}a(hf,"inlineRefs");var _f=class _f extends Error{constructor(e="Node interrupted (awaiting resume input)."){super(e),this.name="NodeInterruptedError",Object.setPrototypeOf(this,_f.prototype)}};a(_f,"NodeInterruptedError");var yf=_f;function fs(t){return t instanceof Error&&t.name==="NodeInterruptedError"}a(fs,"isNodeInterruptedError");var xf=class xf 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,xf.prototype)}};a(xf,"NodeTimeoutError");var ls=xf;function OM(t){return t instanceof Error&&t.name==="NodeTimeoutError"}a(OM,"isNodeTimeoutError");var Ef=class Ef extends Error{constructor(e){super(e.message),this.name="DynamicNodeFailError",this.error=e.error,this.errorNodePath=e.errorNodePath,Object.setPrototypeOf(this,Ef.prototype)}};a(Ef,"DynamicNodeFailError");var vf=Ef;function If(t){return t instanceof Error&&t.name==="DynamicNodeFailError"}a(If,"isDynamicNodeFailError");var Sf=class Sf 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,Sf.prototype)}};a(Sf,"NodeReportedError");var cs=Sf;function MM(t){return t instanceof Error&&t.name==="NodeReportedError"}a(MM,"isNodeReportedError");var Cf=class Cf extends Error{constructor(e="Invocation aborted."){super(e),this.name="InvocationAbortedError",Object.setPrototypeOf(this,Cf.prototype)}};a(Cf,"InvocationAbortedError");var ds=Cf;function Af(t){return t instanceof Error&&t.name==="InvocationAbortedError"}a(Af,"isInvocationAbortedError");var Tf=class Tf 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,Tf.prototype)}};a(Tf,"NodeSchemaValidationError");var ao=Tf;function LM(t){return t instanceof Error&&t.name==="NodeSchemaValidationError"}a(LM,"isNodeSchemaValidationError");var _T=Symbol.for("google.adk.workflow.requestInput"),UM;UM=_T;var xT=class xT{constructor(e={}){this[UM]=!0;var n;this.interruptId=(n=e.interruptId)!=null?n:fn(),this.payload=e.payload,this.message=e.message,this.responseSchema=e.responseSchema}};a(xT,"RequestInput");var bf=xT;function wf(t){return typeof t=="object"&&t!==null&&_T in t&&t[_T]===!0}a(wf,"isRequestInput");function ET(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(ET,"normalizeRetryExceptions");function ps(t){return{maxAttempts:t.maxAttempts,initialDelay:t.initialDelay,maxDelay:t.maxDelay,backoffFactor:t.backoffFactor,jitter:t.jitter,exceptions:ET(t.exceptions)}}a(ps,"prepareRetryConfig");var cu=(n=>(n.VERTEX_AI="VERTEX_AI",n.GEMINI_API="GEMINI_API",n))(cu||{});function Rf(){return el()?"VERTEX_AI":"GEMINI_API"}a(Rf,"getGoogleLlmVariant");var ST=Symbol.for("google.adk.baseTool"),CT=Symbol.for("google.adk.inModelTool");function CX(t){return typeof t=="object"&&t!==null&&t[CT]===!0}a(CX,"isInModelTool");function du(t){return typeof t=="object"&&t!==null&&ST in t&&t[ST]===!0}a(du,"isBaseTool");var FM;FM=ST;var TT=class TT{constructor(e){this[FM]=!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&&!CX(o))throw new Error(`Duplicate tool name: ${this.name}`);e.toolsDict[this.name]=this;let r=TX(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 Rf()}};a(TT,"BaseTool");var oe=TT;function TX(t){var e;return(((e=t.config)==null?void 0:e.tools)||[]).find(n=>"functionDeclarations"in n)}a(TX,"findToolWithFunctionDeclarations");var IT=(r=>(r.CLIENT_CREDENTIALS="client_credentials",r.AUTHORIZATION_CODE="authorization_code",r.IMPLICIT="implicit",r.PASSWORD="password",r))(IT||{});function zM(t){if(t.clientCredentials)return"client_credentials";if(t.authorizationCode)return"authorization_code";if(t.implicit)return"implicit";if(t.password)return"password"}a(zM,"getOAuthGrantTypeFromFlow");var AT=class AT extends Error{};a(AT,"CredentialExchangeError");var It=AT;var IX=new Set(["password","passwd","pwd","sslpassword","code","access_token","id_token","refresh_token","client_secret","code_verifier"]);function GM(t){try{let e=new URL(t),n=!1;e.password&&(e.password="***",n=!0);for(let o of[...e.searchParams.keys()])IX.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(GM,"redactUriPassword");var AX=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()}),bX=pe.object({resource:pe.string(),authorization_servers:pe.array(pe.string()).default([])}),wT=class wT{async discoverAuthServerMetadata(e){if(!kf(e))return;let n,o;try{let i=new URL(e);n=`${i.protocol}//${i.host}`,o=i.pathname}catch(i){w.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=AX.parse(u);if(c.issuer.replace(/\/$/,"")===e.replace(/\/$/,""))return c;w.warn(`Issuer in metadata ${c.issuer} does not match issuerUrl ${e}`)}catch(s){w.debug(`Failed to fetch metadata from ${i}: ${s}`)}}async discoverResourceMetadata(e){if(!kf(e))return;let n,o;try{let i=new URL(e);n=`${i.protocol}//${i.host}`,o=i.pathname}catch(i){w.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=bX.parse(s);if(u.resource.replace(/\/$/,"")===e.replace(/\/$/,""))return u;w.warn(`Resource in metadata ${u.resource} does not match resourceUrl ${e}`)}catch(i){w.debug(`Failed to fetch metadata from ${r}: ${i}`)}}};a(wT,"OAuth2DiscoveryManager");var bT=wT;function wX(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(wX,"normaliseHostname");function kf(t){try{let e=new URL(t);if(e.protocol!=="https:")return w.warn(`Unsafe protocol for discovery URL: ${e.protocol}`),!1;let n=wX(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 w.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 w.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 w.warn(`Unsafe host for discovery URL: ${n}`),!1}return/^\[(f[cd][0-9a-f]{2}|fe[89ab][0-9a-f]):/i.test(e.hostname)?(w.warn(`Unsafe host for discovery URL: ${e.hostname}`),!1):!0}catch(e){return w.warn(`Failed to parse URL for validation ${t}: ${e}`),!1}}a(kf,"validateDiscoveryUrl");var RX=36;function BM(){return NR(RX).toString("base64url")}a(BM,"generateCodeVerifier");function qM(t){return PR("sha256").update(t).digest("base64url")}a(qM,"createS256CodeChallenge");function RT(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(RT,"getTokenEndpoint");async function kT(t,e){if(!kf(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 w.error(`Failed to fetch OAuth2 tokens: ${n}`),n}}a(kT,"fetchOAuth2Tokens");function VM(t){try{return new URL(t).searchParams.get("code")||void 0}catch(e){w.warn(`Failed to parse authorization URI ${GM(t)}`);return}}a(VM,"parseAuthorizationCode");function PT(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(PT,"createOAuth2TokenRequestBody");var NT=class NT{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=kX(n);return o==="client_credentials"?PX({authCredential:e,authScheme:n}):o==="authorization_code"?NX({authCredential:e,authScheme:n}):(w.warn(`Unsupported OAuth2 grant type: ${o}`),{credential:e,wasExchanged:!1})}};a(NT,"OAuth2CredentialExchanger");var fu=NT;function kX(t){var e;if("flows"in t&&t.flows)return zM(t.flows);if(t.grantTypesSupported)return(e=t.grantTypesSupported)!=null&&e.includes("client_credentials")?"client_credentials":"authorization_code"}a(kX,"determineGrantType");async function PX({authCredential:t,authScheme:e}){var r,i;let n=RT(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=PT({grantType:"client_credentials",clientId:t.oauth2.clientId,clientSecret:t.oauth2.clientSecret});try{let s=await kT(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(PX,"exchangeClientCredentials");async function NX({authCredential:t,authScheme:e}){var i,s,u,c;let n=RT(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=VM(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=PT({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 kT(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(NX,"exchangeAuthorizationCode");var ZM="S256",$T=class $T{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 fu().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!==ZM)throw new Error(`Unsupported codeChallengeMethod: ${r}. Only '${ZM}' 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=BM()),c.searchParams.set("code_challenge",qM(l)),c.searchParams.set("code_challenge_method",r)),{...n,oauth2:{...o,authUri:c.toString(),state:u,codeVerifier:l}}}};a($T,"AuthHandler");var Ht=$T;var Pf=class Pf extends TypeError{constructor(e){super(e),this.name="StateSchemaError",Object.setPrototypeOf(this,Pf.prototype)}};a(Pf,"StateSchemaError");var pu=Pf;function $X(t){return t instanceof Error&&t.name==="StateSchemaError"}a($X,"isStateSchemaError");var ms=class ms{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=DM(this.schema);if(!o)return;if(!o.has(e))throw new pu(`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 pu(`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,um(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))um(this.value,this.delta,n)}toRecord(){return{...this.value,...this.delta}}};a(ms,"State"),ms.APP_PREFIX="app:",ms.USER_PREFIX="user:",ms.TEMP_PREFIX="temp:";var me=ms;var DT=class DT{constructor({hint:e,confirmed:n,payload:o}){this.hint=e!=null?e:"",this.confirmed=n,this.payload=o}};a(DT,"ToolConfirmation");var Pr=DT,Nf=class Nf 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,Nf.prototype)}};a(Nf,"IntentMismatchError");var uo=Nf;function DX(t){return t instanceof Error&&t.name==="IntentMismatchError"}a(DX,"isIntentMismatchError");var LT=class LT{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(LT,"InvocationCostManager");var OT=LT,$f=class $f{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 OT,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 $f({...this,...e})}};a($f,"InvocationContext");var Jt=$f;function MT(){return`e-${fn()}`}a(MT,"newInvocationContextId");function Ke(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(Ke,"requireAgent");var UT=class UT{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 Ke(this.invocationContext).name}get state(){return new me(this.invocationContext.session.state,{})}get a2aMetadata(){return this.invocationContext.a2aMetadata}};a(UT,"ReadonlyContext");var xe=UT;var FT=class FT extends xe{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 Pr({hint:e,confirmed:!1,payload:n})}};a(FT,"Context");var Se=FT;var je="adk_request_confirmation",Ve="adk_request_credential",Le="adk_request_input",OX=new Set([je,Ve,Le]);function zT(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&&OX.has(r))return r}}a(zT,"reservedFunctionCallName");function mu(t){var e,n;return(n=(e=t.agent)==null?void 0:e.name)!=null?n:""}a(mu,"toolEventAuthor");var MX={handleFunctionCallList:Nr,generateAuthEvent:Of,generateRequestConfirmationEvent:qT};function BT(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(BT,"getLongRunningFunctionCalls");function Of(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:Ve,args:{function_call_id:u,auth_config:c},id:wt()};o.add(l.id),n.push({functionCall:l})}return W({invocationId:t.invocationId,author:mu(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(Of,"generateAuthEvent");function qT({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(y=>y.id===p))!=null?u:void 0;if(!g)continue;let h={name:je,args:{originalFunctionCall:g,toolConfirmation:d},id:wt()};r.add(h.id),o.push({functionCall:h})}return W({invocationId:t.invocationId,author:mu(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(qT,"generateRequestConfirmationEvent");async function LX(t,e,n){return Ze.startActiveSpan(`execute_tool ${t.name}`,async o=>{try{w.debug(`callToolAsync ${t.name}`);let r=await t.runAsync({args:e,toolContext:n});return GP({tool:t,args:e,functionResponseEvent:WM(t,r,n,n.invocationContext)}),r}finally{o.end()}})}a(LX,"callToolAsync");function WM(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 W({invocationId:o.invocationId,author:mu(o),content:s,actions:n.actions,branch:o.branch})}a(WM,"buildResponseEvent");async function gu({invocationContext:t,functionCallEvent:e,toolsDict:n,beforeToolCallbacks:o,afterToolCallbacks:r,filters:i,toolConfirmationDict:s,resumeInputsDict:u}){let c=le(e);return await Nr({invocationContext:t,functionCalls:c,toolsDict:n,beforeToolCallbacks:o,afterToolCallbacks:r,filters:i,toolConfirmationDict:s,resumeInputsDict:u})}a(gu,"handleFunctionCallsAsync");function Df(t){if(t!=null)return typeof t!="object"?{result:t}:Array.isArray(t)?{results:t}:t}a(Df,"normalizeCallbackResponse");var UX="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).",KM=Symbol.for("google.adk.toolNotFound");function FX(t){return typeof t=="object"&&t!==null&&t[KM]===!0}a(FX,"isToolNotFound");var HM,JM,ZT=class ZT extends(JM=oe,HM=KM,JM){constructor(n,o){super({name:n,description:"Tool not found"});this.resolutionError=o;this[HM]=!0}async runAsync(){throw this.resolutionError}};a(ZT,"ToolNotFoundPlaceholder");var GT=ZT;async function zX({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 GT(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);w.warn(`Could not resolve tool '${u}' for function call '${(s=e.id)!=null?s:""}'. Callable tools: ${d.length?d.join(", "):"(none)"}.
|
|
82
|
+
`+UX)}return WM(l,p!=null?p:{error:c.message},o,t)}finally{r.end()}})}a(zX,"answerUnresolvableCall");async function Nr({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 y;u&&g.id&&(y=u[g.id]);let v=new Se({invocationContext:t,functionCallId:g.id||void 0,toolConfirmation:h,resumeInputs:y}),_=g.name&&Object.hasOwn(n,g.name)?n[g.name]:void 0;if(!_){c.push(await zX({invocationContext:t,functionCall:g,toolsDict:n,toolContext:v}));continue}w.debug(`execute_tool ${_.name}`);let x=(d=g.args)!=null?d:{},E=null,C;if(E=await t.pluginManager.runBeforeToolCallback({tool:_,toolArgs:x,toolContext:v}),E==null){for(let b of o)if(E=await b({tool:_,args:x,context:v}),E)break}if(E=Df(E),E==null)try{E=await LX(_,x,v)}catch(b){if(b instanceof Error){let R=await t.pluginManager.runOnToolErrorCallback({tool:_,toolArgs:x,toolContext:v,error:b});R!=null?E=Df(R):C=b.message}else C=b}let S=await t.pluginManager.runAfterToolCallback({tool:_,toolArgs:x,toolContext:v,result:E});if(S==null){for(let b of r)if(S=await b({tool:_,args:x,context:v,response:E}),S)break}if(S!=null&&(E=Df(S)),_.isLongRunning&&E==null){Al(v.actions)||c.push(W({invocationId:t.invocationId,author:mu(t),actions:v.actions,branch:t.branch}));continue}C?E={error:C}:E==null?E={result:E}:E=Df(E);let T=W({invocationId:t.invocationId,author:mu(t),content:yc({functionResponse:{id:v.functionCallId,name:_.name,response:E}}),actions:v.actions,branch:t.branch});w.debug("traceToolCall",{tool:_.name,args:x,functionResponseEvent:T.id}),c.push(T)}if(!c.length)return null;let p=GX(c);return c.length>1&&Ze.startActiveSpan("execute_tool (merged)",g=>{try{w.debug("execute_tool (merged)"),w.debug("traceMergedToolCalls",{responseEventId:p.id,functionResponseEvent:p.id}),BP({responseEventId:p.id,functionResponseEvent:p})}finally{g.end()}}),p}a(Nr,"handleFunctionCallList");function GX(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 W({invocationId:n.invocationId,author:n.author,branch:n.branch,content:{role:"user",parts:e},actions:r,timestamp:n.timestamp})}a(GX,"mergeParallelFunctionResponseEvents");function jM(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(jM,"findEventByFunctionCallId");function YM(t){var i,s;if(!t.length)return{resolved:void 0,conflictingAuthors:void 0};let e=t[t.length-1],n=ce(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=jM(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(YM,"resolveFunctionResponseMatch");function VT(t){return YM(t).resolved}a(VT,"findMatchingFunctionCall");function XM(t){return YM(t).conflictingAuthors}a(XM,"getConflictingFunctionResponseAuthors");var hu=(i=>(i.API_KEY="apiKey",i.HTTP="http",i.OAUTH2="oauth2",i.OPEN_ID_CONNECT="openIdConnect",i.SERVICE_ACCOUNT="serviceAccount",i))(hu||{}),BX=new Set(Object.values(hu));function qX(t){return typeof t=="object"&&t!==null&&"authType"in t&&BX.has(t.authType)}a(qX,"isAuthCredential");function HT(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(HT,"readField");function QM(t,e){let n=HT(t,e);return typeof n=="string"?n:void 0}a(QM,"readString");function VX(t,e){var u;let n=t.exchangedAuthCredential;if(!((u=n==null?void 0:n.oauth2)!=null&&u.authUri))return e;let o=HT(e,"oauth2"),r={},i=QM(o,"authResponseUri");i!==void 0&&(r.authResponseUri=i);let s=QM(o,"authCode");if(s!==void 0&&(r.authCode=s),!(i===void 0&&s===void 0))return{...n,oauth2:{...n.oauth2,...r}}}a(VX,"bindCredential");function Mf(t,e){let{authScheme:n,credentialKey:o}=t;if(!n||!o)return;let r=HT(e,"exchangedAuthCredential");if(typeof r!="object"||r===null)return;let i=VX(t,r);if(i)return{authScheme:n,credentialKey:o,rawAuthCredential:t.rawAuthCredential,exchangedAuthCredential:i}}a(Mf,"bindCredentialResponse");var eL="response_schema";function tL(t){var n,o;let e={interruptId:t.interruptId,payload:(n=t.payload)!=null?n:null,message:(o=t.message)!=null?o:null,[eL]:t.responseSchema?yT(t.responseSchema):null};return W({content:{role:"model",parts:[{functionCall:{name:Le,args:e,id:t.interruptId}}]},longRunningToolIds:[t.interruptId]})}a(tL,"createRequestInputEvent");function Lf(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)!==Le||!u.id)continue;let c=(r=u.args)==null?void 0:r[eL];c&&e.set(u.id,c)}return e}a(Lf,"responseSchemasByInterruptId");function yu(t,e,n){if(typeof e!="object"||e===null)return;let o=vT(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(yu,"interruptResponseMismatch");function JT(t,e){return new Ht(t).getAuthResponse(e)!==void 0}a(JT,"hasAuthCredential");function nL(t,e){let n=new Ht(t).generateAuthRequest(),o={functionCallId:e,authConfig:n,message:JX(t)};return W({content:{role:"model",parts:[{functionCall:{name:Ve,id:e,args:o}}]},longRunningToolIds:[e]})}a(nL,"createAuthRequestEvent");async function rL({responseData:t,authConfig:e,state:n}){let o;if(ZX(t)?o=Mf(e,t):o={...e,exchangedAuthCredential:HX(e,t)},!o){w.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(rL,"processAuthResume");function ZX(t){return typeof t=="object"&&t!==null&&"authScheme"in t&&"credentialKey"in t}a(ZX,"isAuthConfigLike");function HX(t,e){var n;return((n=t.rawAuthCredential)==null?void 0:n.authType)==="apiKey"?{authType:"apiKey",apiKey:String(e)}:e}a(HX,"buildCredentialFromValue");function JX(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(JX,"buildAuthMessage");var WT=Symbol.for("google.adk.workflow.baseNode"),oL;oL=WT;var jT=class jT{constructor(e){this[oL]=!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?ps(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(wf(r)){yield tL(r);continue}let i=this.toEvent(e,r);i&&(yield i)}}validateInput(e){if(Wn(e))return e;try{return lu(this.inputSchema,e)}catch(n){throw new ao({nodeName:this.name,direction:"input",cause:n})}}validateOutput(e){if(Wn(e))return e;try{return lu(this.outputSchema,e)}catch(n){throw new ao({nodeName:this.name,direction:"output",cause:n})}}toEvent(e,n){if(n==null)return null;if(Rl(n)){let r=n;return r.output!==void 0&&(r.output=this.validateOutput(r.output)),r}let o=this.validateOutput(n);return W({author:this.name,invocationId:e.invocationContext.invocationId,branch:e.branch,content:_u(o),output:o})}};a(jT,"BaseNode");var ze=jT;function vu(t){return typeof t=="object"&&t!==null&&WT in t&&t[WT]===!0}a(vu,"isBaseNode");function Wn(t){return typeof t=="object"&&t!==null&&"parts"in t&&Array.isArray(t.parts)}a(Wn,"isContent");var YT=class YT extends ze{async*runImpl(){throw new Error("START node is never executed.")}};a(YT,"StartNode");var KT=YT,ln=new KT({name:"__START__"});function _u(t){if(t!=null){if(Wn(t))return t;try{return Bg(t)}catch(e){return Bg(WX(t))}}}a(_u,"toContent");function WX(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(WX,"valueToText");var XT=Symbol.for("google.adk.baseAgent");function Kn(t){return typeof t=="object"&&t!==null&&XT in t&&t[XT]===!0}a(Kn,"isBaseAgent");var aL,uL,QT=class QT extends(uL=ze,aL=XT,uL){constructor(n){super({...n,name:iL(n.name)});this[aL]=!0;this.config={...n},this.name=iL(n.name),this.parentAgent=n.parentAgent,this.subAgents=n.subAgents||[],this.beforeAgentCallback=sL(n.beforeAgentCallback),this.afterAgentCallback=sL(n.afterAgentCallback),this.setParentAgentForSubAgents()}get rootAgent(){return jX(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=Oe.setSpan(Fe.active(),o);try{yield*cr(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;FP({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=Oe.setSpan(Fe.active(),o);try{yield*cr(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 Se({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,W({invocationId:n.invocationId,author:this.name,branch:n.branch,content:s,actions:o.eventActions})}if(o.state.hasDelta())return W({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 Se({invocationContext:n});for(let i of this.afterAgentCallback){let s=await i(o);if((r=n.abortSignal)!=null&&r.aborted)return;if(s)return W({invocationId:n.invocationId,author:this.name,branch:n.branch,content:s,actions:o.eventActions})}if(o.state.hasDelta())return W({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(QT,"BaseAgent");var $t=QT;function iL(t){if(!KX(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(iL,"validateAgentName");function KX(t){return/^[\p{ID_Start}$_][\p{ID_Continue}$_-]*$/u.test(t)}a(KX,"isIdentifier");function jX(t){for(;t.parentAgent;)t=t.parentAgent;return t}a(jX,"getRootAgent");function sL(t){return t?Array.isArray(t)?t:[t]:[]}a(sL,"getCannonicalCallback");var tI=class tI{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(tI,"LiveRequestQueue");var eI=tI;function Ue(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(Ue,"appendInstructions");function lL(t,e){t.config||(t.config={}),t.config.responseSchema=e,t.config.responseMimeType="application/json"}a(lL,"setOutputSchema");var Eu="finish_task",Uf="Task completed.",YX={type:H.OBJECT,properties:{result:{type:H.STRING,description:"A brief summary of what the agent accomplished."}},required:["result"]},nI=class nI extends oe{constructor(e){let n=e!=null?e:YX,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:Eu,description:o}),this.outputSchema=n,this.wrapperKey=n.type===H.OBJECT?void 0:"result"}_getDeclaration(){let e=this.wrapperKey?{type:H.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),Ue(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.`}:Uf}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(nI,"FinishTaskTool");var xu=nI;function XX(t){return t===void 0?{type:H.OBJECT,properties:{}}:Cn(t)?kr(t):t}a(XX,"toSchema");var rI=Symbol.for("google.adk.functionTool");function QX(t){return typeof t=="object"&&t!==null&&rI in t&&t[rI]===!0}a(QX,"isFunctionTool");var cL,dL,oI=class oI extends(dL=oe,cL=rI,dL){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[cL]=!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:XX(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 Cn(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(oI,"FunctionTool");var Dt=oI;var iI=class iI{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(iI,"AsyncQueue");var cn=iI;var e3="... [truncated]",fL="Unknown error";function sI(t){return t!==null&&typeof t=="object"?t:void 0}a(sI,"asRecord");function pL(...t){for(let e of t)if(typeof e=="string")return e}a(pL,"firstString");function t3(t){return t.length>1e3?t.slice(0,1e3)+e3:t}a(t3,"truncateBody");function mL(t){return t instanceof Error?t.message:typeof t=="string"?t:String(t)}a(mL,"baseMessage");function n3(t){var c,l;let e=sI(t);if(e===void 0)return;let n=sI(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=pL(e.statusText,n==null?void 0:n.statusText),s=pL(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}: ${t3(s)}`}a(n3,"extractHttpDetails");function aI(t,e){var u;if(t==null)return fL;if(typeof t=="object"){if(e.has(t))return mL(t);e.add(t)}if(t instanceof AggregateError&&t.errors.length>0)return t.errors.map(c=>aI(c,e)).join(" | ");let n=n3(t),o=mL(t),r=(u=sI(t))==null?void 0:u.cause,i=r!==void 0?aI(r,e):void 0,s=o.length>0?o:fL;return n!==void 0&&(s=`${s} (${n})`),i!==void 0&&n===void 0&&!s.includes(i)&&(s=`${s}: ${i}`),s}a(aI,"formatErrorRecursive");function uI(t){return aI(t,new Set)}a(uI,"formatError");var Ff=class Ff{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 Ff([...this.segments,o])}};a(Ff,"BranchPath");var $r=Ff;function gL(t){return t?new $r(t.split(".")):new $r([])}a(gL,"branchPathFromString");function r3(t){if(t.length===0)return new $r([]);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 $r(n)}a(r3,"commonPrefixOfPaths");function zf(t,e){return gL(t).append(e.name,e.runId).toString()}a(zf,"createSubBranch");function Gf(t){return r3(t.map(e=>gL(e))).toString()}a(Gf,"commonPrefixOf");var o3=5,i3=1,s3=60,a3=2,u3=1;function hL(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(hL,"errorNames");function yL(t){let[e,n]=hL(t);return e==="Error"&&n?n:e}a(yL,"errorName");function vL({error:t,retryConfig:e,nodeState:n}){var s;let o=n.attemptCount,r=(s=e.maxAttempts)!=null?s:o3;if(o>=r)return!1;let i=e.exceptions;return!(i!==void 0&&!hL(t).some(u=>i.includes(u)))}a(vL,"shouldRetryNode");function _L({retryConfig:t,nodeState:e,randomFn:n=Math.random}){var p,d,g,h;let o=(p=t.initialDelay)!=null?p:i3,r=(d=t.maxDelay)!=null?d:s3,i=(g=t.backoffFactor)!=null?g:a3,s=(h=t.jitter)!=null?h:u3,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 y=s*l,v=-y+n()*(2*y);l=Math.max(0,l+v)}return Math.min(l,r)}a(_L,"getRetryDelaySeconds");function Bf(t){return"isNodeError"in t&&t.isNodeError===!0}a(Bf,"isNodeErrorEvent");var xL=new WeakMap;function qf(t,e){return typeof t!="object"||t===null?!0:xL.get(t)===e?!1:(xL.set(t,e),!0)}a(qf,"claimNodeErrorReport");function Vf(t){var r,i;let{error:e,attemptCount:n,...o}=t;return{...W(o),isNodeError:!0,errorType:yL(e),errorCode:(r=o.errorCode)!=null?r:l3(e),errorMessage:(i=o.errorMessage)!=null?i:c3(e),attemptCount:n!=null?n:1}}a(Vf,"createNodeErrorEvent");function l3(t){let e=t==null?void 0:t.code;return typeof e=="string"||typeof e=="number"?String(e):"UNKNOWN_ERROR"}a(l3,"errorCodeOf");function c3(t){return t instanceof Error?t.message:String(t)}a(c3,"errorMessageOf");var lo=(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))(lo||{});function jn(t){return{status:0,attemptCount:1,interrupts:[],resumeInputs:{},runCounter:0,...t}}a(jn,"createNodeState");function EL(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(EL,"isNodeState");function Dr(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 Fe.with(Oe.setSpan(Fe.active(),s),()=>d3({params:t,nodeName:r,nodePath:i,span:s}))}a(Dr,"executeChildNode");async function d3({params:{parent:t,node:e,input:n,options:o={},abortSignal:r,nodeState:i,resumeInputs:s},nodeName:u,nodePath:c,span:l}){var C,S,T,b;let p=(C=o.runId)!=null?C:u,d=t.branch;o.overrideBranch!==void 0?d=o.overrideBranch:o.useSubBranch&&(d=zf(t.branch,{name:u,runId:o.runId}));let g=e.isolationScope===!0?`${c}@${p}`:e.isolationScope,h=(T=(S=o.overrideIsolationScope)!=null?S:g)!=null?T:t.isolationScope,y=r!=null?r:t.invocationContext.abortSignal,v=d===t.invocationContext.branch&&y===t.invocationContext.abortSignal&&h===t.invocationContext.isolationScope?t.invocationContext:new Jt({...t.invocationContext,branch:d,abortSignal:y,isolationScope:h}),_=new Tn({invocationContext:v,channel:t.channel,nodePath:c,runId:p,resumeInputs:s!=null?s:t.resumeInputs,isolationScope:h,stateSchema:(b=e.stateSchema)!=null?b:t.stateSchema});_.scheduler=t.scheduler,o.useAsOutput&&(_.outputForAncestors=[t.nodePath,...t.outputForAncestors].filter(R=>R!==""));let x=i!=null?i:jn({status:2,input:n,runId:p}),E=_.invocationContext.pluginManager;try{if(E!=null&&E.hasPlugins){let P=await E.runBeforeNodeCallback({node:e,nodeContext:_,input:n});if(P!==void 0)return _.output=P,Xo({nodePath:c,runId:p,attempt:x.attemptCount,status:"completed",interruptCount:_.interruptIds.length}),o.useAsOutput&&(t.output=_.output,t.route=_.route),_}let R=!1,B=!1;for(;!R;){m3(_),_.attemptCount=x.attemptCount;try{B=await f3({node:e,child:_,input:n,nodeName:u,branch:d,isolationScope:h,nodePath:c,runId:p,attempt:x.attemptCount}),p3(_,u),R=!0}catch(P){if(fs(P)){R=!0;break}if(Af(P)||If(P))throw P;let V=e.preparedRetryConfig;if(!V||!vL({error:P,retryConfig:V,nodeState:x}))throw P;let de=_L({retryConfig:V,nodeState:x});x.attemptCount+=1,await h3(de*1e3,y)}}if(!B&&_.interruptIds.length>0&&g3({child:_,nodeName:u,branch:d,isolationScope:h,input:n}),Xo({nodePath:c,runId:p,attempt:x.attemptCount,status:_.interruptIds.length>0?"waiting":"completed",interruptCount:_.interruptIds.length}),E!=null&&E.hasPlugins){let P=await E.runAfterNodeCallback({node:e,nodeContext:_,output:_.output});P!==void 0&&(_.output=P)}return o.useAsOutput&&(t.output=_.output,t.route=_.route,t.outputDelegated=!0),_}catch(R){throw Xo({nodePath:c,runId:p,attempt:x.attemptCount,status:"failed",interruptCount:_.interruptIds.length}),l.setStatus({code:Mo.ERROR,message:uI(R)}),R}finally{l.end()}}a(d3,"runChildNode");function f3(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 SL(t);return Xo({nodePath:n,runId:o,attempt:r,status:t.child.interruptIds.length>0?"waiting":"completed",interruptCount:t.child.interruptIds.length}),s}catch(s){throw Xo({nodePath:n,runId:o,attempt:r,status:"failed",interruptCount:t.child.interruptIds.length}),i.setStatus({code:Mo.ERROR,message:uI(s)}),s}finally{i.end()}}):SL(t)}a(f3,"runAttempt");function p3(t,e){let n=t.reportedError;if(!n||t.output!==void 0||t.route!==void 0||t.interruptIds.length>0)return;let o=new cs({nodeName:e,...n});throw qf(o,t.invocationId),o}a(p3,"failIfNodeReportedError");function m3(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(m3,"resetState");async function SL({node:t,child:e,input:n,nodeName:o,branch:r,isolationScope:i}){var x;let s=!1,u=a(E=>{var S,T,b;CL({event:E,child:e,nodeName:o,branch:r,isolationScope:i});let C=(S=E.actions)==null?void 0:S.stateDelta;if(C&&C!==e.actions.stateDelta&&e.state.validateDelta(C),E.output!==void 0&&(e.output=E.output,e.outputDelegated)){let R=(T=E.actions)==null?void 0:T.stateDelta;if(!R||Object.keys(R).length===0)return;E.output=void 0,E.content=void 0}if(E.route!==void 0&&(e.route=E.route),E.errorCode!==void 0&&!Bf(E)&&(e.reportedError={errorCode:E.errorCode,errorMessage:E.errorMessage}),E.longRunningToolIds&&E.longRunningToolIds.length>0){for(let R of E.longRunningToolIds)e.interruptIds.includes(R)||e.interruptIds.push(R);E.actions.agentState={...(b=E.actions.agentState)!=null?b:{},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,y=setTimeout(()=>{h=!0,d.abort()},(p!=null?p:0)*1e3);e.abortSignal=d.signal;let v=new Promise((E,C)=>{let S=a(()=>C(h?new ls({nodeName:o,timeout:p!=null?p:0}):new ds(`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(),v]);for(;!E.done;)u(E.value),E=await Promise.race([_.next(),v])}finally{clearTimeout(y),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(SL,"runOnce");function g3({child:t,nodeName:e,branch:n,isolationScope:o,input:r}){let i=W({author:e,invocationId:t.invocationId,branch:n,longRunningToolIds:[...t.interruptIds],actions:{agentState:{input:r}}});CL({event:i,child:t,nodeName:e,branch:n,isolationScope:o}),t.channel.push(i)}a(g3,"recordInputForResume");function CL({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(CL,"enrichEvent");function h3(t,e){return new Promise((n,o)=>{if(e!=null&&e.aborted){o(new ds("Invocation aborted during retry."));return}let r=setTimeout(()=>{e==null||e.removeEventListener("abort",i),n()},t),i=a(()=>{clearTimeout(r),o(new ds("Invocation aborted during retry."))},"onAbort");e==null||e.addEventListener("abort",i,{once:!0})})}a(h3,"delay");var lI=class lI extends ze{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(y3(r))for await(let i of r)yield i;else if(v3(r))for(let i of r)yield i;else yield await r;yield void 0}async runAuthGate(n){let o=this.authConfig;if(JT(o,n.state))return;let r=n.resumeInputs[o.credentialKey];if(!(r!==void 0&&(await rL({responseData:r,authConfig:o,state:n.state}),JT(o,n.state))))return nL(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),wP(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?W({author:this.name,invocationId:n.invocationId,branch:n.branch,actions:{stateDelta:r}}):null;if(Rl(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(Wn(o))return W({author:this.name,invocationId:n.invocationId,branch:n.branch,content:o,actions:r?{stateDelta:r}:void 0});let i=this.validateOutput(o);return W({author:this.name,invocationId:n.invocationId,branch:n.branch,content:_u(i),output:i,actions:r?{stateDelta:r}:void 0})}};a(lI,"FunctionNode");var gs=lI;function y3(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(y3,"isAsyncIterable");function v3(t){return t!=null&&typeof t[Symbol.iterator]=="function"&&typeof t.next=="function"}a(v3,"isSyncGenerator");var _3=8,cI=class cI extends ze{constructor(e,n={}){let o=Wt(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:_3,o.length),s=0,u=!1,c,l=!1,p=[],d=a(()=>{var y,v;return((y=e.abortSignal)==null?void 0:y.aborted)===!0||((v=e.invocationContext.abortSignal)==null?void 0:v.aborted)===!0},"isAborted"),g=a(async()=>{for(;!u&&!l&&!d();){let y=s++;if(y>=o.length)break;try{let v=await e.runNode(this.inner,o[y],{useSubBranch:!0,runId:String(y),overrideNodePath:`${e.nodePath}.${this.inner.name}@${y}`});if(v.interruptIds.length>0){l=!0;for(let _ of v.interruptIds)p.includes(_)||p.push(_);break}r[y]=v.output}catch(v){if(fs(v)){l=!0;break}u||(u=!0,c=v);break}}},"worker");if(await Promise.all(Array.from({length:i},()=>g())),u)throw c;if(l){for(let y of p)e.interruptIds.includes(y)||e.interruptIds.push(y);return}d()||(yield r)}};a(cI,"ParallelWorker");var hs=cI;var dI=class dI extends ze{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(x3(n)),r={name:this.tool.name,args:o,id:`${e.nodePath}:${e.runId}`},i=await Nr({invocationContext:e.invocationContext,functionCalls:[r],toolsDict:{[this.tool.name]:this.tool},beforeToolCallbacks:[],afterToolCallbacks:[]});if(!i)return;i.author=this.name;let s=ce(i);s.length>0&&(i.output=s[0].response),yield i}};a(dI,"ToolNode");var ys=dI;function x3(t){let e=t;if(Wn(e)&&(e=E3(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(x3,"coerceToolArgs");function E3(t){var e;return((e=t.parts)!=null?e:[]).map(n=>{var o;return(o=n.text)!=null?o:""}).join("")}a(E3,"extractText");var S3={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 gs(o,n,e)},"build")},C3={match:a(t=>du(t),"match"),build:a((t,e)=>new ys(t,e),"build")},fI=[S3,C3],pI=a((t,e)=>new hs(t,e),"PARALLEL_WORKER_FACTORY");function Zf(t){if(typeof t!="object"||t===null||Array.isArray(t))return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}a(Zf,"isPlainObject");function Su(t){return t==="START"||vu(t)||fI.some(e=>e.match(t))}a(Su,"isNodeLike");function Wt(t,e={}){if(e.maxParallelWorkers!==void 0&&!e.parallelWorker)throw new Error("maxParallelWorkers can only be set when parallelWorker is true.");let n=T3(t,e);if(e.parallelWorker){if(t==="START")throw new Error("ParallelWorker cannot wrap a START node.");if(!pI)throw new Error("parallelWorker was requested but no ParallelWorker is available; the parallel worker node module is not part of this build.");return pI(n,{maxParallelWorkers:e.maxParallelWorkers})}return n}a(Wt,"buildNode");function T3(t,e){if(t==="START")return ln;if(vu(t))return b3(t,e);for(let n of fI)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(T3,"buildInnerNode");var I3=["name","description","rerunOnResume","retryConfig","timeout","inputSchema","outputSchema","stateSchema","isolationScope"],A3=["authConfig"];function b3(t,e){let n={};for(let r of I3)e[r]!==void 0&&(n[r]=e[r]);for(let r of A3)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?ps(e.retryConfig):void 0}),o}a(b3,"cloneWithOverrides");var mI=class mI{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=Wt(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&&(w3(c,u,Hf(this.autoRunIds,u)),TL(c)&&Hf(this.numericCustomRunIds,u).add(c)),!c){R3(u,Hf(this.numericCustomRunIds,u));let l=((s=this.dynamicRunCounters.get(u))!=null?s:0)+1;this.dynamicRunCounters.set(u,l),c=String(l),Hf(this.autoRunIds,u).add(c)}return this.scheduleAndUnwind(r,n,{...o,nodeName:u,runId:c})}return Dr({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 yf;return r}};a(mI,"NodeContext");var Tn=mI;function Hf(t,e){let n=t.get(e);return n||(n=new Set,t.set(e,n)),n}a(Hf,"mapSet");function TL(t){return/^\d+$/.test(t)}a(TL,"isAutoNumberShaped");function IL(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(IL,"numericRunIdMixError");function w3(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&&TL(t))throw IL(e,t)}a(w3,"assertCustomRunId");function R3(t,e){let n=e.values().next();if(!n.done)throw IL(t,n.value)}a(R3,"assertNoNumericCustomRunIds");var gI=Symbol.for("google.adk.workflow.nodeTool"),AL=8,bL,wL,hI=class hI extends(wL=oe,bL=gI,wL){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[bL]=!0;this.node=n}_getDeclaration(){let n=this.node.inputSchema,o;return n&&Cn(n)?o=kr(n):o={type:H.OBJECT,properties:{request:{type:H.STRING}},required:["request"]},{name:this.name,description:this.description,parameters:o}}get inputIsObject(){return Cn(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>=AL)throw new Error(`NodeTool '${this.name}': node-tool nesting exceeded ${AL} (possible node -> tool -> node recursion).`);let u=r.clone({nodeToolDepth:r.nodeToolDepth+1}),c=new Tn({invocationContext:u,channel:i,nodePath:"",runId:s,resumeInputs:n.resumeInputs}),l=u.branch,p=`${this.name}@${s}`,d=l?`${l}.${p}`:p;return Dr({parent:c,node:this.node,input:o,options:{runId:s,overrideBranch:d}})}};a(hI,"NodeTool");var vs=hI;function RL(t){return typeof t=="object"&&t!==null&&gI in t&&t[gI]===!0}a(RL,"isNodeTool");async function*kL(t,e,n){let o=t.mode==="task";!o&&!t.includeContentsExplicit&&(t.includeContents="none"),o||await k3(e,n);let r=$3(e.getInvocationContext(),{input:n,outputsByNode:D3(e)});if(o){yield*P3(e,r,t);return}for await(let i of t.runAsync(r))N3(t,i),yield i}a(kL,"runLlmAgentAsNode");async function k3(t,e){if(e==null)return;let n=W({author:"user",invocationId:t.invocationId,branch:t.branch,content:L3(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(k3,"appendNodeInputAsUserTurn");async function*P3(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===Eu);if(c){r={...(i=c.args)!=null?i:{}},yield u;continue}if(r!==void 0&&M3(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(P3,"runTaskMode");function N3(t,e){var i;if(e.partial||O3(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===""&&w.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(N3,"maybeSetOutput");function $3(t,e){return t.clone({workflowInstructionScope:e})}a($3,"withWorkflowInstructionScope");function D3(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(D3,"collectPredecessorOutputs");function O3(t){var e,n;return((n=(e=t.content)==null?void 0:e.parts)!=null?n:[]).some(o=>o.functionCall)}a(O3,"hasFunctionCalls");function M3(t){return ce(t).some(e=>{var o;return e.name!==Eu?!1:((o=e.response)!=null?o:{}).result===Uf})}a(M3,"isFinishTaskSuccessResponse");function L3(t){return Wn(t)?{...t,role:"user"}:typeof t=="string"?{role:"user",parts:[{text:t}]}:{role:"user",parts:[{text:JSON.stringify(t)}]}}a(L3,"toUserContent");var yI=class yI{run(e,n){let o=this.store;this.store=e;try{return n()}finally{this.store=o}}getStore(){return this.store}};a(yI,"AsyncLocalStorage");var Jf=yI;var U3="google-adk",F3="gl-typescript",z3="remote_reasoning_engine",G3="GOOGLE_CLOUD_AGENT_ENGINE_ID";var PL=new Jf,B3=[["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 q3(t){if(!t)return"Browser";for(let[e,n]of B3){let o=t.match(n);if(o)return`${e}/${o[1]}`}return"Browser"}a(q3,"parseUserAgent");function V3(){let t=`${U3}/${Ys}`;!jt()&&process.env[G3]&&(t=`${t}+${z3}`);let e=jt()?q3(window.navigator.userAgent):process.version,n=`${F3}/${e}`;return[t,n]}a(V3,"_getDefaultLabels");function Z3(t,e){if(typeof t!="string"||t.trim()==="")throw new Error("Client label must be a non-empty string.");return PL.run(t,e)}a(Z3,"runWithClientLabel");function NL(){let t=V3(),e=PL.getStore();return e&&t.push(e),t}a(NL,"getClientLabels");function $L(){let t=NL().join(" ");return{"x-goog-api-client":t,"user-agent":t}}a($L,"getTrackingHeaders");var vI=Symbol.for("google.adk.baseModel");function _I(t){return typeof t=="object"&&t!==null&&vI in t&&t[vI]===!0}a(_I,"isBaseLlm");var DL;DL=vI;var Wf=class Wf{constructor({model:e}){this[DL]=!0;this.model=e}get trackingHeaders(){return $L()}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(Wf,"BaseLlm"),Wf.supportedModels=[];var Yn=Wf;var bI=class bI{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(bI,"Hooks");var EI=bI,wI=class wI{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(wI,"Plugins");var SI=wI,k=class k{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+k.version}static addUnaryOp(e){return k.max_unop_len=Math.max(e.length,k.max_unop_len),k.unary_ops[e]=1,k}static addBinaryOp(e,n,o){return k.max_binop_len=Math.max(e.length,k.max_binop_len),k.binary_ops[e]=n,o?k.right_associative.add(e):k.right_associative.delete(e),k}static addIdentifierChar(e){return k.additional_identifier_chars.add(e),k}static addLiteral(e,n){return k.literals[e]=n,k}static removeUnaryOp(e){return delete k.unary_ops[e],e.length===k.max_unop_len&&(k.max_unop_len=k.getMaxKeyLen(k.unary_ops)),k}static removeAllUnaryOps(){return k.unary_ops={},k.max_unop_len=0,k}static removeIdentifierChar(e){return k.additional_identifier_chars.delete(e),k}static removeBinaryOp(e){return delete k.binary_ops[e],e.length===k.max_binop_len&&(k.max_binop_len=k.getMaxKeyLen(k.binary_ops)),k.right_associative.delete(e),k}static removeAllBinaryOps(){return k.binary_ops={},k.max_binop_len=0,k}static removeLiteral(e){return delete k.literals[e],k}static removeAllLiterals(){return k.literals={},k}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 k(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 k.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!k.binary_ops[String.fromCharCode(e)]||k.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return k.isIdentifierStart(e)||k.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(k.hooks[e]){let o={context:this,node:n};return k.hooks.run(e,o),o.node}return n}searchHook(e){if(k.hooks[e]){let n={context:this};return k.hooks[e].find(function(o){return o.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let e=this.code;for(;e===k.SPACE_CODE||e===k.TAB_CODE||e===k.LF_CODE||e===k.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:k.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===k.SEMCOL_CODE||o===k.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,k.max_binop_len),n=e.length;for(;n>0;){if(k.binary_ops.hasOwnProperty(e)&&(!k.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!k.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:k.binaryPrecedence(n),right_a:k.right_associative.has(n)},u=this.gobbleToken(),u||this.throwError("Expected expression after "+n),r=[s,i,u];n=this.gobbleBinaryOp();){if(o=k.binaryPrecedence(n),o===0){this.index-=n.length;break}i={value:n,prec:o,right_a:k.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:k.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:k.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,k.isDecimalDigit(e)||e===k.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===k.SQUOTE_CODE||e===k.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(e===k.OBRACK_CODE)r=this.gobbleArray();else{for(n=this.expr.substr(this.index,k.max_unop_len),o=n.length;o>0;){if(k.unary_ops.hasOwnProperty(n)&&(!k.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!k.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:k.UNARY_EXP,operator:n,argument:i,prefix:!0})}n=n.substr(0,--o)}k.isIdentifierStart(e)?(r=this.gobbleIdentifier(),k.literals.hasOwnProperty(r.name)?r={type:k.LITERAL,value:k.literals[r.name],raw:r.name}:r.name===k.this_str&&(r={type:k.THIS_EXP})):e===k.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===k.PERIOD_CODE||n===k.OBRACK_CODE||n===k.OPAREN_CODE||n===k.QUMARK_CODE;){let o;if(n===k.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==k.PERIOD_CODE)break;o=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===k.OBRACK_CODE?(e={type:k.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()},e.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==k.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===k.OPAREN_CODE?e={type:k.CALL_EXP,arguments:this.gobbleArguments(k.CPAREN_CODE),callee:e}:(n===k.PERIOD_CODE||o)&&(o&&this.index--,this.gobbleSpaces(),e={type:k.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(;k.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(this.code===k.PERIOD_CODE)for(e+=this.expr.charAt(this.index++);k.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++));k.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);k.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+e+this.char+")")}return o=this.code,k.isIdentifierStart(o)?this.throwError("Variable names cannot start with a number ("+e+this.char+")"):(o===k.PERIOD_CODE||e.length===1&&e.charCodeAt(0)===k.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:k.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:k.LITERAL,value:e,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let e=this.code,n=this.index;for(k.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(e=this.code,k.isIdentifierPart(e));)this.index++;return{type:k.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===k.CPAREN_CODE&&r&&r>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}else if(i===k.COMMA_CODE){if(this.index++,r++,r!==n.length){if(e===k.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===k.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===k.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return o||this.throwError("Expected "+String.fromCharCode(e)),n}gobbleGroup(){this.index++;let e=this.gobbleExpressions(k.CPAREN_CODE);if(this.code===k.CPAREN_CODE)return this.index++,e.length===1?e[0]:e.length?{type:k.SEQUENCE_EXP,expressions:e}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:k.ARRAY_EXP,elements:this.gobbleArguments(k.CBRACK_CODE)}}};a(k,"Jsep");var At=k,H3=new EI;Object.assign(At,{hooks:H3,plugins:new SI(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"),xs,J3=Object.getOwnPropertyNames((xs=class{},a(xs,"Test"),xs));Object.getOwnPropertyNames(At).filter(t=>!J3.includes(t)&&In[t]===void 0).forEach(t=>{In[t]=At[t]});In.Jsep=At;var W3="ConditionalExpression",K3={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:W3,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(K3);var OL=47,j3=92,Y3={name:"regex",init(t){t.hooks.add("gobble-token",a(function(n){if(this.code===OL){let o=++this.index,r=!1;for(;this.index<this.expr.length;){if(this.code===OL&&!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===j3?2:1}this.throwError("Unclosed Regex")}},"gobbleRegexLiteral"))}},xI=43,X3=45,_s={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[xI,X3],assignmentPrecedence:.9,init(t){let e=[t.IDENTIFIER,t.MEMBER_EXP];_s.assignmentOperators.forEach(o=>t.addBinaryOp(o,_s.assignmentPrecedence,!0)),t.hooks.add("gobble-token",a(function(r){let i=this.code;_s.updateOperators.some(s=>s===i&&s===this.expr.charCodeAt(this.index+1))&&(this.index+=2,r.node={type:"UpdateExpression",operator:i===xI?"++":"--",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;_s.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===xI?"++":"--",argument:r.node,prefix:!1})}},"gobbleUpdatePostfix")),t.hooks.add("after-expression",a(function(r){r.node&&n(r.node)},"gobbleAssignment"));function n(o){_s.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(Y3,_s);In.addUnaryOp("typeof");In.addUnaryOp("void");In.addLiteral("null",null);In.addLiteral("undefined",void 0);var Q3=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)&&Q3.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]}},RI=class RI{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(RI,"SafeScript");var CI=RI;function Or(t,e){return t=t.slice(),t.push(e),t}a(Or,"push");function TI(t,e){return e=e.slice(),e.unshift(t),e}a(TI,"unshift");var kI=class kI 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(kI,"NewError");var II=kI;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 II(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(y=>{d.push(y)}):d.push(h)}if(a(g,"addRet"),(typeof l!="string"||u)&&e&&Object.hasOwn(e,l))g(this._trace(p,e[l],Or(n,l),e,l,i,s));else if(l==="*")this._walk(e,h=>{g(this._trace(p,e[h],Or(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],Or(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:Or(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"),y=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(h);y?this._walk(e,v=>{let _=[y[2]],x=y[1]?e[v][y[1]]:e[v];this._trace(_,x,n,o,r,i,!0).length>0&&g(this._trace(p,e[v],Or(n,v),e,v,i,!0))}):this._walk(e,v=>{this._eval(h,e[v],v,n,o,r)&&g(this._trace(p,e[v],Or(n,v),e,v,i,!0))})}else if(l[0]==="("){if(this.currEval===!1)throw new Error("Eval [(expr)] prevented in JSONPath expression.");g(this._trace(TI(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,y=l.slice(1,-2);switch(y){case"scalar":(!e||!["object","function"].includes(typeof e))&&(h=!0);break;case"boolean":case"string":case"undefined":case"function":typeof e===y&&(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===y&&(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 "+y)}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],Or(n,h),e,h,i,s,!0))}else if(l.includes(",")){let h=l.split(",");for(let y of h)g(this._trace(TI(y,p),e,n,o,r,i,!0))}else!u&&e&&Object.hasOwn(e,l)&&g(this._trace(p,e[l],Or(n,l),e,l,i,s,!0))}if(this._hasParentSelector)for(let h=0;h<d.length;h++){let y=d[h];if(y&&y.isParentSelector){let v=this._trace(y.expr,e,y.path,o,r,i,s);if(Array.isArray(v)){d[h]=v[0];let _=v.length;for(let x=1;x<_;x++)h++,d.splice(h,0,v[x])}else d[h]=v}}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(TI(h,e),n,o,r,i,s,!0).forEach(v=>{g.push(v)});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:CI};var e5=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"),PI=class PI{constructor(e){this.code=e}runInNewContext(e){let n=this.code,o=Object.keys(e),r=[];e5(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(PI,"Script");var AI=PI;ae.prototype.vm={Script:AI};var LL=(e=>(e.PROGRESSIVE_SSE_STREAMING="PROGRESSIVE_SSE_STREAMING",e))(LL||{}),t5=(o=>(o.WIP="wip",o.EXPERIMENTAL="experimental",o.STABLE="stable",o))(t5||{}),UL={PROGRESSIVE_SSE_STREAMING:{stage:"experimental",defaultOn:!1}},ML=new Set,Xn={};function $I(t){return UL[t]}a($I,"getFeatureConfig");function kCe(t,e){UL[t]=e}a(kCe,"registerFeature");function PCe(t,e){if(!$I(t))throw new Error(`Feature ${t} is not registered.`);e===void 0?delete Xn[t]:Xn[t]=e}a(PCe,"overrideFeatureEnabled");function FL(t){let e=$I(t);if(!e)throw new Error(`Feature ${t} is not registered.`);if(t in Xn){let r=Xn[t];return r&&e.stage!=="stable"&&NI(t,e.stage),r}let n=`ADK_ENABLE_${t}`,o=`ADK_DISABLE_${t}`;return Gr(n)?(e.stage!=="stable"&&NI(t,e.stage),!0):Gr(o)?!1:(e.stage!=="stable"&&e.defaultOn&&NI(t,e.stage),e.defaultOn)}a(FL,"isFeatureEnabled");function NI(t,e){ML.has(t)||(ML.add(t),w.warn(`[${e.toUpperCase()}] feature ${t} is enabled.`))}a(NI,"emitNonStableWarningOnce");async function NCe(t,e,n){if(!$I(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(NCe,"withTemporaryFeatureOverride");function Kf(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(Kf,"createLlmResponse");var n5=new Set(["__proto__","constructor","prototype"]),MI=class MI{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=>n5.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:wt()}};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=wt()),e.thoughtSignature&&!this.currentThoughtSignature&&(this.currentThoughtSignature=e.thoughtSignature),this.processStreamingFunctionCall(n)):n.name&&(n.id||(n.id=wt()),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(MI,"ProgressiveStrategy");var DI=MI,LI=class LI{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=wt()),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(LI,"NonProgressiveStrategy");var OI=LI,UI=class UI{constructor(e=FL("PROGRESSIVE_SSE_STREAMING")){this.isProgressiveMode=e;this.lastThoughtSignature={};this.strategy=this.isProgressiveMode?new DI:new OI}async*processResponse(e){var r,i;let n=Kf(e);if(((i=(r=n.content)==null?void 0:r.parts)!=null?i:[]).every(r5)&&(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(UI,"StreamingResponseAggregator");var jf=UI;function r5(t){return!t.functionCall&&!t.functionResponse&&!t.fileData&&!t.inlineData&&!t.executableCode&&!t.codeExecutionResult&&(!t.text||t.text==="")}a(r5,"isEmptyContentPart");var o5="^projects/[^/]+/locations/[^/]+/publishers/[^/]+/models/(.+)$";function Cu(t){let e=t.match(o5);return e?e[1]:t}a(Cu,"extractModelName");function An(t){return Cu(t).startsWith("gemini-")}a(An,"isGeminiModel");function i5(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(i5,"parseVersion");function Mr(t){return Cu(t).startsWith("gemini-1")}a(Mr,"isGemini1Model");function Qn(t){if(!t)return!1;let e=Cu(t);if(!e.startsWith("gemini-"))return!1;let n=e.slice(7).split("-",1)[0],o=i5(n);return o.valid&&o.major>=2}a(Qn,"isGemini2OrAbove");function er(t){if(!t)return!1;let e=Cu(t);return e.startsWith("gemini-3.")&&e.includes("-live")&&!Yf(t)}a(er,"isGemini3xLive");function Yf(t){return t?Cu(t).startsWith("gemini-3.5-live-translate"):!1}a(Yf,"isGemini35LiveTranslate");function s5(t){return er(t)}a(s5,"isGemini3xFlashLive");function Es(){return Gr("ADK_DISABLE_GEMINI_MODEL_ID_CHECK")}a(Es,"isGeminiModelIdCheckDisabled");var FI=class FI{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){let r=er(this.modelVersion),{text:i,finished:s}=n.inputTranscription;i&&(r||(this.inputTranscriptionText+=i),yield{inputTranscription:{text:i,finished:r},partial:!r,...this.modelVersion?{modelVersion:this.modelVersion}:{}}),s&&!r&&(yield{inputTranscription:{text:this.inputTranscriptionText,finished:!0},partial:!1,...this.modelVersion?{modelVersion:this.modelVersion}:{}},this.inputTranscriptionText="")}if(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}))),er(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(FI,"LiveResponseAggregator");var Xf=FI;var zI=class zI{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=er(this.modelVersion);this.geminiSession.sendClientContent({turns:n,turnComplete:o?!0:n[n.length-1].role==="user"})}else w.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);w.debug("Sending LLM function response:",n),this.geminiSession.sendToolResponse({functionResponses:n})}else w.debug("Sending LLM new content",e),er(this.modelVersion)&&e.parts.length===1&&e.parts[0].text?(w.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 i,s,u;w.debug("Sending LLM Blob:",e);let n=er(this.modelVersion),o=(i=this.modelVersion)==null?void 0:i.includes("native-audio"),r=Yf(this.modelVersion);n||o||r?(s=e.mimeType)!=null&&s.startsWith("audio/")?this.geminiSession.sendRealtimeInput({audio:e}):(u=e.mimeType)!=null&&u.startsWith("image/")?this.geminiSession.sendRealtimeInput({video:e}):w.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 Xf(this.modelVersion);for await(let n of this.messageQueue){w.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(zI,"GeminiLlmConnection");var Qf=zI;function zL(t){switch(t.split("/")[0]){case"image":return"image";case"audio":return"audio";case"video":return"video";default:return"document"}}a(zL,"getInteractionMediaType");function a5(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(a5,"getLatestUserContents");function GL(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:zL(e),data:t.inlineData.data,mime_type:e}}if(t.fileData!==void 0&&t.fileData!==null){let e=t.fileData.mimeType||"";return{type:zL(e),uri:t.fileData.fileUri,mime_type:e}}return null}a(GL,"convertPartToMediaContent");function u5(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=GL(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=GL(r);i&&o.push(i)}o.length>0&&e.push({type:"model_output",content:o})}return e}a(u5,"convertContentToSteps");function BI(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(BI,"convertMediaContentToPart");function l5(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=BI(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=BI(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(l5,"convertStepToParts");function c5(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(c5,"convertToolsConfigToInteractionsFormat");function GI(t,e){for(let n=t.length-1;n>=0;n--)if(e(t[n]))return t[n]}a(GI,"findLastPart");function d5(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=l5(o);e.unshift(...r)}return e}a(d5,"getLatestModelParts");function f5(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=d5(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(f5,"convertInteractionToLlmResponse");function p5(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=GI(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=GI(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=BI(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=GI(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){w.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(p5,"convertInteractionEventToLlmResponse");function m5(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(m5,"buildGenerationConfig");function g5(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(g5,"extractSystemInstruction");function h5(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(h5,"extractStreamInteractionId");async function*BL(t,e,n){let o=e.contents;e.previousInteractionId&&o&&(o=a5(o));let r=[];if(o)for(let p of o)r.push(...u5(p));let i=c5(e.config||{}),s=g5(e.config||{}),u=m5(e.config||{}),c=e.previousInteractionId;w.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=h5(g);h&&(l=h);let y=p5(g,d,l);y&&(yield y)}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});w.info("Interaction response received from the model."),yield f5(p)}}a(BL,"generateContentViaInteractions");var qI=Symbol.for("google.adk.geminiModel");function HL(t){return typeof t=="object"&&t!==null&&qI in t&&t[qI]===!0}a(HL,"isGemini");var VL,ZL,ep=class ep extends(ZL=Yn,VL=qI,ZL){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[VL]=!0;let l=tp({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*BL(this.apiClient,n,o);return}if(this.preprocessRequest(n),this.maybeAppendUserContent(n),w.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 jf;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 Kf(c)}}getHttpOptions(){return{headers:{...this.trackingHeaders,...this.headers}}}get apiClient(){return this._apiClient?this._apiClient:(this.vertexai?this._apiClient=new Hr({vertexai:this.vertexai,project:this.project,location:this.location,httpOptions:this.getHttpOptions()}):this._apiClient=new Hr({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 Hr({vertexai:this.vertexai,project:this.project,location:this.location||"global",httpOptions:this.getLiveHttpOptions()}):this._liveApiClient=new Hr({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:[ai(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 Qf(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)qL(r.inlineData),qL(r.fileData)}}};a(ep,"Gemini"),ep.supportedModels=[/gemini-.*/,/projects\/.+\/locations\/.+\/endpoints\/.+/,/projects\/.+\/locations\/.+\/publishers\/google\/models\/gemini.+/];var co=ep;function qL(t){t&&t.displayName&&(t.displayName=void 0)}a(qL,"removeDisplayNameIfPresent");function tp({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=el()),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(tp,"geminiInitParams");var JL="APIGEE_PROXY_URL",np=class np extends co{constructor({model:e,proxyUrl:n,apiKey:o,vertexai:r,location:i,project:s,headers:u}){var c;if(!KL(e))throw new Error(`Model ${e} is not a valid Apigee model, expected apigee/[<provider>/][<version>/]<model_id>`);if(super({...y5({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[JL])!=null?c:""),!this.proxyUrl)throw new Error(`Proxy URL must be provided via the constructor or ${JL} 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=WL(r),yield*super.generateContentAsync(e,n,o)}async connect(e){var o;let n=(o=e.model)!=null?o:this.model;return e.model=WL(n),super.connect(e)}};a(np,"ApigeeLlm"),np.supportedModels=[/apigee\/.*/];var Tu=np;function y5({model:t,vertexai:e,project:n,location:o,apiKey:r}){var s;let i=tp({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||(w.warn('No API key provided when using a Gemini model, using a fake key "-".'),i.apiKey="-"),i}a(y5,"apigeeToGeminiInitParams");function WL(t){if(!KL(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(WL,"getModelId");function KL(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(KL,"validateModel");function bn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(bn,"isRecord");function jL(t){return bn(t.parametersJsonSchema)?t.parametersJsonSchema:t.parameters?Sn(t.parameters):{type:"object",properties:{}}}a(jL,"argumentSchema");function YL(t){var n,o;let e=[];for(let r of(o=(n=t.config)==null?void 0:n.tools)!=null?o:[])bn(r)&&Array.isArray(r.functionDeclarations)&&e.push(...r.functionDeclarations);return e}a(YL,"collectFunctionDeclarations");function XL(t){let e=[{type:"object",properties:{kind:{type:"string",enum:["final"]},text:{type:"string"}},required:["kind","text"],additionalProperties:!1}];for(let n of t)n.name&&e.push({type:"object",properties:{kind:{type:"string",enum:["tool"]},name:{type:"string",enum:[n.name]},args:jL(n)},required:["kind","name","args"],additionalProperties:!1});return e.length===1?e[0]:{anyOf:e}}a(XL,"buildToolChoiceSchema");function QL(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(jL(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(QL,"renderToolInstructions");function v5(t){if(t==null)return"{}";let e=t;if(bn(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(v5,"renderToolResult");function eU(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=v5(u.functionResponse.response);s.push(`[tool_result] ${u.functionResponse.name} -> ${c}`)}}s.length&&e.push({role:i,content:s.join(`
|
|
91
|
+
`)})}return e}a(eU,"contentsToMessages");function tU(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
|
+
`):bn(e)&&Array.isArray(e.parts)?e.parts.map(o=>{var r;return(r=o.text)!=null?r:""}).filter(Boolean).join(`
|
|
93
|
+
`):String(e):""}a(tU,"extractSystemInstruction");function nU(t){return t.replace(/^You are an agent\. Your internal name is "[^"]*"\.\s*/m,"").replace(/^The description about you is "[^"]*"\s*/m,"").trimStart()}a(nU,"stripAdkIdentityPreamble");function rU(t){return bn(t)&&t.name==="AbortError"}a(rU,"isAbortError");function Lr(t){return{content:{role:"model",parts:[{text:t}]},turnComplete:!0}}a(Lr,"finalText");function oU(t){let e=bn(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(oU,"errorResponse");var VI="The model started an answer and did not finish it. Ask again.";function ZI(t){return/^\s*[[{]/.test(t)||/"kind"\s*:/.test(t)}a(ZI,"looksLikeEnvelope");function iU(t){var i;let e=t.match(/"text"\s*:\s*"/);if((e==null?void 0:e.index)===void 0)return;let n={n:`
|
|
94
|
+
`,t:" ",r:"\r",b:"\b",f:"\f",'"':'"',"\\":"\\","/":"/"},o="";for(let s=e.index+e[0].length;s<t.length;s++){let u=t[s];if(u==='"')break;if(u!=="\\"){o+=u;continue}let c=t[s+1];if(c===void 0)break;if(c==="u"){let l=t.slice(s+2,s+6);if(/^[0-9a-fA-F]{4}$/.test(l)){o+=String.fromCharCode(parseInt(l,16)),s+=5;continue}}o+=(i=n[c])!=null?i:c,s++}let r=o.trim();return r.length?r:void 0}a(iU,"salvageFinalText");var HI=class HI 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(HI,"ChromeModelUnavailableError");var Iu=HI,rp=class rp 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 Iu("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 Iu(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,y;let r=YL(e),i=r.length>0,s=tU(e),u=[this.params.normalizeSystemPrompt?this.params.normalizeSystemPrompt(s):s];i&&u.push(QL(r));let c=u.filter(Boolean).join(`
|
|
95
|
+
|
|
96
|
+
`);this.maybeAppendUserContent(e);let l=eU((d=e.contents)!=null?d:[]),p;try{p=await this.acquireSession(c,o);let v=(g=e.config)==null?void 0:g.responseJsonSchema,_=(h=e.config)==null?void 0:h.responseSchema,x;if(i?x=XL(r):bn(v)?x=v:_&&(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):Lr(E)}catch(v){if(rU(v))throw v;yield oU(v)}finally{p&&p!==this.baseSession&&((y=p.destroy)==null||y.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(!bn(o)){let r=iU(e);return r!==void 0?(this.diagnostic({phase:"parse-fallback",note:"truncated envelope; recovered the text"}),Lr(r)):(this.diagnostic({phase:"parse-fallback",note:"unparseable JSON; treated as text"}),Lr(ZI(e)?VI:e))}if(o.kind==="tool"&&typeof o.name=="string"){let r=o.name;if(!n.some(s=>s.name===r))return Lr(`The model requested an unknown tool "${r}".`);let i=bn(o.args)?o.args:{};return{content:{role:"model",parts:[{functionCall:{id:wt(),name:r,args:i}}]},turnComplete:!0}}return typeof o.text=="string"?Lr(o.text):o.text!==void 0?Lr(String(o.text)):(this.diagnostic({phase:"parse-fallback",note:"envelope carried no text"}),Lr(ZI(e)?VI: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(rp,"ChromeBuiltInLlm"),rp.supportedModels=[/chrome-on-device/,/chrome\/.*/];var Au=rp;var WI=class WI{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(WI,"LRUCache");var JI=WI,Ot=class Ot{static newLlm(e){return new(Ot.resolve(e))({model:e})}static _register(e,n){Ot.llmRegistryDict.has(e)&&w.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 JI(32);var Ur=Ot;Ur.register(co);Ur.register(Tu);Ur.register(Au);var KI=Symbol.for("google.adk.basePlanner");function jI(t){return typeof t=="object"&&t!==null&&KI in t&&t[KI]===!0}a(jI,"isBasePlanner");var sU;sU=KI;var YI=class YI{constructor(){this[sU]=!0}};a(YI,"BasePlanner");var fo=YI;var XI=Symbol.for("google.adk.builtInPlanner");function bu(t){return typeof t=="object"&&t!==null&&XI in t&&t[XI]===!0}a(bu,"isBuiltInPlanner");var aU,uU,eA=class eA extends(uU=fo,aU=XI,uU){constructor(n){super();this[aU]=!0;this.thinkingConfig=n.thinkingConfig}applyThinkingConfig(n){var o;this.thinkingConfig&&(n.config=(o=n.config)!=null?o:{},n.config.thinkingConfig=this.thinkingConfig)}buildPlanningInstruction(n,o){}processPlanningResponse(n,o){}};a(eA,"BuiltInPlanner");var QI=eA;function Ss(t){return Rf()==="VERTEX_AI"&&Qn(t)}a(Ss,"canUseOutputSchemaWithTools");var tA=class tA{};a(tA,"BaseLlmRequestProcessor");var ke=tA,nA=class nA{};a(nA,"BaseLlmResponseProcessor");var wu=nA;function Cs(t){if(Array.isArray(t))return t.map(Cs);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]=Cs(e[o])}return n}return t}a(Cs,"camelCaseKeys");var _5=new Set(["False","None","True","and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"]),x5="param_";function lU(t){return t.replace(/[^a-zA-Z0-9]+/g,"_").replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").toLowerCase().replace(/_+/g,"_").replace(/^_+|_+$/g,"")}a(lU,"toSnakeCaseName");function E5(t,e=x5){return _5.has(t)?e+t:t}a(E5,"renameReservedKeywords");var S5="_adk_toolset_auth_";function C5(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!==Ve)continue;let s=Cs(i.args);s!=null&&s.authConfig&&o.set(i.id,{config:s.authConfig,args:s})}return o}a(C5,"requestedAuthConfigs");async function T5(t,e,n,o,r){var u;let i=C5(t,e,r),s=new Set;for(let c of e){let l=i.get(c);if(!l){w.warn(`Ignoring credential response '${c}': no matching request from this agent.`);continue}let p=Mf(l.config,n[c]);if(!p){w.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(S5)&&s.add(d)}return s}a(T5,"storeAuthAndCollectResumeTargets");var oA=class oA extends ke{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=ce(r);if(!i||i.length===0)return;let s=new Set,u={};for(let p of i)p.name===Ve&&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 T5(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(y=>y.id?l.has(y.id):!1)){let y=await n.canonicalTools(new xe(e)),v={};for(let x of y)v[x.name]=x;let _=await gu({invocationContext:e,functionCallEvent:d,toolsDict:v,beforeToolCallbacks:n.canonicalBeforeToolCallbacks,afterToolCallbacks:n.canonicalAfterToolCallbacks,filters:l});_&&(yield _);return}}}};a(oA,"AuthPreprocessor");var op=oA,rA=new op;var iA=class iA extends ke{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;Ue(o,[this.buildTargetAgentsInstructions(n.agent,r)]);let i=new Se({invocationContext:n}),s=r.map(u=>u.name);await this.buildTool(s).processLlmRequest({toolContext:i,llmRequest:o})}buildTargetAgentsInfo(n){return`
|
|
97
|
+
Agent name: ${n.name}
|
|
98
|
+
Agent description: ${n.description}
|
|
99
|
+
`}buildTargetAgentsInstructions(n,o){let r=`
|
|
100
|
+
You have a list of other agents to transfer to:
|
|
101
|
+
|
|
102
|
+
${o.map(i=>this.buildTargetAgentsInfo(i)).join(`
|
|
103
|
+
`)}
|
|
104
|
+
|
|
105
|
+
If you are the best to answer the question according to your description, you
|
|
106
|
+
can answer it.
|
|
107
|
+
|
|
108
|
+
If another agent is better for answering the question according to its
|
|
109
|
+
description, call \`${this.toolName}\` function to transfer the
|
|
110
|
+
question to that agent. When transferring, do not generate any text other than
|
|
111
|
+
the function call.
|
|
112
|
+
`;return n.parentAgent&&!n.disallowTransferToParent&&(r+=`
|
|
113
|
+
Your parent agent is ${n.parentAgent.name}. If neither the other agents nor
|
|
114
|
+
you are best for answering the question according to the descriptions, transfer
|
|
115
|
+
to your parent agent.
|
|
116
|
+
`),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(iA,"AgentTransferLlmRequestProcessor");var ip=iA,cU=new ip;var aA=class aA extends ke{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)||Ss(o.canonicalModel.model))&&lL(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(aA,"BasicLlmRequestProcessor");var sA=aA,dU=new sA;var uA=Symbol.for("google.adk.baseCodeExecutor");function sp(t){return typeof t=="object"&&t!==null&&uA in t&&t[uA]===!0}a(sp,"isBaseCodeExecutor");var fU;fU=uA;var lA=class lA{constructor(){this[fU]=!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(lA,"BaseCodeExecutor");var Ru=lA;var cA=Symbol.for("google.adk.builtInCodeExecutor");function Pu(t){return typeof t=="object"&&t!==null&&cA in t&&t[cA]===!0}a(Pu,"isBuiltInCodeExecutor");var pU,mU,dA=class dA extends(mU=Ru,pU=cA,mU){constructor(){super(...arguments);this[pU]=!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(dA,"BuiltInCodeExecutor");var ku=dA;var gU=(n=>(n.UTF8="utf-8",n.BASE64="base64",n))(gU||{}),fA=(u=>(u.UNSPECIFIED="unspecified",u.PYTHON="python",u.JAVASCRIPT="javascript",u.TYPESCRIPT="typescript",u.SHELL="shell",u.POWERSHELL="powershell",u.WINDOWS_CMD="cmd",u))(fA||{});function hU(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=Ge(n[0]),r=n.map(d=>d.text).join(`
|
|
117
|
+
`),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(pA(l)),l):""}a(hU,"extractCodeAndTruncateContent");function pA(t){return{text:t,executableCode:{code:t,language:Ul.PYTHON}}}a(pA,"buildExecutableCodePart");function yU(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:
|
|
118
|
+
${t.stdout}
|
|
119
|
+
`),t.outputFiles&&e.push(`Saved artifacts:
|
|
120
|
+
`+t.outputFiles.map(n=>n.name).join(", ")),{text:e.join(`
|
|
121
|
+
|
|
122
|
+
`),codeExecutionResult:{outcome:mn.OUTCOME_OK}}}a(yU,"buildCodeExecutionResultPart");function vU(t,e,n){var r;if(!((r=t.parts)!=null&&r.length))return;let o=t.parts[t.parts.length-1];if(o.executableCode)t.parts[t.parts.length-1]={text:e[0]+(o.executableCode.code||"")+e[1]};else if(t.parts.length==1&&o.codeExecutionResult){let i=o.codeExecutionResult.output,s=i==null?"":n[0]+i+n[1];t.parts[t.parts.length-1]={text:s},t.role="user"}}a(vU,"convertCodeExecutionParts");var mA="_code_execution_context",gA="execution_session_id",po="processed_input_files",mo="_code_executor_input_files",go="_code_executor_error_counts",hA="_code_execution_results",yA=class yA{constructor(e){this.sessionState=e;var n;this.context=(n=e.get(mA))!=null?n:{},this.sessionState=e}getStateDelta(){return{[mA]:Ge(this.context)}}getExecutionId(){if(gA in this.context)return this.context[gA]}setExecutionId(e){this.context[gA]=e}getProcessedFileNames(){return po in this.context?this.context[po]:[]}addProcessedFileNames(e){po in this.context||(this.context[po]=[]),this.context[po].push(...e)}getInputFiles(){return this.sessionState.has(mo)?this.sessionState.get(mo):[]}addInputFiles(e){this.sessionState.has(mo)||this.sessionState.set(mo,[]),this.sessionState.get(mo).push(...e)}clearInputFiles(){this.sessionState.has(mo)&&this.sessionState.set(mo,[]),po in this.context&&(this.context[po]=[])}getErrorCount(e){return this.sessionState.has(go)&&this.sessionState.get(go)[e]||0}incrementErrorCount(e){this.sessionState.has(go)||this.sessionState.set(go,{}),this.sessionState.get(go)[e]=this.getErrorCount(e)+1}resetErrorCount(e){if(!this.sessionState.has(go))return;let n=this.sessionState.get(go);e in n&&delete n[e]}updateCodeExecutionResult({invocationId:e,code:n,resultStdout:o,resultStderr:r}){this.sessionState.has(hA)||this.sessionState.set(hA,{});let i=this.sessionState.get(hA);e in i||(i[e]=[]),i[e].push({code:n,resultStdout:o,resultStderr:r,timestamp:Date.now()})}getCodeExecutionContext(){return this.sessionState.get(mA)||{}}};a(yA,"CodeExecutorContext");var Nu=yA;var xA=class xA extends ke{async*runAsync(e,n){if(te(e.agent)&&e.agent.codeExecutor){for await(let o of A5(e,n))yield o;if(sp(e.agent.codeExecutor))for(let o of n.contents){let r=e.agent.codeExecutor.codeBlockDelimiters.length?e.agent.codeExecutor.codeBlockDelimiters[0]:["",""];vU(o,r,e.agent.codeExecutor.executionResultDelimiters)}}}};a(xA,"CodeExecutionRequestProcessor");var vA=xA,ap={"text/csv":{extension:".csv",loaderCodeTemplate:"pd.read_csv('{filename}')"}},I5=`
|
|
123
|
+
import pandas as pd
|
|
124
|
+
|
|
125
|
+
def explore_df(df: pd.DataFrame) -> None:
|
|
126
|
+
"""Prints some information about a pandas DataFrame."""
|
|
127
|
+
|
|
128
|
+
with pd.option_context(
|
|
129
|
+
'display.max_columns', None, 'display.expand_frame_repr', False
|
|
130
|
+
):
|
|
131
|
+
# Print the column names to never encounter KeyError when selecting one.
|
|
132
|
+
df_dtypes = df.dtypes
|
|
133
|
+
|
|
134
|
+
# Obtain information about data types and missing values.
|
|
135
|
+
df_nulls = (len(df) - df.isnull().sum()).apply(
|
|
136
|
+
lambda x: f'{x} / {df.shape[0]} non-null'
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
# Explore unique total values in columns using \`.unique()\`.
|
|
140
|
+
df_unique_count = df.apply(lambda x: len(x.unique()))
|
|
141
|
+
|
|
142
|
+
# Explore unique values in columns using \`.unique()\`.
|
|
143
|
+
df_unique = df.apply(lambda x: crop(str(list(x.unique()))))
|
|
144
|
+
|
|
145
|
+
df_info = pd.concat(
|
|
146
|
+
(
|
|
147
|
+
df_dtypes.rename('Dtype'),
|
|
148
|
+
df_nulls.rename('Non-Null Count'),
|
|
149
|
+
df_unique_count.rename('Unique Values Count'),
|
|
150
|
+
df_unique.rename('Unique Values'),
|
|
151
|
+
),
|
|
152
|
+
axis=1,
|
|
153
|
+
)
|
|
154
|
+
df_info.index.name = 'Columns'
|
|
155
|
+
print(f"""Total rows: {df.shape[0]}
|
|
156
|
+
Total columns: {df.shape[1]}
|
|
157
|
+
|
|
158
|
+
{df_info}""")
|
|
159
|
+
`,EA=class EA{async*runAsync(e,n){if(!n.partial)for await(let o of b5(e,n))yield o}};a(EA,"CodeExecutionResponseProcessor");var _A=EA,PAe=new _A;async function*A5(t,e){let n=t.agent;if(!te(n))return;let o=n.codeExecutor;if(!o||!sp(o))return;if(Pu(o)){o.processLlmRequest(e);return}if(!o.optimizeDataFile)return;let r=new Nu(new me(t.session.state));if(r.getErrorCount(t.invocationId)>=o.errorRetryAttempts)return;let i=w5(r,e),s=new Set(r.getProcessedFileNames()),u=i.filter(c=>!s.has(c.name));for(let c of u){let l=R5(c);if(!l)return;let p={role:"model",parts:[{text:`Processing input file: \`${c.name}\``},pA(l)]};e.contents.push(Ge(p)),yield W({invocationId:t.invocationId,author:n.name,branch:t.branch,content:p});let d=_U(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 xU(t,r,g);yield h,e.contents.push(Ge(h.content))}}a(A5,"runPreProcessor");async function*b5(t,e){let n=t.agent;if(!te(n))return;let o=n.codeExecutor;if(!o||!sp(o)||!e||!e.content||Pu(o))return;let r=new Nu(new me(t.session.state));if(r.getErrorCount(t.invocationId)>=o.errorRetryAttempts)return;let i=e.content,s=hU(i,o.codeBlockDelimiters);if(!s)return;yield W({invocationId:t.invocationId,author:n.name,branch:t.branch,content:i});let u=_U(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 xU(t,r,c),e.content=void 0}a(b5,"runPostProcessor");function w5(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||!ap[l])continue;let p=`data_${i+1}_${u+1}${ap[l].extension}`;c.text=`
|
|
160
|
+
Available file: \`${p}\`
|
|
161
|
+
`;let d={name:p,content:OR(c.inlineData.data),mimeType:l};o.has(p)||(t.addInputFiles([d]),n.push(d))}}return n}a(w5,"extractAndReplaceInlineFiles");function _U(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(_U,"getOrSetExecutionId");async function xU(t,e,n){if(!t.artifactService)throw new Error("Artifact service is not initialized.");let o={role:"model",parts:[yU(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 W({invocationId:t.invocationId,author:Ke(t).name,branch:t.branch,content:o,actions:r})}a(xU,"postProcessCodeExecutionResult");function R5(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"),!ap[t.mimeType])return;let n=e(t.name),o=ap[t.mimeType].loaderCodeTemplate.replace("{filename}",t.name);return`
|
|
162
|
+
${I5}
|
|
163
|
+
|
|
164
|
+
# Load the dataframe.
|
|
165
|
+
${n} = ${o}
|
|
166
|
+
|
|
167
|
+
# Use \`explore_df\` to guide my analysis.
|
|
168
|
+
explore_df(${n})
|
|
169
|
+
`}a(R5,"getDataFilePreprocessingCode");var EU=new vA;function dn(t){return"isCompacted"in t&&t.isCompacted===!0}a(dn,"isCompactedEvent");function Ts(t){return dn(t)&&t.isScratchpad===!0}a(Ts,"isScratchpadEvent");function SU(t={}){return{...W(t),isCompacted:t.isCompacted||!0,startTime:t.startTime,endTime:t.endTime,compactedContent:t.compactedContent,isScratchpad:t.isScratchpad}}a(SU,"createCompactedEvent");function ho(t,e){let n=t.filter(r=>Kt(r,e)),o=n.filter(dn).pop();return o?[o,...n.filter(r=>!dn(r)&&r.timestamp>o.endTime)]:n}a(ho,"getActiveEvents");function Kt(t,e){return t.isolationScope===void 0||t.isolationScope===e}a(Kt,"isEventVisibleInIsolationScope");function Is(t,e){let n=Math.max(0,t.length-e);for(;n>0;){let o=t[n],r=t[n-1];if(ce(o).length>0&&le(r).length>0)n--;else break}return n}a(Is,"calculateRetainStartIndex");function up(t,e){return!e||e===t||!!t&&t.startsWith(`${e}.`)}a(up,"isSegmentPrefix");var k5="<unstringifiable value>";function P5(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(Ks)&&(s.functionCall.id=void 0),(i=(r=s.functionResponse)==null?void 0:r.id)!=null&&i.startsWith(Ks)&&(s.functionResponse.id=void 0)}a(P5,"removeClientFunctionCallId");function $u(t,e,n,o){let r=[];for(let u of t)if(Kt(u,o)){if(dn(u)){r.push(F5(u));continue}TU(u,n,o)&&r.push(AU(e,u)?M5(u):u)}let i=L5(r);i=U5(i);let s=[];for(let u of i){let c=Ge(u.content);P5(c),s.push(c)}return s}a($u,"getContents");function TU(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&&!up(e,t.branch)||!Kt(t,n)?!1:!D5(t)&&!O5(t)&&!N5(t)}a(TU,"shouldIncludeEventInContext");function N5(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)===Le||((o=r.functionResponse)==null?void 0:o.name)===Le)return!0;return!1}a(N5,"isRequestInputEvent");function IU(t,e,n,o){for(let r=t.length-1;r>=0;r--){let i=t[r];if(TU(i,n,o)&&(i.author==="user"||AU(e,i)))return $u(t.slice($5(t,r)),e,n,o)}return[]}a(IU,"getCurrentTurnContents");function $5(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($5,"turnStart");function D5(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)===Ve||((o=r.functionResponse)==null?void 0:o.name)===Ve)return!0;return!1}a(D5,"isAuthEvent");function O5(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(O5,"isToolConfirmationEvent");function AU(t,e){return!!t&&e.author!==t&&e.author!=="user"}a(AU,"isEventFromAnotherAgent");function M5(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: ${CU(c.functionCall.args)}`}):c.functionResponse?(s=e.parts)==null||s.push({text:`[${t.author}] tool \`${c.functionResponse.name}\` returned result: ${CU(c.functionResponse.response)}`}):(u=e.parts)==null||u.push(Ge(c));return W({invocationId:t.invocationId,author:"user",content:e,branch:t.branch,timestamp:t.timestamp})}a(M5,"convertForeignEvent");function bU(t){var r;if(t.length===0)throw new Error("Cannot merge an empty list of events.");let e=W({...t[0],content:t[0].content?Ge(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=Ge(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(bU,"mergeFunctionResponseEvents");function L5(t){if(t.length===0)return t;let e=t[t.length-1],n=ce(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 y=new Set(d.map(_=>_.id).filter(_=>!!_));if(!Array.from(o).every(_=>y.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(y).join(", ")}, function response ids provided: ${Array.from(o).join(", ")}`);i={eventIdx:l,responseIds:y},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=ce(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(bU(s)),c}a(L5,"rearrangeEventsForLatestFunctionResponse");function U5(t){let e=new Map;for(let o=0;o<t.length;o++){let r=t[o],i=ce(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(ce(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(bU(u))}}else n.push(o)}return n}a(U5,"rearrangeEventsForAsyncFunctionResponsesInHistory");function CU(t){if(typeof t=="string")return t;try{let e=JSON.stringify(t);if(typeof e=="string")return e}catch(e){}try{return String(t)}catch(e){return k5}}a(CU,"safeStringify");function F5(t){let e=yc(`[Previous Context Summary]:
|
|
170
|
+
${t.compactedContent}`);return W({invocationId:t.invocationId,author:"user",content:e,branch:t.branch,timestamp:t.timestamp})}a(F5,"convertCompactedEvent");var SA=class SA{async*runAsync(e,n){let o=e.agent;if(!o||!te(o))return;let r=ho(e.session.events,e.isolationScope);o.includeContents==="default"?n.contents=$u(r,o.name,e.branch,e.isolationScope):n.contents=IU(r,o.name,e.branch,e.isolationScope)}};a(SA,"ContentRequestProcessor");var lp=SA,cp=new lp;var dp=new Set;function tt(t,e,n){var o;if(e===void 0){let r=t.name,i=(o=class extends t{constructor(...u){dp.has(r)||(w.warn(`Class ${r} is experimental and may change in the future.`),dp.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 dp.has(s)||(w.warn(`Method ${s} is experimental and may change in the future.`),dp.add(s)),u.apply(this,c)},n}throw new Error("Invalid decorator usage")}a(tt,"experimental");var fp=(o=>(o.Manual="Manual",o.Auto="Auto",o.AgentControlled="AgentControlled",o))(fp||{}),As=class As{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(As,"BasePlugin"),Pe([tt],As.prototype,"beforeToolSelection",1),Pe([tt],As.prototype,"beforeContextCompaction",1),Pe([tt],As.prototype,"afterContextCompaction",1);var Mt=As;var CA=class CA{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(CA,"ContextCompactorRequestProcessor");var bs=CA;var IA=class IA extends ke{async*runAsync(e,n){let o=Ke(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}"`),Ue(n,r)}};a(IA,"IdentityLlmRequestProcessor");var TA=IA,wU=new TA;var AA="artifact.",kU=/^[A-Za-z_]\w*\.[A-Za-z_]\w*$/,z5=/<\s*[A-Za-z_]\w*\.([A-Za-z_]\w*)\s+from\s+([A-Za-z_]\w*)\s*>/g;function G5(t,e,n,o){var i;let r=(i=o.outputsByNode)==null?void 0:i[n];return r&&typeof r=="object"&&e in r?pp(r[e],!1):t}a(G5,"resolveSourceNode");async function B5(t,e,n,o){let r=o.invocationContext;if(t.startsWith(AA)){let s=t.substring(AA.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 pp(u,!0)}if(PU(t)){if(t in r.session.state)return pp(r.session.state[t],!1);if(e)return"";throw new Error(`Context variable not found: \`${t}\`.`)}let i=r.workflowInstructionScope;if(i&&kU.test(t)){let s=t.slice(t.indexOf(".")+1),u=i.input;if(u&&typeof u=="object"&&s in u)return pp(u[s],!1);if(e)return""}return n}a(B5,"resolveKey");function pp(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(pp,"formatValue");async function Du(t,e){let n=e.invocationContext.workflowInstructionScope,o=n?Array.from(t.matchAll(z5)).map(g=>({raw:g[0],index:g.index,resolved:G5(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],y=h.replace(/^\{+/,"").replace(/\}+$/,"").trim(),v=y.endsWith("?");v&&(y=y.slice(0,-1));let _=y.startsWith(AA)||PU(y)||!!n&&kU.test(y);return{raw:h,key:y,isOptional:v,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,B5(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(Du,"injectSessionState");var q5=/^[a-zA-Z_][a-zA-Z0-9_]*$/;function RU(t){return t===""||t===void 0?!1:q5.test(t)}a(RU,"isIdentifier");var V5=[me.APP_PREFIX,me.USER_PREFIX,me.TEMP_PREFIX];function PU(t){let e=t.split(":");return e.length===0||e.length>2?!1:e.length===1?RU(t):V5.includes(e[0]+":")?RU(e[1]):!1}a(PU,"isValidStateName");var wA=class wA extends ke{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 xe(e)),c=s;u&&(c=await Du(s,new xe(e))),Ue(n,[c])}if(o.instruction){let{instruction:s,requireStateInjection:u}=await o.canonicalInstruction(new xe(e)),c=s;u&&(c=await Du(s,new xe(e))),Ue(n,[c])}o.outputSchema&&((i=o.tools)!=null&&i.length)&&!Ss(o.canonicalModel.model)&&Ue(n,['To output the final result, you must call the "set_model_response" function with the appropriate values. Do not output anything else.'])}};a(wA,"InstructionsLlmRequestProcessor");var bA=wA,NU=new bA;var kA=class kA{async*runAsync(e,n){let o=e.agent;if(!o||!te(o))return;let r=o.canonicalModel;if(HL(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(kA,"InteractionsRequestProcessor");var mp=kA,RA=new mp;function $U(t){let e=t.agent;if(!(!te(e)||!jI(e.planner)))return e.planner}a($U,"getPlanner");function Z5(t){let{thought:e,...n}=t;return n}a(Z5,"removeThought");function H5(t){return t.map(e=>e.parts?{...e,parts:e.parts.map(Z5)}:e)}a(H5,"removeThoughtFromContents");var $A=class $A extends ke{async*runAsync(e,n){let o=$U(e);if(!o)return;bu(o)&&o.applyThinkingConfig(n);let r=o.buildPlanningInstruction(new xe(e),n);r&&Ue(n,[r]),n.contents=H5(n.contents)}};a($A,"NlPlanningRequestProcessor");var PA=$A,DA=class DA extends wu{async*runAsync(e,n){var i,s;let o=$U(e);if(!o||!((s=(i=n.content)==null?void 0:i.parts)!=null&&s.length))return;let r=o.processPlanningResponse(new Se({invocationContext:e}),n.content.parts);r!==void 0&&(n.content={...n.content,parts:r})}};a(DA,"NlPlanningResponseProcessor");var NA=DA,DU=new PA,OU=new NA;var MA=class MA extends ke{async*runAsync(e){var h;let n=e.agent;if(!te(n))return;let o=J5(e);if(o.length===0)return;let r=e.runConfig;if(r!=null&&r.remoteDelivered&&!r.allowRemoteToolConfirmation){w.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=W5(o,(h=r==null?void 0:r.plainTextToolConfirmation)!=null?h:!1,n.name);if(i.size===0)return;let s=j5(o,i,n.name);if(s.length===0)return;let u=await n.canonicalTools(new xe(e)),c=Object.fromEntries(u.map(y=>[y.name,y])),l=await Y5({candidates:s,events:o,toolsDict:c,agentName:n.name,invocationContext:e}),p=await Nr({invocationContext:e,functionCalls:[...l.values()].map(y=>y.call),toolsDict:c,beforeToolCallbacks:n.canonicalBeforeToolCallbacks,afterToolCallbacks:n.canonicalAfterToolCallbacks,filters:new Set(l.keys()),toolConfirmationDict:Object.fromEntries([...l].map(([y,v])=>[y,v.confirmation]))});if(!p)return;let d=e.session.events,g=d.findIndex(y=>y.id===p.id);g>=0?d[g]=p:d.push(p),yield p}};a(MA,"RequestConfirmationLlmRequestProcessor");var OA=MA;function J5(t){let e=t.session.events,n=t.branch;return n?e.filter(o=>!o.branch||up(n,o.branch)):e}a(J5,"eventsInScope");function W5(t,e,n){let o=new Map,r=nQ(t);if(!r)return o;for(let i of ce(r))i.name===je&&(!i.id||!i.response||o.set(i.id,K5(i.response)));return o.size===0&&e?iQ(t,n):o}a(W5,"collectApprovals");function K5(t){let e=Object.keys(t).length===1&&"response"in t?JSON.parse(t.response):t;return new Pr({hint:e.hint,payload:e.payload,confirmed:e.confirmed===!0})}a(K5,"parseToolConfirmation");function j5(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 uo({reason:"untrusted_request",functionCallId:s.id});w.debug(`Skipping tool confirmation from event ${i.id}: authored by ${i.author}, not by ${n}.`);continue}let c=eQ(s);if(c){if(!c.id||!c.name)throw new uo({reason:"malformed_request",functionCallId:s.id});tQ(t,c.id,r,n)||o.push({pinned:c,confirmation:u})}}return o}a(j5,"collectGateCandidates");async function Y5(t){var l,p,d;let{candidates:e,events:n,toolsDict:o,agentName:r,invocationContext:i}=t,s=X5(n,r),u=Q5(n,r),c=new Map;for(let{pinned:g,confirmation:h}of e){let y=g.id,v=a(C=>new uo({reason:C,functionCallId:y}),"refuse"),_=s.get(y);if(!_)throw v("unknown_original_call");let x=o[g.name];if(!x)throw v("unregistered_tool");if(_.name!==g.name)throw v("tool_name_mismatch");if(!sm((l=_.args)!=null?l:{},(p=g.args)!=null?p:{}))throw v("arguments_mismatch");if(!await x.checkRequireConfirmation((d=_.args)!=null?d:{},new Se({invocationContext:i,functionCallId:y}))&&!u.has(y))throw v("confirmation_not_required");c.set(y,{call:g,confirmation:h})}return c}a(Y5,"bindApprovedCalls");function X5(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(X5,"agentAuthoredCalls");function Q5(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(Q5,"dynamicallyRequestedCallIds");function eQ(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(eQ,"pinnedCall");function tQ(t,e,n,o){return t.slice(n+1).some(r=>r.author===o&&ce(r).some(i=>i.id===e))}a(tQ,"hasRespondedAfter");function nQ(t){for(let e=t.length-1;e>=0;e--)if(t[e].author==="user")return t[e]}a(nQ,"findLatestUserEvent");var rQ=new Set(["yes","y","true","approve","approved","ok","okay","confirm","confirmed"]),oQ=new Set(["no","n","false","reject","rejected","deny","denied","cancel","cancelled"]);function iQ(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(v=>typeof v.text=="string")&&(o=d,r=h.map(v=>v.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 ce(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(rQ.has(u))c=!0;else if(oQ.has(u))c=!1;else return n;return new Map([[s,new Pr({confirmed:c})]])}a(iQ,"mapPlainTextConfirmation");var MU=new OA;function LA(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=aQ(d.name,d.args),h=(i=(r=d.id)!=null?r:Ou(g.interruptId))!=null?i:Ou(g.functionCallId);if(!h)continue;let y={interruptId:h,functionCallName:d.name,author:t.author};switch(d.name){case Le:e.push({...y,kind:"input",message:Ou(g.message),payload:(s=g.payload)!=null?s:void 0,responseSchema:(u=g.response_schema)!=null?u:void 0});break;case Ve:e.push({...y,kind:"credential",message:Ou(g.message),authConfig:(c=g.authConfig)!=null?c:void 0});break;case je:{let v=g.toolConfirmation,_=g.originalFunctionCall;e.push({...y,kind:"confirmation",message:uQ(v==null?void 0:v.hint),payload:(l=v==null?void 0:v.payload)!=null?l:void 0,toolName:Ou(_==null?void 0:_.name)});break}default:break}}return e}a(LA,"getUserInputRequests");function UA(t){return LA(t).length>0}a(UA,"requiresUserInput");function sQ(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 LA(u))e.has(c.interruptId)||o.has(c.interruptId)||(o.add(c.interruptId),n.push(c));return n}a(sQ,"getPendingUserInputRequests");function aQ(t,e){return e?t===Ve?Cs(e):e:{}}a(aQ,"normalizeArgs");function Ou(t){return typeof t=="string"?t:void 0}a(Ou,"asString");function uQ(t){return typeof t=="string"&&t.trim()?t:void 0}a(uQ,"asNonEmptyString");var LU="result";function ws(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)),lQ(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(ws,"eventsForCurrentRun");function lQ(t){return UA(t)}a(lQ,"raisedInterrupt");function UU(t,e){return e?FA(t,n=>{var o;return(o=n.nodeInfo)!=null&&o.path?VU(n.nodeInfo.path,e):void 0}):FA(t,n=>{var o;return(o=n.nodeInfo)!=null&&o.path?qU(n.nodeInfo.path):n.author})}a(UU,"reconstructNodeStates");function FU(t){return FA(t,e=>{var n,o;return(o=(n=e.nodeInfo)==null?void 0:n.path)!=null?o:e.author})}a(FU,"reconstructNodeStatesByPath");function zA(t){var s,u;let e=Lf(t),n=mQ(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===Le&&c===n)throw new Error(o.has(p.id)?dQ(p.id,r):cQ(p.id,r));continue}let d=e.get(p.id),g=yp(p.response,d),h=yu(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(zA,"resolvedInterruptResponses");function zU(t){return t.size?`Still waiting: ${[...t].map(e=>`'${e}'`).join(", ")}.`:"This run has no interrupt waiting for an answer."}a(zU,"waitingList");function cQ(t,e){return`The reply carries interrupt id '${t}', which does not match any interrupt this run raised. ${zU(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(cQ,"unroutableReplyMessage");function dQ(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. ${zU(e)}`}a(dQ,"alreadyAnsweredMessage");function GU(t,e){return BU(t,fQ(e))}a(GU,"reconstructNodeRuns");function fQ(t){return t?e=>{var n;return(n=e.nodeInfo)!=null&&n.path?VU(e.nodeInfo.path,t):void 0}:e=>{var n;return(n=e.nodeInfo)!=null&&n.path?qU(e.nodeInfo.path):e.author}}a(fQ,"keyFn");function pQ(t){return t.output!==void 0||t.route!==void 0||t.interruptIds.size>0}a(pQ,"isRunClosed");function FA(t,e){let n=new Map;for(let[o,r]of BU(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(FA,"reconstruct");function BU(t,e){var s,u,c;let n=new Map,o=new Map,r=zA(t),i=a(l=>{let p=n.get(l);p||(p=[],n.set(l,p));let d=p[p.length-1];if(d&&!pQ(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 y=h.functionResponse;y!=null&&y.id&&o.has(y.id)&&r.has(y.id)&&o.get(y.id).resolvedResponses.set(y.id,r.get(y.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;ZU(g)&&"input"in g&&(d.input=g.input)}return n}a(BU,"reconstructRuns");function mQ(t){for(let e=t.length-1;e>=0;e--)if(t[e].author==="user")return t[e]}a(mQ,"lastUserEvent");function gp(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(gp,"isFastForwardable");function hp(t,e){var n;return{output:e.output,route:e.route,branch:(n=e.branch)!=null?n:t.branch,interruptIds:[]}}a(hp,"makeFastForwardResult");function qU(t){var n;return((n=t.split(/[./]/).pop())!=null?n:t).split("@")[0]}a(qU,"nodeNameFromPath");function VU(t,e){let n=`${e}.`;if(!t.startsWith(n))return;let o=t.slice(n.length);if(!o.includes("."))return o.split("@")[0]}a(VU,"directChildName");function ZU(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(ZU,"isRecord");function yp(t,e){if(t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===1&&LU in t){let n=t[LU];return typeof n!="string"||HU(e)?n:gQ(n)}return t}a(yp,"unwrapResponse");function HU(t){if(!ZU(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(HU))return!0}return!1}a(HU,"acceptsString");function gQ(t){try{return JSON.parse(t)}catch(e){return t}}a(gQ,"parseJsonIfPossible");var BA=class BA extends ke{async*runAsync(e){let n=e.agent;if(!te(n))return;let o=e.session.events;if(!o||o.length===0)return;let r=hQ(o);if(Object.keys(r).length===0)return;let i=await n.canonicalTools(new xe(e)),s=Object.fromEntries(i.map(y=>[y.name,y])),u=new Set(i.filter(y=>RL(y)).map(y=>y.name));if(u.size===0)return;let c=new Set;for(let y of o)for(let v of ce(y))v.id&&c.add(v.id);let l={};for(let y of o)if(y.author===n.name)for(let v of le(y))v.id&&v.name&&u.has(v.name)&&!c.has(v.id)&&(l[v.id]=v);if(Object.keys(l).length===0)return;let p={};for(let y of Object.keys(l))p[y]=r;let d=new cn;e.eventQueue=d;let g=(async()=>{try{return await Nr({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 y of d)yield y;let h=await g;e.eventQueue=void 0,h&&(yield h)}};a(BA,"RequestInputLlmRequestProcessor");var GA=BA;function hQ(t){var l,p;let e=Lf(t),n=!0;for(let d=t.length-1;d>=0;d--){let g=t[d];if(g.author!=="user")continue;let h={},y=!1;for(let v of ce(g))if(v.name===Le&&v.id){let _=e.get(v.id),x=yp(v.response,_),E=yu(v.id,x,_);if(E){if(n)throw new Error(E);continue}h[v.id]=x,y=!0}if(y)return h;n=!1}let o=yQ(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(hQ,"collectResumeInputs");function yQ(t,e){let n=new Set;for(let r of t)if(r.author==="user")for(let i of ce(r)){if(!i.id)continue;let s=e.get(i.id);yu(i.id,yp(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===Le&&i.id&&!n.has(i.id)&&o.add(i.id);return o}a(yQ,"pendingInterruptIds");var JU=new GA;var VA=class VA extends ke{async*runAsync(e,n){let o=e.agent;if(!te(o))return;let r=await o.canonicalTools(new xe(e));if(r.length===0)return;let i={};for(let c of r)i[c.name]=c;let s=new Se({invocationContext:e}),u=await e.pluginManager.runBeforeToolSelection({callbackContext:s,tools:i});u!==void 0&&(n.allowedTools=Object.keys(u))}};a(VA,"ToolFilterRequestProcessor");var qA=VA,WU=new qA;var ZA=(o=>(o.NONE="none",o.SSE="sse",o.BIDI="bidi",o))(ZA||{});function HA(t={}){var e;return vQ(t.streamingMode),{saveInputBlobsAsArtifacts:!1,supportCfc:!1,enableAffectiveDialog:!1,streamingMode:"none",pauseOnToolCalls:!1,...t,maxLlmCalls:_Q((e=t.maxLlmCalls)!=null?e:500)}}a(HA,"createRunConfig");function vQ(t){if(t==="bidi")throw new Error("StreamingMode.BIDI is not supported; use StreamingMode.SSE.")}a(vQ,"validateStreamingMode");function _Q(t){if(t>Number.MAX_SAFE_INTEGER)throw new Error(`maxLlmCalls should be less than ${Number.MAX_SAFE_INTEGER}.`);return t<=0&&w.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(_Q,"validateMaxLlmCalls");var KU=5,jU=1e3,KA=class KA extends Error{constructor(n){super(`live reconnect requested: ${n}`);this.reason=n;this.name="LiveReconnectSignal"}};a(KA,"LiveReconnectSignal");var Mu=KA;function YU(t){var o;if(t instanceof Mu)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(YU,"isRecoverableLiveError");function XU(t){return new Promise(e=>setTimeout(e,t))}a(XU,"sleep");var xQ=["responseModalities","speechConfig","outputAudioTranscription","inputAudioTranscription","realtimeInputConfig","contextWindowCompression","proactivity","enableAffectiveDialog"];function EQ(t,e){var o;if(!t)return;let n=(o=e.liveConnectConfig)!=null?o:e.liveConnectConfig={};for(let r of xQ)t[r]!==void 0&&(n[r]=t[r])}a(EQ,"applyLiveRunConfig");var QU="adk_agent_name";async function JA(t,e){return du(t)?[t]:vu(t)?[new vs(t)]:await t.getTools(e)}a(JA,"convertToolUnionToTools");var WA=Symbol.for("google.adk.llmAgent");function te(t){return typeof t=="object"&&t!==null&&WA in t&&t[WA]===!0}a(te,"isLlmAgent");var eF,tF,yo=class yo extends(tF=$t,eF=WA,tF){constructor(n){var r,i,s,u,c,l,p,d,g,h,y,v;super({...n,rerunOnResume:(r=n.rerunOnResume)!=null?r:!0,waitForOutput:(i=n.waitForOutput)!=null?i:n.mode==="task"});this[eF]=!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=Cn(n.inputSchema)?kr(n.inputSchema):n.inputSchema,this.outputSchema=Cn(n.outputSchema)?kr(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.planner=n.planner,this.requestProcessors=(g=n.requestProcessors)!=null?g:[dU,rA,wU,NU,MU,JU,cp,DU,RA,EU,WU],!n.requestProcessors&&n.contextCompactors&&n.contextCompactors.length>0){let _=this.requestProcessors.indexOf(cp);_!==-1?this.requestProcessors.splice(_,0,new bs(n.contextCompactors)):this.requestProcessors.push(new bs(n.contextCompactors))}if(this.responseProcessors=(h=n.responseProcessors)!=null?h:[OU],this.disallowTransferToParent&&this.disallowTransferToPeers&&!((y=this.subAgents)!=null&&y.length)||this.requestProcessors.push(cU),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.");n.generateContentConfig.thinkingConfig&&bu(this.planner)&&this.planner.thinkingConfig&&w.warn(`Agent ${this.name}: both generateContentConfig.thinkingConfig and planner.thinkingConfig are set. The planner's thinkingConfig takes precedence.`)}else this.generateContentConfig={};this.outputSchema&&((n.disallowTransferToParent===!1||n.disallowTransferToPeers===!1||(v=this.subAgents)!=null&&v.length)&&w.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(_I(this.model))return this.model;if(typeof this.model=="string"&&this.model)return Ur.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 xu(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 JA(r,n);o.push(...i)}return o}static normalizeCallbackArray(n){return n?Array.isArray(n)?n:[n]:[]}get canonicalBeforeModelCallbacks(){return yo.normalizeCallbackArray(this.beforeModelCallback)}get canonicalAfterModelCallbacks(){return yo.normalizeCallbackArray(this.afterModelCallback)}get canonicalBeforeToolCallbacks(){return yo.normalizeCallbackArray(this.beforeToolCallback)}get canonicalAfterToolCallbacks(){return yo.normalizeCallbackArray(this.afterToolCallback)}maybeSaveOutputToState(n){var i,s;if(n.author!==this.name){w.debug(`Skipping output save for agent ${this.name}: event authored by ${n.author}`);return}if(!this.outputKey){w.debug(`Skipping output save for agent ${this.name}: outputKey is not set`);return}if(!lr(n)){w.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)){w.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){w.error(`Error parsing output for agent ${this.name}`,c),n.actions.stateDelta[this.outputKey]=o;return}try{r=this.validateOutput(u)}catch(c){w.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 lu((o=this.outputSchemaSource)!=null?o:this.outputSchema,n)}async*runImpl(n,o){yield*kL(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||ce(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)&&Al(i.actions);if(lr(i)&&!(u&&s))break;if(i.partial){w.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;EQ(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(YU(x)&&n.liveSessionResumptionHandle){if(i+=1,i>KU)throw w.error(`Max live reconnection attempts reached (${i}).`,x),x;w.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,y=n.abortSignal?AbortSignal.any([n.abortSignal,h.signal]):h.signal,v=this.runSendLoop(d,n.liveRequestQueue,y,n.abortSignal);v.catch(x=>{w.error("Error in live send loop:",x),g=x,h.abort(x),d.close().catch(E=>{w.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 Mu||YU(x)))_=!0,w.info("Live connection closed; will reconnect with session handle.",x);else throw await this.teardownLiveConnection(h,d,v),x}if(await this.teardownLiveConnection(h,d,v),(l=n.abortSignal)!=null&&l.aborted)return;if(g)throw g;if(!_)return;if(i+=1,i>KU)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 Se({invocationContext:n}),c=(await JA(s,new xe(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){w.debug("Send failed after teardown:",u);return}throw w.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){w.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 w.info("Received goAway from live server; triggering reconnect."),new Mu("goAway");let d=p.inputTranscription||((c=p.content)==null?void 0:c.role)==="user"?"user":this.name,g=W({invocationId:n.invocationId,author:d,branch:n.branch});for await(let h of this.postprocessLive(n,r,p,g)){if(yield h,h.content&&ce(h).length>0&&await o.sendContent(h.content),ce(h).some(_=>_.name==="task_completed")){await XU(jU);return}let v=(l=h.actions)==null?void 0:l.transferToAgent;if(v){await XU(jU),i.abort(),await o.close();let x=Ke(n).rootAgent.findAgent(v);if(x){let E=n.agent;n.agent=x;let C=n.liveSessionResumptionHandle;n.liveSessionResumptionHandle=void 0;try{for await(let S of x.runLive(n))yield S}finally{n.agent=E,n.liveSessionResumptionHandle=C}}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 W({...i,liveSessionResumptionUpdate:r.liveSessionResumptionUpdate});return}if(r.inputTranscription){yield W({...i,inputTranscription:r.inputTranscription,partial:r.partial});return}if(r.outputTranscription){yield W({...i,outputTranscription:r.outputTranscription,partial:r.partial});return}let s=W({...i,...r}),u=le(s);if(s.content&&u.length&&(js(s),s.longRunningToolIds=Array.from(BT(u,o.toolsDict))),yield s,!u.length)return;let c=await gu({invocationContext:n,functionCallEvent:s,toolsDict:o.toolsDict,beforeToolCallbacks:this.canonicalBeforeToolCallbacks,afterToolCallbacks:this.canonicalAfterToolCallbacks});if(!c)return;let l=Of(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&&!Ss(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=W({invocationId:n.invocationId,author:this.name,branch:n.branch});for(let d of r){let g=new Se({invocationContext:n,eventActions:i.actions}),h=(await JA(d,new xe(n))).filter(y=>!o.allowedTools||o.allowedTools.includes(y.name)||y.name==="set_model_response");for(let y of h)if(await y.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=Oe.setSpan(Fe.active(),s);yield*cr(u,this,async function*(){let d=a(async function*(){var g,h;for await(let y of this.callLlmAsync(n,o,i)){if((g=n.abortSignal)!=null&&g.aborted)return;for await(let v of this.postprocess(n,o,y,i)){if((h=n.abortSignal)!=null&&h.aborted)return;i.id=dm(),i.timestamp=new Date().getTime(),yield v}}},"responsesGenerator");yield*this.runAndHandleError(d.call(this),n,o,i)}),s.end()}async*postprocess(n,o,r,i){var v,_,x,E,C,S;for(let T of this.responseProcessors)for await(let b of T.runAsync(n,r)){if((v=n.abortSignal)!=null&&v.aborted)return;yield b}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=W({...i,...r});if(u.content){let T=le(u),b=T.find(R=>R.name==="set_model_response");if(b){let R=b.args;u.content.parts=[{text:JSON.stringify(R)}],u.actions.skipSummarization=!0}else T&&T.length&&(js(u),u.longRunningToolIds=Array.from(BT(T,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 gu({invocationContext:n,functionCallEvent:u,toolsDict:o.toolsDict,beforeToolCallbacks:this.canonicalBeforeToolCallbacks,afterToolCallbacks:this.canonicalAfterToolCallbacks})}}catch(T){return{event:null,error:T}}finally{c.close()}})();for await(let T of c)yield T;let{event:p,error:d}=await l;if(n.eventQueue=void 0,d)throw d;if(!p||(C=n.abortSignal)!=null&&C.aborted)return;let g=Of(n,p);g&&(yield g);let h=qT({invocationContext:n,functionCallEvent:u,functionResponseEvent:p});if(h){yield h,n.endInvocation=!0;return}yield p;let y=p.actions.transferToAgent;if(y){let T=this.getAgentByName(n,y);for await(let b of T.runAsync(n)){if((S=n.abortSignal)!=null&&S.aborted)return;yield b}}}getAgentByName(n,o){let i=Ke(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,y;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[QU]||(o.config.labels[QU]=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 v=s.generateContentAsync(o,((g=n.runConfig)==null?void 0:g.streamingMode)==="sse",n.abortSignal);for await(let _ of v){if(qP({invocationContext:n,eventId:r.id,llmRequest:o,llmResponse:_}),(h=n.abortSignal)!=null&&h.aborted)return;let x=await this.handleAfterModelCallback(n,_,r);if((y=n.abortSignal)!=null&&y.aborted)return;yield x!=null?x:_}}}async handleBeforeModelCallback(n,o,r){var u,c;let i=new Se({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 Se({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 Se({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 W({invocationId:o.invocationId,author:this.name,errorCode:p,errorMessage:d}):yield{errorCode:p,errorMessage:d}}}else throw w.error("Unknown error during response generation",u),u}}};a(yo,"LlmAgent");var vp=yo;var nF=new Set;function Rs(t){return function(e){var r;let n=e.name,o=(r=class extends e{constructor(...s){nF.has(n)||(w.warn(t),nF.add(n)),super(...s)}},a(r,"wrapped"),r);return Object.defineProperty(o,"name",{value:n,configurable:!0}),o}}a(Rs,"deprecated");var jA=Symbol.for("google.adk.loopAgent");function SQ(t){return typeof t=="object"&&t!==null&&jA in t&&t[jA]===!0}a(SQ,"isLoopAgent");var rF,oF,vo=class extends(oF=$t,rF=jA,oF){constructor(n){var o;super(n);this[rF]=!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(vo,"LoopAgent"),vo=Pe([Rs("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.")],vo);var YA=Symbol.for("google.adk.parallelAgent");function CQ(t){return typeof t=="object"&&t!==null&&YA in t&&t[YA]===!0}a(CQ,"isParallelAgent");var iF,sF,_o=class extends(sF=$t,iF=YA,sF){constructor(){super(...arguments);this[iF]=!0}async*runAsyncImpl(n){var r;let o=this.subAgents.map(i=>i.runAsync(TQ(this,i,n)));for await(let i of IQ(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(_o,"ParallelAgent"),_o=Pe([Rs("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.")],_o);function TQ(t,e,n){let o=new Jt(n),r=`${t.name}.${e.name}`;return o.branch=o.branch?`${o.branch}.${r}`:r,o}a(TQ,"createBranchCtxForSubAgent");async function*IQ(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(IQ,"mergeAgentRuns");async function*ks(t,e,n,o){let r=await n(t,e);if(!r)throw new Error("Initial routing failed, no item selected.");let i=r;w.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(AQ(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(w.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(ks,"runWithRouting");function AQ(t){return typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function"}a(AQ,"isAsyncGenerator");var XA=Symbol.for("google.adk.routedAgent");function bQ(t){return typeof t=="object"&&t!==null&&XA in t&&t[XA]===!0}a(bQ,"isRoutedAgent");var aF,uF,eb=class eb extends(uF=$t,aF=XA,uF){constructor(n){let o=Array.isArray(n.agents)?n.agents:Object.values(n.agents);super({...n,subAgents:o});this[aF]=!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=wQ(this.config.agents)),super.clone(o)}async*runAsyncImpl(n){yield*ks(this.agents,n,this.router,o=>o.runAsync(n))}async*runLiveImpl(n){yield*ks(this.agents,n,this.router,o=>o.runLive(n))}};a(eb,"RoutedAgent");var QA=eb;function wQ(t){return Array.isArray(t)?t.map(e=>e.clone()):Object.fromEntries(Object.entries(t).map(([e,n])=>[e,n.clone()]))}a(wQ,"cloneRoutingTargets");var tb="task_completed",nb=Symbol.for("google.adk.sequentialAgent");function RQ(t){return typeof t=="object"&&t!==null&&nb in t&&t[nb]===!0}a(RQ,"isSequentialAgent");var lF,cF,xo=class extends(cF=$t,lF=nb,cF){constructor(){super(...arguments);this[lF]=!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 xe(n))).some(s=>s.name===tb)||(o.tools.push(new Dt({name:tb,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 ${tb} 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(xo,"SequentialAgent"),xo=Pe([Rs("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.")],xo);function kQ(t={}){return{isResumable:!1,...t}}a(kQ,"createResumabilityConfig");var rb=class rb{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=Ps(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=Ps(e,n,o,r),u=this.artifacts[s];return u?(i===void 0&&(i=u.length-1),u[i]?Promise.resolve(u[i].part):(w.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=_p("session",e,n,o),i=_p("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=Ps(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=Ps(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=Ps(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=Ps(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(rb,"InMemoryArtifactService");var Lu=rb;function Ps(t,e,n,o){return PQ(o)?`${_p("user",t,e)}${encodeURIComponent(o)}`:`${_p("session",t,e,n)}${encodeURIComponent(o)}`}a(Ps,"artifactPath");function _p(t,...e){return`${[t,...e].map(encodeURIComponent).join("/")}/`}a(_p,"artifactPrefix");function PQ(t){return t.startsWith("user:")}a(PQ,"fileHasUserNamespace");var NQ=Symbol.for("google.adk.sessionArtifactService"),dF;dF=NQ;var ob=class ob{constructor(e,n,o,r){this.delegate=e;this.appName=n;this.userId=o;this.sessionId=r;this[dF]=!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(ob,"ScopedArtifactService");var Ns=ob;var fF=Symbol.for("google.adk.sessionArtifactService");function xp(t){return typeof t=="object"&&t!==null&&fF in t&&t[fF]===!0}a(xp,"isSessionArtifactService");var sb=class sb{constructor(){this.providers=new Map}register(e,n){this.providers.set(e,n)}getProvider(e){return this.providers.get(e.type)}};a(sb,"AuthProviderRegistry");var ib=sb;var ub=class ub{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(ub,"InMemoryCredentialService");var ab=ub;var cb=class cb{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(cb,"SessionStateCredentialService");var lb=cb;var fb=class fb{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(fb,"CredentialRefresherRegistry");var db=fb;var mb=class mb{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=ho(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 y;return((y=h.functionCall)==null?void 0:y.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(W({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(mb,"AgentControlledContextCompactor");var pb=mb;var hb=class hb{constructor(e){this.tokenThreshold=e.tokenThreshold,this.eventRetentionSize=e.eventRetentionSize,this.summarizer=e.summarizer}getActiveEvents(e,n){let o=e.filter(s=>Kt(s,n)),r;for(let s=o.length-1;s>=0;s--){let u=o[s];if(Ts(u)){r=u;break}}if(!r)return o;let i=o.filter(s=>s.timestamp>r.endTime&&!Ts(s));return[r,...i]}shouldCompact(e){let n=e.session.events,o=this.getActiveEvents(n,e.isolationScope),i=o.length>0&&Ts(o[0])?o.slice(1):o;return i.length<=this.eventRetentionSize||Is(i,this.eventRetentionSize)===0?!1:o.reduce((c,l)=>c+NP(l),0)>this.tokenThreshold}async compact(e){let n=e.session.events,o=this.getActiveEvents(n,e.isolationScope),r=o.length>0&&Ts(o[0]),i=r?o.slice(1):o;if(i.length<=this.eventRetentionSize)return;let s=Is(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)]),y=n.findIndex(x=>h.has(x)),v=[],_=!1;for(let x=0;x<n.length;x++){let E=n[x];x===y&&(v.push(d),_=!0),h.has(E)||v.push(E)}_||v.push(d),n.length=0,n.push(...v)}};a(hb,"AnchoredContextCompactor");var gb=hb;var $Q="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.",vb=class vb{constructor(e){this.llm=e.llm,this.prompt=e.prompt||$Q}async summarize(e){var p,d,g,h,y,v;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}]
|
|
171
|
+
`,r+=`${bl(e[_])}
|
|
172
|
+
|
|
173
|
+
`;let s={contents:[{role:"user",parts:[{text:`${this.prompt}
|
|
174
|
+
|
|
175
|
+
${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)(v=(y=(h=_.content)==null?void 0:h.parts)==null?void 0:y[0])!=null&&v.text&&(c+=_.content.parts[0].text);return SU({author:"system",content:{role:"model",parts:[{text:c}]},startTime:n,endTime:o,compactedContent:c})}};a(vb,"LlmSummarizer");var yb=vb;var DQ=4,xb=class xb{constructor(e){this.tokenThreshold=e.tokenThreshold,this.eventRetentionSize=e.eventRetentionSize,this.summarizer=e.summarizer}shouldCompact(e){let n=e.session.events,o=ho(n,e.isolationScope),r=o.filter(u=>!dn(u));if(r.length<=this.eventRetentionSize||Is(r,this.eventRetentionSize)===0)return!1;let s=OQ(o,e);return s===void 0?!1:s>this.tokenThreshold}async compact(e){var p;let n=e.session.events,o=ho(n,e.isolationScope),r=o.filter(d=>!dn(d));if(r.length<=this.eventRetentionSize)return;let i=Is(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(xb,"TokenBasedContextCompactor");var _b=xb;function OQ(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 MQ(t,e)}a(OQ,"latestPromptTokenCount");function MQ(t,e){var r;let n=$u(t,Ke(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/DQ)}a(MQ,"estimatePromptTokenCount");var Sb=class Sb{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)=>Kt(i,e.isolationScope)?[s]:[]);return o.length<=this.eventRetentionSize?!1:o.slice(0,o.length-this.eventRetentionSize).map(i=>n[i]).some(i=>wl(i))}compact(e){let n=e.session.events,o=n.flatMap((i,s)=>Kt(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];wl(s)&&(n[i]=cm(s))}}};a(Sb,"TrajectoryThoughtPruningCompactor");var Eb=Sb;var Tb=class Tb{constructor(e){var n;this.threshold=e.threshold,this.preserveLeadingEvents=(n=e.preserveLeadingEvents)!=null?n:0}shouldCompact(e){return e.session.events.filter(o=>Kt(o,e.isolationScope)).length>this.threshold+Math.max(0,this.preserveLeadingEvents)}compact(e){let n=e.session.events,o=n.flatMap((u,c)=>Kt(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(Tb,"TruncatingContextCompactor");var Cb=Tb;var Eo=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(Eo,"BaseEnvironment"),Eo=Pe([tt],Eo);var Ab=class Ab extends Error{constructor(e="The resource already exists."){super(e),this.name="AlreadyExistsError"}};a(Ab,"AlreadyExistsError");var Ib=Ab;var wb=class wb extends Error{constructor(e="Invalid input."){super(e),this.name="InputValidationError"}};a(wb,"InputValidationError");var bb=wb;var kb=class kb extends Error{constructor(e="The requested item was not found."){super(e),this.name="NotFoundError"}};a(kb,"NotFoundError");var Rb=kb;var Nb=class Nb extends Error{constructor(e="Session not found."){super(e),this.name="SessionNotFoundError"}};a(Nb,"SessionNotFoundError");var Pb=Nb;var pF=(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))(pF||{}),Db=class Db extends Error{constructor(n,o){super(n);this.errorType=o;this.name="ToolExecutionError"}};a(Db,"ToolExecutionError");var $b=Db;var mF=(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))(mF||{});function LQ(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}),lr(t)&&e.push({type:"finished",output:void 0}),e}a(LQ,"toStructuredEvents");var Ob=Symbol.for("google.adk.baseExampleProvider");function Mb(t){return typeof t=="object"&&t!==null&&Ob in t&&t[Ob]===!0}a(Mb,"isBaseExampleProvider");var gF;gF=Ob;var Lb=class Lb{constructor(){this[gF]=!0}};a(Lb,"BaseExampleProvider");var Uu=Lb;var UQ=.5,FQ=10,Fb=class Fb extends Uu{constructor(n,o){super();this.examplesStoreName=n;this.apiClient=o}async getExamples(n){var s,u,c,l,p,d,g,h,y;let o={storedContentsExampleParameters:{contentSearchKey:{contents:[{role:"user",parts:[{text:n}]}],searchKeyGenerationMethod:{lastEntry:{}}}},topK:FQ,exampleStore:this.examplesStoreName},r=await this.apiClient.searchExamples(o),i=[];for(let v of(s=r.results)!=null?s:[]){if(((u=v.similarityScore)!=null?u:0)<UQ)continue;let _=(c=v.example)==null?void 0:c.storedContentsExample,x=((p=(l=_==null?void 0:_.contentsExample)==null?void 0:l.expectedContents)!=null?p:[]).map(C=>C.content).filter(C=>C!==void 0),E=[];for(let C of x){let S=[];for(let T of(d=C.parts)!=null?d:[])T.text?S.push({text:T.text}):T.functionCall?S.push({functionCall:{name:T.functionCall.name,args:{...(g=T.functionCall.args)!=null?g:{}}}}):T.functionResponse&&S.push({functionResponse:{name:T.functionResponse.name,response:{...(h=T.functionResponse.response)!=null?h:{}}}});E.push({role:C.role,parts:S})}i.push({input:{role:"user",parts:[{text:(y=_==null?void 0:_.searchKey)!=null?y:""}]},output:E})}return i}};a(Fb,"VertexAiExampleStore");var Ub=Fb;var zb=class zb{constructor(){this.memories=[];this.sessionEvents=Object.create(null)}async addSessionToMemory(e){let n=hF(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=hF(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=zQ(l);if(!p.size)continue;o.some(g=>p.has(g))&&r.memories.push({content:c.content,author:c.author,timestamp:GQ(c.timestamp)})}return r}};a(zb,"InMemoryMemoryService");var So=zb;function hF(t,e){return`${t}/${e}`}a(hF,"getUserKey");function zQ(t){return new Set([...t.matchAll(/[A-Za-z]+/g)].map(e=>e[0].toLowerCase()))}a(zQ,"extractWordsLower");function GQ(t){return new Date(t).toISOString()}a(GQ,"formatTimestamp");var Bb=class Bb 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){w.info(`Routing request via ${this.model}`),yield*ks(this.models,e,this.router,o=>o.generateContentAsync(e,n))}async connect(e){let o=await ks(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(Bb,"RoutedLlm");var Gb=Bb;var vF="/*PLANNING*/",_F="/*REPLANNING*/",xF="/*REASONING*/",EF="/*ACTION*/",qb="/*FINAL_ANSWER*/",BQ=[vF,xF,EF,_F],Zb=class Zb extends fo{buildPlanningInstruction(e,n){return ZQ()}processPlanningResponse(e,n){if(!n||n.length===0)return;let o=[],r=-1;for(let i=0;i<n.length;i++){let s=n[i];if(s.functionCall){if(!s.functionCall.name)continue;o.push(s),r=i;break}VQ(s,o)}if(r>0)for(let i=r+1;i<n.length&&n[i].functionCall;i++)o.push(n[i]);return o}};a(Zb,"PlanReActPlanner");var Vb=Zb;function qQ(t,e){let n=t.lastIndexOf(e);if(n===-1)return[t,""];let o=n+e.length;return[t.slice(0,o),t.slice(o)]}a(qQ,"splitByLastPattern");function VQ(t,e){var o;if(t.text&&t.text.includes(qb)){let[r,i]=qQ(t.text,qb);r&&e.push(yF({text:r})),i&&e.push({text:i});return}let n=(o=t.text)!=null?o:"";if(n&&BQ.some(r=>n.startsWith(r))){e.push(yF(t));return}e.push(t)}a(VQ,"handleNonFunctionCallPart");function yF(t){return t.text?{...t,thought:!0}:t}a(yF,"markAsThought");function ZQ(){let t=`
|
|
176
|
+
When answering the question, try to leverage the available tools to gather the information instead of your memorized knowledge.
|
|
177
|
+
|
|
178
|
+
Follow this process when answering the question: (1) first come up with a plan in natural language text format; (2) Then use tools to execute the plan and provide reasoning between tool code snippets to make a summary of current state and next step. Tool code snippets and reasoning should be interleaved with each other. (3) In the end, return one final answer.
|
|
179
|
+
|
|
180
|
+
Follow this format when answering the question: (1) The planning part should be under ${vF}. (2) The tool code snippets should be under ${EF}, and the reasoning parts should be under ${xF}. (3) The final answer part should be under ${qb}.
|
|
181
|
+
`,e=`
|
|
182
|
+
Below are the requirements for the planning:
|
|
183
|
+
The plan is made to answer the user query if following the plan. The plan is coherent and covers all aspects of information from user query, and only involves the tools that are accessible by the agent. The plan contains the decomposed steps as a numbered list where each step should use one or multiple available tools. By reading the plan, you can intuitively know which tools to trigger or what actions to take.
|
|
184
|
+
If the initial plan cannot be successfully executed, you should learn from previous execution results and revise your plan. The revised plan should be be under ${_F}. Then use tools to follow the new plan.
|
|
185
|
+
`;return[t,e,`
|
|
186
|
+
Below are the requirements for the reasoning:
|
|
187
|
+
The reasoning makes a summary of the current trajectory based on the user query and tool outputs. Based on the tool outputs and plan, the reasoning also comes up with instructions to the next steps, making the trajectory closer to the final answer.
|
|
188
|
+
`,`
|
|
189
|
+
Below are the requirements for the final answer:
|
|
190
|
+
The final answer should be precise and follow query formatting requirements. Some queries may not be answerable with the available tools and information. In those cases, inform the user why you cannot process their query and ask for more information.
|
|
191
|
+
`,`
|
|
192
|
+
Below are the requirements for the tool code:
|
|
193
|
+
|
|
194
|
+
**Custom Tools:** The available tools are described in the context and can be directly used.
|
|
195
|
+
- Code must be valid self-contained Python snippets with no imports and no references to tools or Python libraries that are not in the context.
|
|
196
|
+
- You cannot use any parameters or fields that are not explicitly defined in the APIs in the context.
|
|
197
|
+
- The code snippets should be readable, efficient, and directly relevant to the user query and reasoning steps.
|
|
198
|
+
- When using the tools, you should use the library name together with the function name, e.g., vertex_search.search().
|
|
199
|
+
- If Python libraries are not provided in the context, NEVER write your own code other than the function calls using the provided tools.
|
|
200
|
+
`,`
|
|
201
|
+
VERY IMPORTANT instruction that you MUST follow in addition to the above instructions:
|
|
202
|
+
|
|
203
|
+
You should ask for clarification if you need more information to answer the question.
|
|
204
|
+
You should prefer using the information available in the context instead of repeated tool use.
|
|
205
|
+
`].join(`
|
|
206
|
+
|
|
207
|
+
`)}a(ZQ,"buildNlPlannerInstruction");var To="ERROR_HANDLED_BY_REFLECT_AND_RETRY_PLUGIN",SF="__global_reflect_and_retry_scope__",Ep=(n=>(n.INVOCATION="invocation",n.GLOBAL="global",n))(Ep||{});function Fu(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 SF;throw new Error(`Unknown scope: ${t}`)}a(Fu,"resolveScopeKey");var Hb=class Hb{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(Hb,"ScopedFailureTracker");var Co=Hb;var Wb=class Wb extends Mt{constructor(e,n="global_instruction"){super(n),this.globalInstruction=e}async beforeModelCallback(e){if(!this.globalInstruction)return;let n=new xe(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}
|
|
208
|
+
|
|
209
|
+
${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 Du(this.globalInstruction,e):await this.globalInstruction(e)}};a(Wb,"GlobalInstructionPlugin");var Jb=Wb;var jb=class jb extends Mt{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: ${lr(e)}`);let n=le(e);if(n.length>0){let r=n.map(i=>i.name);this.log(` Function Calls: ${r}`)}let o=ce(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`;w.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(jb,"LoggingPlugin");var Kb=jb;var Yb=class Yb{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),w.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 w.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 w.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(Yb,"PluginManager");var zu=Yb;var Ye=[];for(let t=0;t<256;++t)Ye.push((t+256).toString(16).slice(1));function CF(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(CF,"unsafeStringify");var Xb,HQ=new Uint8Array(16);function Qb(){if(!Xb){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Xb=crypto.getRandomValues.bind(crypto)}return Xb(HQ)}a(Qb,"rng");var JQ=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ew={randomUUID:JQ};function WQ(t,e,n){var r,i,s;if(ew.randomUUID&&!e&&!t)return ew.randomUUID();t=t||{};let o=(s=(i=t.random)!=null?i:(r=t.rng)==null?void 0:r.call(t))!=null?s:Qb();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 CF(o)}a(WQ,"v4");var tw=WQ;var nw="RESERVED_TOOL_CALL",Io="adk_handle_model_error",ow=class ow extends Mt{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 Co}adkHandleModelError({retryCount:e}){return{reflection_guidance:`
|
|
210
|
+
The call to the model failed.
|
|
211
|
+
|
|
212
|
+
**Reflection Guidance:**
|
|
213
|
+
- This is retry attempt **${e!=null?e:1}** of **${this.maxRetries}**
|
|
214
|
+
- Analyze the error and the arguments you provided. Do not repeat the exact same call.
|
|
215
|
+
|
|
216
|
+
Formulate a new plan based on your analysis and try a corrected or different approach.
|
|
217
|
+
`.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[Io]=new Dt({name:Io,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===Io)return!0;return!1}async handleReservedToolCall(e,n){let o=await this.handleModelRetry(e,nw,`Model attempted to call reserved tool ${Io} directly. This tool is reserved for framework use only. Do not call it.`,gn.OTHER);return o!==void 0?o:{errorCode:nw,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:Io,args:{response_type:To,error_type:n,error_details:o,finish_reason:r,retry_count:e}}}}getModelRetryUuid(){return`${Io}_${tw()}`}getModelScopeKey(e){return Fu(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(ow,"ReflectAndRetryModelPlugin");var rw=ow;var sw=class sw extends Mt{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 Co}async afterToolCallback({tool:e,toolArgs:n,toolContext:o,result:r}){if(r&&typeof r=="object"&&r.response_type===To)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 Fu(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=`
|
|
218
|
+
The call to tool \`${e.name}\` failed.
|
|
219
|
+
|
|
220
|
+
**Error Details:**
|
|
221
|
+
\`\`\`
|
|
222
|
+
${s}
|
|
223
|
+
\`\`\`
|
|
224
|
+
|
|
225
|
+
**Tool Arguments Used:**
|
|
226
|
+
\`\`\`json
|
|
227
|
+
${i}
|
|
228
|
+
\`\`\`
|
|
229
|
+
|
|
230
|
+
**Reflection Guidance:**
|
|
231
|
+
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:
|
|
232
|
+
|
|
233
|
+
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.
|
|
234
|
+
2. **State or Preconditions**: Did a previous step fail or not produce the necessary state/resource for this tool to succeed?
|
|
235
|
+
3. **Alternative Approach**: Is this the right tool for the job? Could another tool or a different sequence of steps achieve the goal?
|
|
236
|
+
4. **Simplify the Task**: Can you break the problem down into smaller, simpler steps?
|
|
237
|
+
5. **Wrong Function Name**: Does the error indicates the tool is not found? Please check again and only use available tools.
|
|
238
|
+
|
|
239
|
+
Formulate a new plan based on your analysis and try a corrected or different approach.
|
|
240
|
+
`.trim();return{response_type:To,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=`
|
|
241
|
+
The tool \`${e.name}\` has failed consecutively ${this.maxRetries} times and the retry limit has been exceeded.
|
|
242
|
+
|
|
243
|
+
**Last Error:**
|
|
244
|
+
\`\`\`
|
|
245
|
+
${r}
|
|
246
|
+
\`\`\`
|
|
247
|
+
|
|
248
|
+
**Last Arguments Used:**
|
|
249
|
+
\`\`\`json
|
|
250
|
+
${i}
|
|
251
|
+
\`\`\`
|
|
252
|
+
|
|
253
|
+
**Final Instruction:**
|
|
254
|
+
**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.
|
|
255
|
+
`.trim();return{response_type:To,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(sw,"ReflectAndRetryToolPlugin");var iw=sw;var aw="orcas_tool_call_security_check_states",TF="This tool call needs external confirmation before completion.",IF=(o=>(o.DENY="DENY",o.CONFIRM="CONFIRM",o.ALLOW="ALLOW",o))(IF||{}),lw=class lw{async evaluate(e){return Promise.resolve({outcome:"ALLOW",reason:"For prototyping purpose, all tool calls are allowed."})}};a(lw,"InMemoryPolicyEngine");var Sp=lw,cw=class cw extends Mt{constructor(e){var n;super("security_plugin"),this.policyEngine=(n=e==null?void 0:e.policyEngine)!=null?n:new Sp}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:TF};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(aw))!=null?r:{})[n]:void 0}setToolCallCheckState(e,n){var i;let{functionCallId:o}=e;if(!o)return;let r=(i=e.state.get(aw))!=null?i:{};r[o]=n,e.state.set(aw,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:TF};case"ALLOW":return;default:return}}};a(cw,"SecurityPlugin");var uw=cw;function KQ(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(KQ,"getAskUserConfirmationFunctionCalls");var fw=class fw{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=jQ(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)||bP(e.state,n.actions.stateDelta,o)&&Object.defineProperty(e.state,o,{value:r,writable:!0,enumerable:!0,configurable:!0})}};a(fw,"BaseSessionService");var Gu=fw;function jQ(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 Il(e,n),t.actions.stateDelta=n,t}a(jQ,"trimTempDeltaState");function AF(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(AF,"trimTempState");function dw(t={},e={},n={}){let o=Ge(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(dw,"mergeStates");function Cp(t){return{id:t.id,appName:t.appName,userId:t.userId||"",state:t.state||{},events:t.events||[],lastUpdateTime:t.lastUpdateTime||0}}a(Cp,"createSession");var pw=class pw extends Gu{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?AF(r):void 0,u=Cp({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=Ge(u);return c.state=dw(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=Ge(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=dw(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=>Cp({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,y;s!==void 0?(h=(s-1)*r,y=s):(h=i!=null?i:0,y=r===0?1:Math.floor(h/r)+1);let v=p.slice(h,h+r);return Promise.resolve({sessions:v,page:y,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=>{w.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(pw,"InMemorySessionService");var Ao=pw;var mw=Symbol.for("google.adk.baseToolset");function gw(t){return typeof t=="object"&&t!==null&&mw in t&&t[mw]===!0}a(gw,"isBaseToolset");var bF;bF=mw;var hw=class hw{constructor(e,n){this.toolFilter=e;this.prefix=n;this[bF]=!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(hw,"BaseToolset");var Bu=hw;function wF(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(wF,"stringifyWithRedactedInlineData");var yw=class yw{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=FU(ws((d=(p=e.session)==null?void 0:p.events)!=null?d:[],e.invocationId)).get(u);if(g&&gp(g))return this.completeWithoutRunning(e,{nodePath:u,runId:s,options:r},hp(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=Dr({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(fs(p)||If(p))throw p;c.state.status=5;let d=p instanceof Error?p:new Error(String(p));throw new vf({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(yw,"DynamicNodeScheduler");var Tp=yw;function YQ(t){return/^-?\d+$/.test(t)?Number(t):t==="true"||t==="false"?t==="true":t}a(YQ,"normalizeRouteKey");function XQ(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=YQ(r),s=e[r];if(Array.isArray(s)){for(let u of s)if(!Su(u))throw new Error(`Invalid node in fan-out tuple for route ${String(r)}.`)}else if(!Su(s))throw new Error(`Invalid routing map value for route ${String(r)}.`);o.push([t,s,i])}return o}a(XQ,"expandRoutingMap");function QQ(t){let e=[];for(let n of Object.values(t))Array.isArray(n)?e.push(...n):e.push(n);return e}a(QQ,"nodesFromRoutingMap");function Ip(t){return Zf(t)?QQ(t):Array.isArray(t)?[...t]:[t]}a(Ip,"flattenElement");function $s(t,e){if(t==="START")return Wt("START");if(typeof t=="object"||typeof t=="function"){let n=e.get(t);if(n)return n;let o=Wt(t);return e.set(t,o),o}return Wt(t)}a($s,"getOrBuildNode");function e8({edge:t,nodeMap:e,out:n}){n.push(new Fr($s(t.fromNode,e),$s(t.toNode,e),t.route))}a(e8,"processExplicitEdge");function t8({fromEl:t,toEl:e,nodeMap:n,out:o}){if(Zf(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 XQ(t,e))for(let u of Ip(r))for(let c of Ip(i))o.push(new Fr($s(u,n),$s(c,n),s))}a(t8,"processRoutingMapEdge");function n8({fromEl:t,toEl:e,nodeMap:n,out:o}){for(let r of Ip(t))for(let i of Ip(e))o.push(new Fr($s(r,n),$s(i,n),null))}a(n8,"processUnconditionalEdge");function r8({chain:t,nodeMap:e,out:n}){for(let o=0;o<t.length-1;o++){let r=t[o],i=t[o+1];Zf(i)?t8({fromEl:r,toEl:i,nodeMap:e,out:n}):n8({fromEl:r,toEl:i,nodeMap:e,out:n})}}a(r8,"processChain");function RF(t){let e=new Map,n=[];for(let o of t)if(kF(o))e8({edge:o,nodeMap:e,out:n});else if(Array.isArray(o))r8({chain:o,nodeMap:e,out:n});else throw new Error(`Invalid edge item type: ${typeof o}`);return n}a(RF,"parseEdgeItems");function o8(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(o8,"validateDuplicateNodeNames");function i8(t){if(!t.has(ln.name))throw new Error(`Graph validation failed. START node (name: '${ln.name}') not found in graph nodes.`)}a(i8,"validateStartNode");function s8(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(s8,"validateStartEdges");function a8(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(a8,"validateConnectivity");function u8(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(u8,"validateDuplicateEdges");function l8(t){let e=new Map;for(let n of t){if(Array.isArray(n.route)&&n.route.includes(Ds))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===Ds){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(l8,"validateDefaultRoutes");function c8(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(c8,"detectUnconditionalCycles");function d8(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(d8,"computeTerminalNodes");function PF(t,e){let n=o8(t);return i8(n),s8(e),a8(e,n),u8(e),l8(e),c8(e,n),d8(t,e)}a(PF,"validateGraph");var vw=Symbol.for("google.adk.workflow.edge"),Ds="__DEFAULT__",NF;NF=vw;var _w=class _w{constructor(e,n,o=null){this.fromNode=e;this.toNode=n;this.route=o;this[NF]=!0}};a(_w,"Edge");var Fr=_w;function kF(t){return typeof t=="object"&&t!==null&&vw in t&&t[vw]===!0}a(kF,"isEdge");var xw=class xw{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===Ds){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(", ");w.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=PF(this.nodes,this.edges)}};a(xw,"Graph");var qu=xw;function $F(t){let e=new qu(RF(t));return e.validate(),e}a($F,"createGraphFromEdgeItems");var Ew=class Ew{constructor(){this.runs=new Map;this.interruptIds=new Set}getDynamicTasks(){return[...this.runs.values()].map(e=>e.task).filter(e=>e!==void 0)}};a(Ew,"DynamicNodeState");var Ap=Ew;var Sw=Symbol.for("google.adk.workflow.workflow"),Tw=class Tw{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(Tw,"LoopState");var Cw=Tw,DF,OF,wn=class extends(OF=ze,DF=Sw,OF){constructor(n){var r;super({...n,rerunOnResume:(r=n.rerunOnResume)!=null?r:!0});this[DF]=!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=$F(n.edges))}async*runImpl(n,o){let r=new Ap,i=f8(n.invocationContext.abortSignal);n.scheduler=new Tp(r,i.controller.signal);let s=Ze.startSpan(`invoke_workflow ${this.name}`);try{await Fe.with(Oe.setSpan(Fe.active(),s),()=>(zP({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=ws((p=(l=n.session)==null?void 0:l.events)!=null?p:[],n.invocationId),u=GU(s,n.nodePath||void 0);if(this.applyResumeInputs(n,s),this.dynamicEntry){await this.runDynamicEntry(n,o,r);return}let c=new Cw;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 zA(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;Af(i)||(s=n.abortSignal)!=null&&s.aborted||qf(i,o.invocationId)&&o.emit(Vf({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 y,v;let s=this.getStaticNode(r),u=n.nodes.get(r),c=n.activated.has(r);n.activated.add(r);let l=(y=n.rehydrated.get(r))==null?void 0:y.shift();if(l&&gp(l)){n.pending.set(r,Promise.resolve({name:r,childCtx:hp(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:(v=l.branch)!=null?v: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=Dr({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 y;return((y=n.nodes.get(h))==null?void 0:y.status)===3})){let h={};for(let _ of d)h[_]=n.nodeOutputs.get(_);let y=[...d].map(_=>{var x;return(x=n.nodeBranches.get(_))!=null?x:""}),v=Gf(y);this.pushTrigger(n,l,{input:h,useSubBranch:!1,branch:v||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(wn,"Workflow"),wn=Pe([tt],wn);function bp(t){return typeof t=="object"&&t!==null&&Sw in t&&t[Sw]===!0}a(bp,"isWorkflow");function f8(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(f8,"createWorkflowAbort");async function*Iw(t,e,n={}){var g;let o=(g=n.author)!=null?g:t.name,r=new cn,i=new Tn({invocationContext:e,channel:r,nodePath:"",runId:o,resumeInputs:p8(e)}),s=m8(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 W({author:o,invocationId:e.invocationId,branch:e.branch,content:_u(i.output),output:i.output}))}a(Iw,"runNodeAsInvocation");function p8(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=ws((p=(l=t.session)==null?void 0:l.events)!=null?p:[],t.invocationId);for(let d of UU(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(p8,"resumeInputsFromPlainText");function m8(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(m8,"extractNodeInput");function Aw(t){return Kn(t)||bp(t)}a(Aw,"isRunnableRoot");function Os(t){var o,r;if(Aw(t))return t;let e=t;if(!Su(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=Wt(e);return new wn({name:n.name,description:n.description,edges:[["START",n]]})}a(Os,"asRunnableRoot");var bw=Symbol.for("google.adk.runner");function g8(t){return typeof t=="object"&&t!==null&&bw in t&&t[bw]===!0}a(g8,"isRunner");var LF;LF=bw;var Rw=class Rw{constructor(e){this[LF]=!0;var s,u,c,l,p,d,g,h,y;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=Os(o);let r=(d=(p=e.app)==null?void 0:p.plugins)!=null?d:[],i=(g=e.plugins)!=null?g:[];this.pluginManager=new zu([...r,...i]),this.artifactService=e.artifactService,this.sessionService=e.sessionService,this.memoryService=e.memoryService,this.credentialService=e.credentialService,this.resumabilityConfig=(y=(h=e.app)==null?void 0:h.resumabilityConfig)!=null?y: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=HA(e.runConfig),s=e.newMessage;s&&!s.role&&(s.role="user"),v8(s);let u=Ze.startSpan("invocation"),c=Oe.setSpan(Fe.active(),u);try{yield*cr(c,this,async function*(){var g,h,y,v,_,x,E,C,S,T,b;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 R=this.agent.canonicalModel.model;if(!Qn(R))throw new Error(`CFC is not supported for model: ${R} in agent: ${this.agent.name}`);Pu(this.agent.codeExecutor)||(this.agent.codeExecutor=new ku)}let p=new Jt({artifactService:this.artifactService?xp(this.artifactService)?this.artifactService:new Ns(this.artifactService,this.appName,n,o):void 0,sessionService:this.sessionService,memoryService:this.memoryService,credentialService:this.credentialService,invocationId:MT(),agent:Kn(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(!((y=s.parts)!=null&&y.length))throw new Error("No parts in the newMessage.");if(i.saveInputBlobsAsArtifacts&&(s=await this.saveArtifacts(p.artifactService,p.invocationId,s),(v=e.abortSignal)!=null&&v.aborted)||(await this.sessionService.appendEvent({session:l,event:W({invocationId:p.invocationId,author:"user",actions:r?Ft({stateDelta:r}):void 0,content:s,customMetadata:e.customMetadata})}),(_=e.abortSignal)!=null&&_.aborted))return}if(Kn(this.agent)&&(p.agent=this.determineAgentForResumption(l,this.agent)),s){let R=await this.pluginManager.runBeforeRunCallback({invocationContext:p});if((x=e.abortSignal)!=null&&x.aborted)return;if(R){let B=W({invocationId:p.invocationId,author:"model",content:R});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((C=e.abortSignal)!=null&&C.aborted)return;let P=await this.pluginManager.runOnEventCallback({invocationContext:p,event:B}),V=P?{...P,id:B.id,invocationId:B.invocationId,timestamp:B.timestamp,author:P.author||B.author,branch:(S=P.branch)!=null?S:B.branch}:B;if(B.partial||await this.sessionService.appendEvent({session:l,event:V}),(T=e.abortSignal)!=null&&T.aborted)return;yield V}if(await this.pluginManager.runAfterRunCallback({invocationContext:p}),(b=e.abortSignal)!=null&&b.aborted)return}}}})}finally{u.end();let l=Kn(this.agent)?y8(this.agent):[];await Promise.allSettled(l.map(p=>p.close()))}}async*runRoot(e){if(Kn(this.agent)){yield*Ke(e).runAsync(e);return}yield*Iw(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(ai(`[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){w.warn(`Failed to resolve artifact version for ${p}:`,g)}i=!0,w.info(`Successfully saved artifact: ${p}`)}catch(l){w.error(`Failed to save artifact for part ${u}:`,l),r.push(c)}}return i?{...o,parts:r}:o}determineAgentForResumption(e,n){return UF(e,n,this.resumabilityConfig)}isRoutableLlmAgent(e){return ww(e)}async*runLive(e){var s,u,c,l;if(!e.liveRequestQueue)throw new Error("liveRequestQueue is required for runLive.");if(!Kn(this.agent))throw new Error("runLive is only supported for agents.");let n=this.agent,o=HA(e.runConfig);(s=o.responseModalities)!=null&&s.length||(o.responseModalities=[Zr.AUDIO]),(u=n.subAgents)!=null&&u.length&&(o.responseModalities.includes(Zr.AUDIO)&&((c=o.outputAudioTranscription)!=null||(o.outputAudioTranscription={})),(l=o.inputAudioTranscription)!=null||(o.inputAudioTranscription={}));let r=Ze.startSpan("invocation"),i=Oe.setSpan(Fe.active(),r);try{yield*cr(i,this,async function*(){var h,y,v,_;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?xp(this.artifactService)?this.artifactService:new Ns(this.artifactService,this.appName,e.userId,e.sessionId):void 0,sessionService:this.sessionService,memoryService:this.memoryService,credentialService:this.credentialService,invocationId:MT(),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(!((y=e.abortSignal)!=null&&y.aborted)){if(g){let x=W({invocationId:d.invocationId,author:"model",content:g});await this.sessionService.appendEvent({session:p,event:x}),yield x;return}for await(let x of Ke(d).runLive(d)){if((v=e.abortSignal)!=null&&v.aborted)return;let E=await this.pluginManager.runOnEventCallback({invocationContext:d,event:x});if((_=e.abortSignal)!=null&&_.aborted)return;let C=E!=null?E:x;!C.partial&&!h8(C)&&await this.sessionService.appendEvent({session:p,event:C}),yield C}await this.pluginManager.runAfterRunCallback({invocationContext:d})}})}finally{r.end()}}};a(Rw,"Runner");var bo=Rw;function h8(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(h8,"isLiveModelMediaEventWithInlineData");function UF(t,e,n){let o=FF(t.events),r=!!(n!=null&&n.isResumable);if(o&&o.author&&r){let i=XM(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;MF(o)||w.warn(`Function response from an unknown agent: ${o.author}, event id: ${o.id}`)}for(let i=t.events.length-1;i>=0;i--){w.debug("event:",wF(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){MF(s)||w.warn(`Event from an unknown agent: ${s.author}, event id: ${s.id}`);continue}if(ww(u))return u}return e}a(UF,"determineAgentForResumption");function MF(t){var e;return!!((e=t.nodeInfo)!=null&&e.path)}a(MF,"isWorkflowNodeEvent");function ww(t){let e=t;for(;e;){if(!te(e)||e.disallowTransferToParent)return!1;e=e.parentAgent}return!0}a(ww,"isRoutableLlmAgent");function FF(t){var e;return(e=VT(t))!=null?e:null}a(FF,"findEventByLastFunctionResponseId");function y8(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)gw(i)&&e.push(i);for(let i of r.subAgents)o(i)}}return a(o,"traverse"),o(t),e}a(y8,"getAllToolsets");function v8(t){let e=zT(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(v8,"rejectReservedFunctionCalls");var Pw=class Pw extends bo{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 Lu,sessionService:new Ao,memoryService:new So,resumabilityConfig:(u=i==null?void 0:i.resumabilityConfig)!=null?u:s})}};a(Pw,"InMemoryRunner");var kw=Pw;var _8=Symbol.for("google.adk.sessionArtifactService"),zF;zF=_8;var Nw=class Nw{constructor(e){this.toolContext=e;this[zF]=!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(Nw,"ForwardingArtifactService");var Vu=Nw;var $w=Symbol.for("google.adk.agentTool");function x8(t){return typeof t=="object"&&t!==null&&$w in t&&t[$w]===!0}a(x8,"isAgentTool");var GF,BF,Ow=class Ow extends(BF=oe,GF=$w,BF){constructor(n){super({name:n.agent.name,description:n.agent.description||""});this[GF]=!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:H.OBJECT,properties:{request:{type:H.STRING}},required:["request"]}},this.apiVariant!=="GEMINI_API"){let o=te(this.agent)&&this.agent.outputSchema;n.response=o?{type:H.OBJECT}:{type:H.STRING}}return n}async runAsync({args:n,toolContext:o}){var d,g,h,y,v,_;let i={role:"user",parts:[{text:te(this.agent)&&this.agent.inputSchema?JSON.stringify(n):n.request}]},s=new bo({appName:this.agent.name,agent:this.agent,artifactService:new Vu(o),sessionService:(d=o.invocationContext.sessionService)!=null?d:new Ao,memoryService:(g=o.invocationContext.memoryService)!=null?g:new So,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((y=o.abortSignal)!=null&&y.aborted)return;if(x.actions.stateDelta){let E=Object.fromEntries(Object.entries(x.actions.stateDelta).filter(([C])=>!C.startsWith(me.TEMP_PREFIX)));Object.keys(E).length>0&&o.state.update(E)}c=x}if(!((_=(v=c==null?void 0:c.content)==null?void 0:v.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(`
|
|
256
|
+
`);return l?JSON.parse(p):p}};a(Ow,"AgentTool");var Dw=Ow;var qF,VF,Mw=class Mw extends(VF=oe,qF=CT,VF){constructor(){super(...arguments);this[qF]=!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 w.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(Mw,"BuiltInTool");var gt=Mw;var Uw=class Uw extends oe{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:H.OBJECT,properties:{detail:{type:H.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(Uw,"ConsolidateContextTool");var Lw=Uw;function E8(t){if(!t.model)return;let e=Es();if(t.config=t.config||{},t.config.tools=t.config.tools||[],An(t.model)||e){if(Mr(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(E8,"applyEnterpriseWebSearch");var Fw=class Fw extends gt{constructor(){super({name:"enterprise_web_search",description:"Enterprise Web Search Tool"})}async applyBuiltInConfig({llmRequest:e}){E8(e)}};a(Fw,"EnterpriseWebSearchTool");var wp=Fw,S8=new wp;var C8=`<EXAMPLES>
|
|
257
|
+
Begin few-shot
|
|
258
|
+
The following are examples of user queries and model responses using the available tools.
|
|
259
|
+
|
|
260
|
+
`,T8=`End few-shot
|
|
261
|
+
<EXAMPLES>`,I8=`EXAMPLE {}:
|
|
262
|
+
Begin example
|
|
263
|
+
`,A8=`End example
|
|
264
|
+
|
|
265
|
+
`,ZF=`[user]
|
|
266
|
+
`,b8=`[model]
|
|
267
|
+
`,HF="```\n",w8="```tool_code\n",R8="\n```\n",k8="```tool_outputs\n",P8="\n```\n";function JF(t,e){var o;let n="";for(let[r,i]of t.entries()){let s=`${I8.replace("{}",String(r+1))}${ZF}`;(o=i.input)!=null&&o.parts&&(s+=i.input.parts.filter(l=>l.text).map(l=>l.text).join(`
|
|
268
|
+
`)+`
|
|
269
|
+
`);let u=!e||e.includes("gemini-2"),c;for(let l of i.output){let p=l.role==="model"?b8:ZF;p!==c&&(s+=p),c=p;for(let d of l.parts||[])if(d.functionCall){let g=u?HF:w8,h=d.functionCall,y=[];if(h.args)for(let[_,x]of Object.entries(h.args))typeof x=="string"?y.push(`${_}='${x}'`):y.push(`${_}=${x}`);let v=`${h.name}(${y.join(", ")})`;s+=`${g}${v}${R8}`}else d.functionResponse?s+=`${u?HF:k8}${JSON.stringify(d.functionResponse)}${P8}`:d.text&&(s+=`${d.text}
|
|
270
|
+
`)}s+=A8,n+=s}return`${C8}${n}${T8}`}a(JF,"convertExamplesToText");async function WF(t,e,n){if(Array.isArray(t))return JF(t,n);if(Mb(t))return JF(await t.getExamples(e),n);throw new Error("Invalid example configuration")}a(WF,"buildExampleSi");var Gw=class Gw extends oe{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)||Ue(o,[await WF(this.examples,r[0].text,o.model)])}};a(Gw,"ExampleTool");var zw=Gw;var Bw=class Bw extends oe{constructor(){super({name:"exit_loop",description:`Exits the loop.
|
|
271
|
+
|
|
272
|
+
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(Bw,"ExitLoopTool");var Rp=Bw,N8=new Rp;var KF=`
|
|
273
|
+
|
|
274
|
+
NOTE: This is a long-running operation. Do not call this tool again if it has already returned some intermediate or pending status.`,qw=class qw extends Dt{constructor(e){super({...e,isLongRunning:!0})}_getDeclaration(){let e=super._getDeclaration();return e.description?e.description+=KF:e.description=KF.trimStart(),e}};a(qw,"LongRunningFunctionTool");var wo=qw;var $8=new wo({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 D8(t){if(!t.model)return;let e=Es();if(t.config=t.config||{},t.config.tools=t.config.tools||[],Mr(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(D8,"applyGoogleMapsGrounding");var Vw=class Vw extends gt{constructor(){super({name:"google_maps",description:"Google Maps Grounding Tool"})}async applyBuiltInConfig({llmRequest:e}){D8(e)}};a(Vw,"GoogleMapsGroundingTool");var kp=Vw,O8=new kp;var Zw=class Zw 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||[],Mr(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(Zw,"GoogleSearchTool");var Pp=Zw,M8=new Pp;var L8=["image/","audio/","video/"],U8=new Set(["application/pdf"]),F8=new Set(["application/csv","application/json","application/xml"]);function jF(t){if(t)return t.split(";")[0].trim()}a(jF,"normalizeMimeType");function z8(t){let e=jF(t);return e?L8.some(n=>e.startsWith(n))||U8.has(e):!1}a(z8,"isInlineMimeTypeSupported");function G8(t,e){let n=t.inlineData;if(!n||z8(n.mimeType))return t;let o=jF(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/")||F8.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(G8,"asSafePartForLlm");var Hw=class Hw extends oe{constructor(){super({name:"load_artifacts",description:`Loads artifacts into the session for this request.
|
|
275
|
+
|
|
276
|
+
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:H.OBJECT,properties:{artifact_names:{type:H.ARRAY,items:{type:H.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;Ue(n,[`You have a list of artifacts:
|
|
277
|
+
${JSON.stringify(o)}
|
|
278
|
+
|
|
279
|
+
When the user asks questions about any of the artifacts, you should call the
|
|
280
|
+
\`load_artifacts\` function to load the artifact. Always call load_artifacts
|
|
281
|
+
before answering questions related to the artifacts, regardless of whether the
|
|
282
|
+
artifacts have been loaded before. Do not depend on prior answers about the
|
|
283
|
+
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 y=(g.response||{}).artifact_names||[];for(let v of y)v&&!s.includes(v)&&s.push(v)}}}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){w.warn(`Artifact "${l}" not found, skipping`);continue}let d=G8(p,l);n.contents.push({role:"user",parts:[{text:`Artifact ${l} is:`},d]})}}};a(Hw,"LoadArtifactsTool");var Np=Hw,B8=new Np;var Jw=class Jw extends oe{constructor(){super({name:"load_memory",description:`Loads the memory for the current user.
|
|
284
|
+
|
|
285
|
+
NOTE: Currently this tool only uses text part from the memory.`})}_getDeclaration(){return{name:this.name,description:this.description,parameters:{type:H.OBJECT,properties:{query:{type:H.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&&Ue(e.llmRequest,[`You have memory. You can use it to answer questions. If any questions need
|
|
286
|
+
you to look up the memory, you should call load_memory function with a query.`])}};a(Jw,"LoadMemoryTool");var $p=Jw,q8=new $p;var Ww=class Ww extends oe{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){w.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(y=>{var v;return(v=y.text)!=null?v:""}).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.
|
|
287
|
+
They may be useful for answering the user's current query.
|
|
288
|
+
<PAST_CONVERSATIONS>
|
|
289
|
+
${i.join(`
|
|
290
|
+
`)}
|
|
291
|
+
</PAST_CONVERSATIONS>
|
|
292
|
+
`;Ue(e.llmRequest,[u])}};a(Ww,"PreloadMemoryTool");var Dp=Ww,V8=new Dp;var Z8=new wo({name:Le,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 Kw=class Kw extends oe{_getDeclaration(){return{name:this.name,description:this.description,parameters:{type:H.OBJECT,properties:{query:{type:H.STRING,description:"The query to retrieve."}}}}}};a(Kw,"BaseRetrievalTool");var Zu=Kw;var Yw=class Yw extends Zu{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(Yw,"LlamaIndexRetrieval");var jw=Yw;var Xw=class Xw 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(Xw,"UrlContextTool");var Op=Xw,H8=new Op;var eR=class eR 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=Es();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(Mr(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(", ")}]`}w.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(eR,"VertexAiSearchTool");var Qw=eR;var nR=class nR 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(nR,"VertexRagRetrievalTool");var tR=nR;function J8(t){if(!t)return H.TYPE_UNSPECIFIED;switch(t.toLowerCase()){case"text":case"string":return H.STRING;case"number":return H.NUMBER;case"boolean":return H.BOOLEAN;case"integer":return H.INTEGER;case"array":return H.ARRAY;case"object":return H.OBJECT;case"null":return H.NULL;default:return H.TYPE_UNSPECIFIED}}a(J8,"toGeminiType");var YF=a(t=>{var e,n;return typeof t=="string"?t.toLowerCase():(n=(e=t==null?void 0:t.type)==null?void 0:e.toLowerCase)==null?void 0:n.call(e)},"getTypeFromArrayItem");function XF(t){if(!t)return;function e(n){var c;let o=(c=n.anyOf)!=null?c:n.type,r=!1,i;if(Array.isArray(o)){let l=!!n.anyOf,p=o.map(d=>typeof d!="boolean"?d:l?{type:"object"}:"object");if(n=l?{...n,anyOf:p}:{...n,type:p},i=p.filter(d=>YF(d)!=="null"),r=p.some(d=>YF(d)==="null"),i.length===1){let d=i[0];if(typeof d=="object")n=d;else{let{type:g,anyOf:h,...y}=n;n={...y,type:d}}}else if(i.length===0&&r){let{type:d,anyOf:g,...h}=n;n={...h,type:"null"}}else if(typeof n.anyOf>"u"){let d=n.type.map(y=>({type:y})),{type:g,...h}=n;n={...h,anyOf:d}}}if(!n.type){if(n.properties||n.$ref)n.type="object";else if(n.items)n.type="array";else if(r)n.type="null";else if(n.enum){let l=new Set(n.enum.map(p=>typeof p));if(l.size===1){let p=[...l][0];p==="string"?n.type="string":p==="number"?n.type="number":p==="boolean"&&(n.type="boolean")}}else if(n.const!==void 0){let l=typeof n.const,p;l==="string"?p="string":l==="number"?p="number":l==="boolean"&&(p="boolean"),n={...n,type:p,enum:[n.const]}}}let s=J8(n.type),u={};if(n.anyOf?u.anyOf=n.anyOf.map(l=>e(l)):u.type=s,n.description&&(u.description=n.description),n.enum&&(u.enum=n.enum.filter(l=>l!=null).map(String)),r&&n.type!=="null"&&(u.nullable=!0),s===H.OBJECT){if(u.properties={},n.properties)for(let l in n.properties)u.properties[l]=e(n.properties[l]);n.required&&(u.required=n.required)}else s===H.ARRAY&&n.items&&(u.items=e(n.items));return u}return a(e,"recursiveConvert"),e(t)}a(XF,"toGeminiSchema");function tr(t){let e=t!=null?t:globalThis.document;return e==null?void 0:e.modelContext}a(tr,"getModelContext");function W8(t){return!!tr(t)}a(W8,"isWebMCPSupported");var rR=new WeakMap;function oR(t){var n,o;let e="";if(typeof t=="string")e=t;else if(t&&typeof t=="object"){let r=t;e=String((o=(n=r.error)!=null?n:r.message)!=null?o:"")}return/failed to parse input arguments|could not parse .*arguments/i.test(e)}a(oR,"isArgParseFailure");var iR=class iR extends oe{constructor(e){var n,o;super({name:(n=e.name)!=null?n:e.tool.name,description:(o=e.tool.description)!=null?o:""}),this.webmcpTool=e.tool,this.doc=e.document}resolveInputSchema(){let e=this.webmcpTool.inputSchema;if(e!=null){if(typeof e=="string")try{let n=JSON.parse(e);return typeof n=="object"&&n!==null?n:void 0}catch(n){w.warn(`WebMCP tool '${this.webmcpTool.name}' has an inputSchema string that is not valid JSON; exposing it with no parameters.`);return}if(typeof e=="object")return e}}_getDeclaration(){var o;let e=this.resolveInputSchema(),n=e?(o=XF(e))!=null?o:{type:H.OBJECT,properties:{}}:{type:H.OBJECT,properties:{}};return e&&!n.properties&&w.warn(`WebMCP tool '${this.webmcpTool.name}' declared an inputSchema that produced no parameters; the model will be unable to pass arguments.`),{name:this.name,description:this.description,parameters:n}}async checkRequireConfirmation(){var e;return!!((e=this.webmcpTool.annotations)!=null&&e.consequentialHint)}async runAsync(e){var p,d;let n=tr(this.doc);if(!n)throw new Error("document.modelContext is unavailable, so WebMCP tools cannot be executed. WebMCP requires a browser with the API enabled.");let o=(p=e.args)!=null?p:{},r=(d=e.toolContext)==null?void 0:d.abortSignal,i=r?{signal:r}:void 0,s=a(g=>n.executeTool(this.webmcpTool,g==="json-string"?JSON.stringify(o):o,i),"invoke"),u=rR.get(n);if(u)return await s(u);let c;try{if(c=await s("object"),!oR(c))return rR.set(n,"object"),c}catch(g){if(!oR(g))throw g;c=g}let l=await s("json-string");return oR(l)?c:(rR.set(n,"json-string"),w.debug("This browser expects JSON-string WebMCP tool arguments; using that encoding."),l)}};a(iR,"WebMCPTool");var Hu=iR;var aR=class aR extends Bu{constructor(n={}){var o;super((o=n.toolFilter)!=null?o:[],n.prefix);this.changeListeners=new Set;this.doc=n.document,this.fromOrigins=n.fromOrigins}isSupported(){return!!tr(this.doc)}async getTools(n){let o=tr(this.doc);if(!o)return w.debug("document.modelContext is unavailable; WebMCPToolset is exposing no tools."),[];let i=(await o.getTools(this.fromOrigins?{fromOrigins:this.fromOrigins}:void 0)).map(u=>new Hu({tool:u,name:this.prefix?`${this.prefix}_${u.name}`:u.name,document:this.doc})),s=this.toolFilter;return!s||Array.isArray(s)&&s.length===0?i:Array.isArray(s)?i.filter(u=>s.includes(u.name)):n?i.filter(u=>s(u,n)):(w.warn("WebMCPToolset: a ToolPredicate toolFilter was provided but getTools() was called without a ReadonlyContext. The filter will not be applied."),i)}onToolChange(n){let o=tr(this.doc);if(!o)return()=>{};let r=a(()=>n(),"handler");return this.changeListeners.add(r),o.addEventListener("toolchange",r),()=>{o.removeEventListener("toolchange",r),this.changeListeners.delete(r)}}async close(){let n=tr(this.doc);if(n)for(let o of this.changeListeners)n.removeEventListener("toolchange",o);this.changeListeners.clear()}};a(aR,"WebMCPToolset");var sR=aR;function QF(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}a(QF,"escapeHtml");function ez(t){if(!t||t.length===0)return`<available_skills>
|
|
293
|
+
</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>${QF(o.name)}</name>`),e.push(` <description>${QF(o.description)}</description>`),e.push(" </skill>")}return e.push("</available_skills>"),e.join(`
|
|
294
|
+
`)}a(ez,"formatSkillsAsXml");var Ro=class extends oe{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:H.OBJECT,properties:{}}}}async runAsync(n){let o=Object.values(this.toolset.skills);return ez(o)}};a(Ro,"ListSkillsTool"),Ro=Pe([tt],Ro);var ko=class extends oe{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:H.OBJECT,properties:{name:{type:H.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_${Ke(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(ko,"LoadSkillTool"),ko=Pe([tt],ko);var Po=class extends oe{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:H.OBJECT,properties:{query:{type:H.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]?(w.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(Po,"SearchSkillsTool"),Po=Pe([tt],Po);function tz(t,e={}){return Wt(t,e)}a(tz,"node");var zr=class extends ze{async*runImpl(e,n){yield*this.runNodeImpl(e,n)}};a(zr,"WorkflowNode"),zr=Pe([tt],zr);var uR=class uR extends ze{get requiresAllPredecessors(){return!0}async*runImpl(e,n){yield W({author:this.name,invocationId:e.invocationId,branch:e.branch,output:n})}};a(uR,"JoinNode");var Mp=uR;var K8=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function rz(t){if(!K8.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(rz,"validateAppName");var lR=Symbol.for("google.adk.app");function j8(t){return typeof t=="object"&&t!==null&&lR in t&&t[lR]===!0}a(j8,"isApp");var nz;nz=lR;var dR=class dR{constructor(e){this[nz]=!0;var n;if(rz(e.name),e.rootAgent===void 0||e.rootAgent===null)throw new Error("rootAgent must be provided.");this.name=e.name,this.rootAgent=Os(e.rootAgent),this.plugins=(n=e.plugins)!=null?n:[],this.resumabilityConfig=e.resumabilityConfig}};a(dR,"App");var cR=dR;pR();export{Io as ADK_HANDLE_MODEL_ERROR_TOOL_NAME,rA as AUTH_PREPROCESSOR,Hp as ActiveStreamingTool,vp as Agent,pb as AgentControlledContextCompactor,Dw as AgentTool,ip as AgentTransferLlmRequestProcessor,Ib as AlreadyExistsError,gb as AnchoredContextCompactor,Tu as ApigeeLlm,cR as App,cn as AsyncQueue,hu as AuthCredentialTypes,Ht as AuthHandler,op as AuthPreprocessor,ib as AuthProviderRegistry,$t as BaseAgent,Ru as BaseCodeExecutor,Eo as BaseEnvironment,Uu as BaseExampleProvider,Yn as BaseLlm,ke as BaseLlmRequestProcessor,wu as BaseLlmResponseProcessor,ze as BaseNode,fo as BasePlanner,Mt as BasePlugin,Zu as BaseRetrievalTool,Gu as BaseSessionService,oe as BaseTool,Bu as BaseToolset,$r as BranchPath,ku as BuiltInCodeExecutor,QI as BuiltInPlanner,gt as BuiltInTool,cp as CONTENT_REQUEST_PROCESSOR,Se as CallbackContext,Au as ChromeBuiltInLlm,Iu as ChromeModelUnavailableError,fA as CodeExecutionLanguage,Lw as ConsolidateContextTool,lp as ContentRequestProcessor,Se as Context,fp as ContextCompactionTrigger,bs as ContextCompactorRequestProcessor,It as CredentialExchangeError,db as CredentialRefresherRegistry,Ds as DEFAULT_ROUTE,S8 as ENTERPRISE_WEB_SEARCH,N8 as EXIT_LOOP,Fr as Edge,wp as EnterpriseWebSearchTool,mF as EventType,zw as ExampleTool,Rp as ExitLoopTool,Uf as FINISH_TASK_SUCCESS_RESULT,Eu as FINISH_TASK_TOOL_NAME,LL as FeatureName,t5 as FeatureStage,gU as FileContentEncoding,xu as FinishTaskTool,Vu as ForwardingArtifactService,gs as FunctionNode,Dt as FunctionTool,SF as GLOBAL_SCOPE_KEY,O8 as GOOGLE_MAPS_GROUNDING,M8 as GOOGLE_SEARCH,co as Gemini,Jb as GlobalInstructionPlugin,cu as GoogleLLMVariant,kp as GoogleMapsGroundingTool,Pp as GoogleSearchTool,qu as Graph,RA as INTERACTIONS_REQUEST_PROCESSOR,CT as IN_MODEL_TOOL_SYMBOL,Lu as InMemoryArtifactService,ab as InMemoryCredentialService,So as InMemoryMemoryService,Sp as InMemoryPolicyEngine,kw as InMemoryRunner,Ao as InMemorySessionService,bb as InputValidationError,uo as IntentMismatchError,mp as InteractionsRequestProcessor,Jt as InvocationContext,Mp as JoinNode,Ur as LLMRegistry,B8 as LOAD_ARTIFACTS,q8 as LOAD_MEMORY,Ro as ListSkillsTool,eI as LiveRequestQueue,jw as LlamaIndexRetrieval,vp as LlmAgent,yb as LlmSummarizer,Np as LoadArtifactsTool,$p as LoadMemoryTool,ko as LoadSkillTool,Ls as LogLevel,Kb as LoggingPlugin,wo as LongRunningFunctionTool,vo as LoopAgent,Tn as NodeContext,cs as NodeReportedError,ao as NodeSchemaValidationError,lo as NodeStatus,ls as NodeTimeoutError,vs as NodeTool,Rb as NotFoundError,fu as OAuth2CredentialExchanger,bT as OAuth2DiscoveryManager,IT as OAuthGrantType,V8 as PRELOAD_MEMORY,_o as ParallelAgent,hs as ParallelWorker,Vb as PlanReActPlanner,zu as PluginManager,IF as PolicyOutcome,Dp as PreloadMemoryTool,To as REFLECT_AND_RETRY_RESPONSE_TYPE,je as REQUEST_CONFIRMATION_FUNCTION_CALL_NAME,Ve as REQUEST_CREDENTIAL_FUNCTION_CALL_NAME,Le as REQUEST_INPUT_FUNCTION_CALL_NAME,nw as RESERVED_TOOL_CALL_ERROR_TYPE,xe as ReadonlyContext,rw as ReflectAndRetryModelPlugin,iw as ReflectAndRetryToolPlugin,bf as RequestInput,QA as RoutedAgent,Gb as RoutedLlm,bo as Runner,ln as START,Ns as ScopedArtifactService,Co as ScopedFailureTracker,Po as SearchSkillsTool,uw as SecurityPlugin,xo as SequentialAgent,Pb as SessionNotFoundError,lb as SessionStateCredentialService,me as State,pu as StateSchemaError,ZA as StreamingMode,Us as Task,_b as TokenBasedContextCompactor,Pr as ToolConfirmation,Se as ToolContext,pF as ToolErrorType,$b as ToolExecutionError,ys as ToolNode,Ep as TrackingScope,Eb as TrajectoryThoughtPruningCompactor,Cb as TruncatingContextCompactor,H8 as URL_CONTEXT,Op as UrlContextTool,Ub as VertexAiExampleStore,Qw as VertexAiSearchTool,tR as VertexRagRetrievalTool,Hu as WebMCPTool,sR as WebMCPToolset,wn as Workflow,zr as WorkflowNode,Os as asRunnableRoot,Gf as commonPrefixOf,W as createEvent,Ft as createEventActions,Vf as createNodeErrorEvent,jn as createNodeState,kQ as createResumabilityConfig,Cp as createSession,zf as createSubBranch,UF as determineAgentForResumption,jM as findEventByFunctionCallId,FF as findEventByLastFunctionResponseId,VT as findMatchingFunctionCall,MX as functionsExportedForTestingOnly,tp as geminiInitParams,wt as generateClientFunctionCallId,KQ as getAskUserConfirmationFunctionCalls,NL as getClientLabels,$I as getFeatureConfig,le as getFunctionCalls,ce as getFunctionResponses,cz as getLogger,tr as getModelContext,sQ as getPendingUserInputRequests,$8 as getUserChoiceTool,LA as getUserInputRequests,wl as hasThoughts,PP as hasTrailingCodeExecutionResult,x8 as isAgentTool,j8 as isApp,qX as isAuthCredential,Kn as isBaseAgent,Mb as isBaseExampleProvider,_I as isBaseLlm,jI as isBasePlanner,du as isBaseTool,gw as isBaseToolset,bu as isBuiltInPlanner,dn as isCompactedEvent,FL as isFeatureEnabled,lr as isFinalResponse,QX as isFunctionTool,Qn as isGemini2OrAbove,Yf as isGemini35LiveTranslate,s5 as isGemini3xFlashLive,er as isGemini3xLive,CX as isInModelTool,DX as isIntentMismatchError,te as isLlmAgent,SQ as isLoopAgent,Bf as isNodeErrorEvent,MM as isNodeReportedError,LM as isNodeSchemaValidationError,EL as isNodeState,OM as isNodeTimeoutError,CQ as isParallelAgent,wf as isRequestInput,ww as isRoutableLlmAgent,bQ as isRoutedAgent,Aw as isRunnableRoot,g8 as isRunner,Ts as isScratchpadEvent,RQ as isSequentialAgent,xp as isSessionArtifactService,$X as isStateSchemaError,FX as isToolNotFound,W8 as isWebMCPSupported,bp as isWorkflow,w as logger,dw as mergeStates,tz as node,ET as normalizeRetryExceptions,PCe as overrideFeatureEnabled,js as populateClientFunctionCallId,ps as prepareRetryConfig,cm as pruneThoughts,kCe as registerFeature,E5 as renameReservedKeywords,Z8 as requestInputTool,Ke as requireAgent,UA as requiresUserInput,dz as resetLogger,Fu as resolveScopeKey,Z3 as runWithClientLabel,fz as setLogLevel,zp as setLogger,bl as stringifyContent,nU as stripAdkIdentityPreamble,lU as toSnakeCaseName,LQ as toStructuredEvents,jQ as trimTempDeltaState,AF as trimTempState,rz as validateAppName,Ys as version,NCe as withTemporaryFeatureOverride,kr as zodObjectToSchema};
|
|
3
295
|
/**
|
|
4
296
|
* @license
|
|
5
297
|
* Copyright 2025 Google LLC
|
|
6
298
|
* SPDX-License-Identifier: Apache-2.0
|
|
7
299
|
*/
|
|
8
|
-
|
|
300
|
+
/**
|
|
301
|
+
* @license
|
|
302
|
+
* Copyright 2026 Google LLC
|
|
303
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
304
|
+
*/
|
|
305
|
+
/*! Bundled license information:
|
|
306
|
+
|
|
307
|
+
lodash-es/lodash.js:
|
|
308
|
+
(**
|
|
309
|
+
* @license
|
|
310
|
+
* Lodash (Custom Build) <https://lodash.com/>
|
|
311
|
+
* Build: `lodash modularize exports="es" --repo lodash/lodash#4.18.1 -o ./`
|
|
312
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
313
|
+
* Released under MIT license <https://lodash.com/license>
|
|
314
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
315
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
316
|
+
*)
|
|
317
|
+
|
|
318
|
+
@google/genai/dist/web/index.mjs:
|
|
319
|
+
@google/genai/dist/web/index.mjs:
|
|
320
|
+
@google/genai/dist/web/index.mjs:
|
|
321
|
+
@google/genai/dist/web/index.mjs:
|
|
322
|
+
(**
|
|
323
|
+
* @license
|
|
324
|
+
* Copyright 2025 Google LLC
|
|
325
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
326
|
+
*)
|
|
327
|
+
|
|
328
|
+
@google/genai/dist/web/index.mjs:
|
|
329
|
+
(**
|
|
330
|
+
* @license
|
|
331
|
+
* Copyright 2025 Google LLC
|
|
332
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
333
|
+
*)
|
|
334
|
+
(**
|
|
335
|
+
* @license
|
|
336
|
+
* Copyright 2026 Google LLC
|
|
337
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
338
|
+
*
|
|
339
|
+
* g3-prettier-ignore-file
|
|
340
|
+
*)
|
|
341
|
+
*/
|
|
342
|
+
//# sourceMappingURL=index_web.js.map
|